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

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. 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

Step 1: Set Up the Circuit

  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

Step 2: Write the Coding

Step 3: Create a Dashboard Using Node Red

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.

Step 4: Download MY MQTT on Your Phone

  1. Download My MQTT on your phone
  2. Subscribe to the topic
  3. The Dashboard will be shown in the image attached above.

Step 5: Prepare the Container

  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.

Step 6: Components Arrangement

  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.

Step 7: Secure the Container

  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.

Step 8: Deploy the Project!

  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.