connect@howdiyworld.com
|

Ammonia Gas Leakage Detection

What is Needed

Ammonia Sensor
ADS1115 16-bit ADC 4 channel
Jumpers
Blynk Mobile App
HowDIY

BLOCK DIAGRAM

Procedure

  1. Ammonia Sensor, ADS1115 16-bit ADC 4 channel
  2. Setting up Blynk App
  3. Connections
  4. Program
  5. Output

Procedure

Ammonia Sensor

Ammonia detector works on electrochemical principle. … Voltage, electrolyte and electrode material are selected to suit the gas being monitored so that it is transformed electrochemically on the measuring electrode and a current flows through the sensor. This current is proportional to the gas concentration.

ADS1115 16-bit ADC 4 channel

The ADS1115 is an external digital analog converter (ADC) that we can connect to a processor like Raspberry Pi to measure analog signals. Raspberry Pi doesn’t have internal ADCs that we use when we use the Raspberry Pi analog inputs.

Install Blynk App

  • Sign in and add new device (Raspberry Pi 3) in Blynk App.
  • An Authentication code will be sent to your mail
  • Check the Authentication code and replace it in the Python Code.

Create a Value Display

  • Click the + Button
  • Select Value Display
  • A Value Display is created to edit it’s properties click the created Display
  • Now in the Value Display settings click the PIN Button
  • In the Select PIN pop-up, Select Virtual and V8
  • You can change the Name and output should be 0 and 1023

Connections

Connect Ammonia Gas Sensor’s VCC to 2nd pin.

Connect Ammonia Gas Sensor’s GND to 9th pin.

Connect ADS1115’s VCC to 1st pin.

Connect ADS1115’s GND to 6th pin.

Connect ADS1115’s SCL to 5th pin.

Connect ADS1115’s SDA to 3rd pin.

Connect ADS1115’s A0 to Ammonia Gas Sensor’s AOUT or A0.

Program

from gpiozero import LED, Button, Buzzer

import blynklib

import Adafruit_ADS1x15

import time

BLYNK_AUTH = 'Enter_Your_AUTH_Code'

adc = Adafruit_ADS1x15.ADS1115()

GAIN = 1

Initialize Blynk

blynk = blynklib.Blynk(BLYNK_AUTH)

Register Virtual Pins

@blynk.handle_event('read V22')

def my_write_handler(value):

print('Current V1 value: {}'.format(value[0]))

if int(format(value[0])) == 1:

led8.on()

else:

led8.off()

def my_user_task():

ammonia = adc.read_adc(2, gain=GAIN)

ammonia=ammonia/500

print(ammonia)

blynk.virtual_write(8, '{:.2f}'.format(ammonia))

time.sleep(2)

try:

while True:

blynk.run()

my_user_task()

except KeyboardInterrupt:

sys.exit(0)

Output

The Ammonia level will be updated on your mobile application (Output Visible in Mobile VIA Application)

Social media & sharing icons powered by UltimatelySocial
Facebook
Twitter
YouTube
LinkedIn
Instagram