This project uses two esp32 with LoRa for measuring and analyzing air quality data with PMS5003 and MiCS-6814 sensors. It stores its data in an SQLite3 database in an SD Card.
This project works as this diagram shows:
-
You'll need to buy all of the following components:
- Heltec Cubecell GPS-6502 (Esp32, LoRa and GPS)
- MiCS-6814 (NO2, CO and NH3 sensor)
- PMS5003 (PM2.5 and PM10 sensor)
- DHT11 (Temperature and humidity sensor)
- Lilygo t3_v1.6.1 (Esp32, LoRa and Sd)
- SD 2GB SanDisk
⚠️ As this project has been made specifically for this hardware, it may not work for even very similar devices! -
When you have the components bought, you will have to build the circuit as follows:
-
Once you've built the circuits, you'll have to load the sensor code to the sensor using Arduino IDE 2.1.0 and the following libraries:
- Time at version 1.6.1
- DHT sensor library at version 1.4.4
- PMS Library at version 1.1.0
- Adafruit Unified Sensor at version 1.1.9
You will have to install Heltec Cubecell Series Arduino Development Environment and upload your code selecting the board Cubecell-GPS (HTCC-AB02S)
You will also have to load the server code to the server using the same version of Arduino IDE and the following libraries:
- ESP8266 and ESP32 OLED driver for SSD1306 displays at version 4.4.0
- LoRa at version 0.8.0
- AsyncTCP at version 1.1.4
- ESP Async WebServer at version 1.2.3
- Time at version 1.6.1
- Sqlite3Esp32 at version 2.3
- ArduinoJson at version 6.21.2
You will have to install the Arduino core for the ESP32, ESP32-S2, ESP32-S3 and ESP32-C3 and upload your code selecting the board ESP32 Dev Module.
If your code doesn't compile because of errors try reading this Arduino Forum post.
⚠️ Make sure you have installed the SiLabs drivers on your machine! -
To get the server to work you will have to upload the contents of the web folder to your SD Card and create a .config file in it with the following schema:
{ "ssid" : "YOUR_WIFI_SSID", "password" : "YOUR_WIFI_PASSWORD" }
-
Last, you will have to connect the SD to the server and connect both server and sensor to the electric current: In this project I've used a powerbank for the sensor, but batteries can be used.
-
Once you have it working, you have to get a device connected to the same network as the server and search for the IP that the server displays in the browser. Example:
You can also use this repo to analyze the same data offline
- Connect it to the cloud
- Connect it to The Things Network
- Use AI to analyze data