ESP32 MQ135-Gas Sensor(Air Quality Index) - Group 9

by ainatajuddin in Circuits > Sensors

5937 Views, 3 Favorites, 0 Comments

ESP32 MQ135-Gas Sensor(Air Quality Index) - Group 9

WhatsApp Image 2024-01-09 at 12.55.54 PM.jpeg
Complete Step MQ135 Gas Sensor (Air Quality Index)

A gas sensor project using the ESP32 microcontroller involves connecting gas sensors to measure concentrations of various gases in the air, such as CO2, CO, CH4, and NH3. The ESP32 reads sensor data periodically, and after calibration, the collected information is used to calculate the Air Quality Index (AQI) based on standard formulas for individual gases. In our projects using the MQ135 with microcontrollers like the ESP32, the sensor's analog output can be read and processed to determine the concentration of the detected gases. By calibrating and interpreting the sensor readings, one can assess the air quality and even calculate an Air Quality Index (AQI) for comprehensive monitoring and analysis.

Supplies

1.jpg
WhatsApp Image 2024-01-09 at 12.50.39 PM.jpeg
  1. ESP32 - 1
  2. BreadBoard - 1
  3. MQ135 sensor - 1
  4. Male to Male wire - 3
  5. Male to Female wire - 4
  6. Resistor - 3
  7. LED - 1
  8. Container
  9. Tape
  10. Powerbank
  11. Glue
  12. Cable Tie

Set Up the Circuit

WhatsApp Image 2024-01-09 at 12.55.54 PM.jpeg
2.jpg
WhatsApp Image 2024-01-09 at 12.50.32 PM.jpeg
  1. ESP32 - 1
  2. BreadBoard - 1
  3. MQ135 sensor - 1
  4. Male to Male wire - 3
  5. Male to Female wire - 4
  6. Resistor - 3
  7. LED - 1

Write the Coding

Create a Dashboard Using Node Red

Circuits component (1).jpg
download.png
Screenshot 2024-01-09 133010.png
Screenshot 2024-01-09 133042.png
Screenshot 2024-01-09 133106.png
Screenshot 2024-01-09 133134.png

For Air Quality Index Dashboard

  1. Open node red
  2. Add MQTT In Node
  3. Add Debug Node
  4. Add Gauge Node
  5. Connect Debug and Gauge Node to MQTT In Node

For Led

  1. Add Switch Node
  2. Add Function Node
  3. Add MQTT In Node
  4. Connect Function Node to Switch Node
  5. Then, Connect MQTT In Node to Function Node

Follow the diagram attached above.

Download MY MQTT on Your Phone

Circuits component.jpg
photo_6118331735679810189_y.jpg
photo_6118331735679810188_y (1).jpg
  1. Download My MQTT on your phone
  2. Subscribe to the topic
  3. The Dashboard will be shown in the image attached above.

Prepare the Container

2.jpg
WhatsApp Image 2024-01-09 at 2.05.53 PM.jpeg
WhatsApp Image 2024-01-09 at 2.05.56 PM.jpeg
WhatsApp Image 2024-01-09 at 2.05.57 PM.jpeg
WhatsApp Image 2024-01-09 at 2.05.58 PM (1).jpeg
WhatsApp Image 2024-01-09 at 2.05.59 PM.jpeg
WhatsApp Image 2024-01-09 at 2.05.57 PM (1).jpeg
WhatsApp Image 2024-01-09 at 2.05.58 PM.jpeg
WhatsApp Image 2024-01-09 at 2.05.59 PM (1).jpeg
  1. Get a container that can fit all the components needed.
  2. Make a hole under the container that can fit the head of the gas sensor.
  3. Spray the waterproof leaking spray if there is any leakage after making the hole.
  4. Take a small cup to cover the head of the gas sensor from the rain or sun.
  5. Make a hole at the bottom of the cup, make sure the hole is the same size as the hole from the container.
  6. Grinding the surface of the cup to make it a bit rough for the glue to stick harder.
  7. Attach the cup with the container using any glue.
  8. Sealed once again with the waterproof leaking spray to make sure no water can get inside.

Components Arrangement

3.jpg
WhatsApp Image 2024-01-09 at 2.34.57 PM.jpeg
WhatsApp Image 2024-01-09 at 2.34.58 PM.jpeg
WhatsApp Image 2024-01-09 at 2.34.56 PM (2).jpeg
WhatsApp Image 2024-01-09 at 2.34.56 PM (1).jpeg
WhatsApp Image 2024-01-09 at 2.34.56 PM.jpeg
  1. Stick the lid to the container.
  2. Attach the MQ135 sensor at the hole made earlier.
  3. Put all the components inside the container.
  4. Organize all the components neatly to fit the container.
  5. Use tape or glue to stick all the components inside the container.

Secure the Container

4.jpg
WhatsApp Image 2024-01-09 at 2.40.45 PM.jpeg
WhatsApp Image 2024-01-09 at 2.39.47 PM.jpeg
WhatsApp Image 2024-01-09 at 2.40.45 PM (1).jpeg
WhatsApp Image 2024-01-09 at 2.56.57 PM (2).jpeg
  1. Secure the whole container with the tape.
  2. Use the cable tie to attach the lid and the body of the container.
  3. Tape the edges of the container to make sure it is not easy to be opened and the water cannot get inside the container.
  4. Tape the crack caused by the cable tie.
  5. Cover the whole container with tape to make sure the power bank and the other components are directly exposed to the sun.

Deploy the Project!

5.jpg
WhatsApp Image 2024-01-09 at 2.53.29 PM.jpeg
WhatsApp Image 2024-01-09 at 2.53.31 PM (1).jpeg
WhatsApp Image 2024-01-09 at 2.53.31 PM.jpeg
  1. Put the cable tie on one side of the container.
  2. Find a suitable spot to suspend the container.
  3. Hang the container with a cable tied to a steel pole to ensure the container is fixed in place.
  4. Tightly secure the container with another cable tie wrap all around.
  5. Leave for a few days to collect data from the sensor.