This sketch contains the code for enabling the arduino mega to gather the air pollution data from the environment, tag the data with GPS cordinates,timestamp. Save the incoming data into the SD card attached and at the same time transfer the incoming data on real time basis to my web server i.e Node.js REST server. For the visualization of data GOOGLE Maps API is used React SPA. For visualization of data heatmap layer, Data points with Info box and circle plot was used. You can view the demo Web site at Environment Inspector. The visualized data is of Peshawar,Pakistan. This is currently the beta version. Also as hardware devices are now offline so you can't view the real time data now. Complete code of Web APP will be shared .
The code was written for arduino mega but it was also tested on arduino uno. For Arduino Uno You need to change the pins of SD-Module,GPS module,ESP8266E with respect to Arduino Uno. Sensors And Modules used are following.
- Arduino Mega
- MQ-131 (For Ozone)
- MQ-2 (Gas and Smoke)
- MQ-135 ( For CO2)
- DHT-11 (Temperature and Humidity)
- DSM- 501 A (For Dust)
- Ublox Neo 6m v2 GPS Module
- Micro SD Card Module
- ESP8266-12-E Module (For Wifi)
Their are two sketch files in this repository one contains the code for saving data on SD Card and the other one doesn't.
The formula for calculating the ppm values might require improvements
The libraries used are listed below.