The system will be an ESP32 NodeMCU-based Air Quality monitoring system for checking PM, particulate matter (PM) as well as humidity as well as temperature, altitude as well as pressure. The various aspects of the environment of the location are tested and then displayed on the TFT screen and also using the ThingSpeak IoT (Internet of Things) platform. The prototype developed by the author is shown in Fig. 1.
Particulate matter
Dust and PM pose a health risk. PM2.5 can be smaller than 2.5 microns in diameter as is PM10 lower than 10 microns wide. This means that a PM10 report will also include PM2.5 too. Both particles are shorter than thehair of a human which is approximately 70 microns in diameter.
PM10
An operation like stone crushing the grinding of coal, and rotary kilning within the industry of cement, as well as dust on roads stirred by vehicles that move, can increase levels of PM10. The PM10 limit for 24-hours is 150 ug/m3.
PM2.5
It is the result of fine particles that are produced by any type of combustion such as motor vehicles thermal power plants, the burning of wood in residential homes, fires that are forest-related agricultural burning, and various other industrial processes. PM2.5 limit for the 24-hour average is 35ug/m3.
Circuit, working
This diagram for the air quality system based on IoT is illustrated in Figure. 2. It comprises of ESP32 NodeMCU SDS011, BME280 ILI9163 TFT display, resistor as well as transistor 2N2219. ESP32 NodeMCU is at the center part of this circuit. The details for connecting various module to ESP32 board are listed in the tables I II, III, and I.
ESP32 NodeMCU
It is a microcontroller with low power (MCU) that has integrated Wi-Fi as well as dual-mode Bluetooth. It's an upgrade of the earlier ESP8266 microcontroller. ESP32 is illustrated in Figure. 3. Arduino IDE can be employed to send the code onto the ESP32 NodeMCU. (ESP-Wroom-32 Version 1.1 was utilized at EFY Lab to test the sketch.)
TFT display
The 3.65cm (1.44-inch) touchscreen with a color display that supports SPI serial bus technology was employed in the course of the testing. It's suitable for Nokia 5110 and is available at www.aliexpress.com
SDS011. Nova's dust detector SDS011 can be described as considered to be one of the most effective particulate sensors available in regards to size, precision and cost (available at US$20 at www.aliexpress.com). It comes with an UART interface and a measurement accuracy of 0.3ug/m3. Operating voltage 5V. The SDS011 that is used in this project is shown in figure. 4.
BME280
To read temperature and pressure as well as relative humidity, an affordable BME280 module is employed. BME280 utilized in this project is illustrated in Figure. 5.
2N2219
Transistor 2N2219 (T1) can be employed as a switch in SDS011. Its collector connects to GND pin on SDS011 and its emitter is connected to ground of the circuit. If pin 15 of ESP32 is high in logic T1 is conductive and SDS011 is connected to the ground through T1. Otherwise SDS011 does not get ground connection.
ThingSpeak, an IoT-based platformThe project is built upon ThingSpeak cloud computing. ThingSpeak is an open source IoT app and API that allows you to store and retrieve data from devices by using the HTTP protocol via the Internet through LAN. It allows for the development of sensor-logging software, location tracking applications, as well as a social network of things that provides status updates. If you transmit data from your sensors to ThingSpeak on a regular basis it will generate the data, then store it and display it in a trend in real-time. It also has Maths modeling built-in as MATLAB documentation that is available for free.
Account and channel setup. Set up an account and channel at www.thingspeak.com. In order to do this, you'll need to have an active email account. The website will send you a confirmation email. Follow the link in the email to confirm your account and establish an account.
From this point you can make as numerous channels as you like. If you make a channel you will receive three ThingSpeak identities such as channel ID, API key for writing and API key to read. Take note of these in case you need these to use the program source in the future. Up to eight sensor information per channel, for example PM2.5 and PM10 temperature and altitude, relative humidity and pressure.
Eight data per channel. Each channel is able to receive eight data signals from various devices. That means that, with the ThingSpeak API, you'll be able to upload eight data for each channel. The data is then collected, recorded, and converted into trend data using ThingSpeak such as the following:
https://thingspeak.com/channels/279012
SoftwareThe software (environment_thingspeak.in) for the project is written in Arduino programming language. PM2.5 and PM10 both have an association with the relative humidity (RH).
So it is necessary to include an RH correction is added to the software (or sketch) to adjust the readings.
SDS011 on ESP32. ESP32 operates on the Arduino IDE. Because Arduino is a cutting-edge technology, there's an application library for nearly all sensors. For SDS011, there is a library that is ready-made made available, which uses the SoftwareSerial library that works straight out of the box with Arduino Uno.
ESP32 is not compatible with SoftwareSerial. It comes with three UART ports, and utilizes HardwareSerial to connect UART devices. Existing commands and libraries can be utilized in conjunction with hardware serial to obtain PM information from sensors. These commands are stored in the data.h the file. It should be saved in the same location with the Arduino sketch, and then compiled with the sketch in general.
SDS011 sleeps in the mode SDS011. According to the specifications, SDS011 can have the sleeping current that is 2mA. The sensor is in sleep mode very rarely. Additionally, sleep-related commands have been included within the data.h file to allow you to test. But, GPIO13 (pin 15) is used to turn to the NPN transistor (2N2219) to ensure that SDS011 remains running during the active stage and then switch it into power-off mode.
I'm uploading the program to the ESP32. Then everything is ready to be executed by you. Connect the devices to the PCB or Veroboard for general purpose. Attach to the USB power supply to ESP32.
Start the Arduino IDE and add the library for ESP32 and any other libraries relevant to it. Open Arduino code (environment_thingspeak.info).
Change or provide Wi-Fi ID and password at starting the sketch. Replace the ThingSpeak Channel number by your channel's number along with API keys with API key.
Choose ESP32 Deb Module by selecting the drop-down menu beneath the Tools(r)Board option. After that, choose the correct USB port in the pull-down menu beneath the Tools(r)Port option. Press Upload.
If everything has been done right, your program will begin communicating via the ESP32 board, and upload the code to ESP32 MCU.
In a matter of minutes, you'll be able to see PM2.5 or PM10 as well as other information displayed on TFT's display. Similar data will be displayed at the monitor for serial of the Arduino.
Start the ThingSpeak channel in any Internet browser. Your smartphone's browser will also work. The data is stacked perfectly as illustrated in Figure. 6.
Note
You can consult the following websites to get more details on the steps to connect ESP32 with the Arduino IDE:
Testing and construction
A layout of the PCB in actual size for the air quality monitoring system is illustrated in Figure. 7. 7 and the arrangement of its components can be seen in Fig. 8. Place different components on the PCB. Connect the power source to ESP32.
Fig. 7 Layout of the PCB of an air quality monitoring system
Fig. 8: Layout of components layout for the PCB
Download PCB and Component Layout PDFs: Click Here
Download Source Folder
If everything is in order You will observe the values on the display on the TFT of the air quality monitor. The same values will show on www.thingspeak.com as illustrated in Figure. 6.
SDS011 is powered by 5V. However, you could make use of 2 3.7V lithium-ion batteries in conjunction with an extremely small linear regulator such as 7805 for a step-down to 5V. You can also use an extremely small converter (available at www.aliexpress.com) that will boost the voltage between 1.5V to 5V. You can utilize one lithium-polymer battery and the converter, which makes it a portable device.
Somnath Bera is a fervent fan of software that is open source. Professionally, he's anexpert in thermal power. He also is a general manager for NTPC Ltd.
Comments