connect@howdiyworld.com
|

Air Quality Monitoring

What is Needed?

CO2 Gas Sensor
ADS1115 16-bit ADC 4 channel
Humidity sensor(DHT11)
Jumpers
Blynk Mobile App
HowDIY

BLOCK DIAGRAM

Procedure

  1. CO2 Gas Sensor, ADS1115 16-bit ADC 4 channel, Humidity sensor(DHT11),
  2. Setting up Blynk App
  3. Connections
  4. Program
  5. Output

Procedure

CO2 Gas Sensor

 How CO, CO2 Sensor works: A hydrogen sensor is a gas detector that detects the presence of hydrogen. They contain micro-fabricated point-contact hydrogen sensors and are used to locate hydrogen leaks. They are considered low-cost, compact, durable, and easy to maintain as compared to conventional gas detecting instruments.

ADS1115 16-bit ADC 4 channel

HOW ADS1115 works: 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.

Humidity sensor(DHT11)

The humidity sensing component of the DHT11 is a moisture holding substrate with the electrodes applied to the surface. … The DHT11 converts the resistance measurement to relative humidity on a chip mounted to the back of the unit and transmits the humidity and temperature readings directly to the Raspberry Pi.

Download Blynk Mobile Application.

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

Create a new 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 V7
    • You can change the Name and output should be 0 and 1023
    • As the same procedure create another Value Display for Humidity Value in Virtual and V3
    • As the same procedure create another Value Display for Temperature Value in Virtual and V2

    Now if you go back you can see that you have successfully created Value Display.

Connections

  • Connect Hydrogen Sensor’s VCC to 2nd
  • Connect Hydrogen Sensor’s GND to 9th
  • Connect ADS1115’s VCC to 1st
  • Connect ADS1115’s GND to 6th
  • Connect ADS1115’s SCL to 5th
  • Connect ADS1115’s SDA to 3rd
  • Connect ADS1115’s A0 to Hydrogen Sensor’s AOUT or A0.
  • Connect Humidity Sensor’s VCC to 4th
  • Connect Humidity Sensor’s GND to 14th
  • Connect Humidity Sensor’s OUT to 7th

Program

from gpiozero import LED, Button, Buzzer
import blynklib
import Adafruit_DHT
import Adafruit_ADS1x15
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]))

def my_user_task():
Co2_level = adc.read_adc(2, gain=GAIN)
humidity, temperature = Adafruit_DHT.read_retry(11, 4)
Co2_level=Co2_level/500
blynk.virtual_write(7, ‘{:.2f}’.format(Co2_level))
print (‘Temp: {0:0.1f} C Humidity: {1:0.1f} %’.format(temperature, humidity))
#print(‘Humidity = {:.2f}%tTemperature = {:.2f}C’.format(humidity, temperature))
blynk.virtual_write(2, ‘{:.2f}’.format(temperature))
blynk.virtual_write(3, ‘{:.2f}’.format(humidity))
time.sleep(2)

try:
while True:
blynk.run()
my_user_task()

except KeyboardInterrupt:
sys.exit(0)

Output

The Hydrogen Value, Temperature and Humidity 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