ESP32 MQ135-Gas Sensor(Air Quality Index) - Group 9
by ainatajuddin in Circuits > Sensors
5860 Views, 3 Favorites, 0 Comments
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
- ESP32 - 1
- BreadBoard - 1
- MQ135 sensor - 1
- Male to Male wire - 3
- Male to Female wire - 4
- Resistor - 3
- LED - 1
- Container
- Tape
- Powerbank
- Glue
- Cable Tie
Set Up the Circuit
- ESP32 - 1
- BreadBoard - 1
- MQ135 sensor - 1
- Male to Male wire - 3
- Male to Female wire - 4
- Resistor - 3
- LED - 1
Write the Coding
Downloads
Create a Dashboard Using Node Red
For Air Quality Index Dashboard
- Open node red
- Add MQTT In Node
- Add Debug Node
- Add Gauge Node
- Connect Debug and Gauge Node to MQTT In Node
For Led
- Add Switch Node
- Add Function Node
- Add MQTT In Node
- Connect Function Node to Switch Node
- Then, Connect MQTT In Node to Function Node
Follow the diagram attached above.
Download MY MQTT on Your Phone
- Download My MQTT on your phone
- Subscribe to the topic
- The Dashboard will be shown in the image attached above.
Prepare the Container
- Get a container that can fit all the components needed.
- Make a hole under the container that can fit the head of the gas sensor.
- Spray the waterproof leaking spray if there is any leakage after making the hole.
- Take a small cup to cover the head of the gas sensor from the rain or sun.
- Make a hole at the bottom of the cup, make sure the hole is the same size as the hole from the container.
- Grinding the surface of the cup to make it a bit rough for the glue to stick harder.
- Attach the cup with the container using any glue.
- Sealed once again with the waterproof leaking spray to make sure no water can get inside.
Components Arrangement
- Stick the lid to the container.
- Attach the MQ135 sensor at the hole made earlier.
- Put all the components inside the container.
- Organize all the components neatly to fit the container.
- Use tape or glue to stick all the components inside the container.
Secure the Container
- Secure the whole container with the tape.
- Use the cable tie to attach the lid and the body of the container.
- Tape the edges of the container to make sure it is not easy to be opened and the water cannot get inside the container.
- Tape the crack caused by the cable tie.
- 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!
- Put the cable tie on one side of the container.
- Find a suitable spot to suspend the container.
- Hang the container with a cable tied to a steel pole to ensure the container is fixed in place.
- Tightly secure the container with another cable tie wrap all around.
- Leave for a few days to collect data from the sensor.