This project contains the software for a DIY air quality monitor based on the Panasonic SN-GCJA5 air quality sensor. This software is designed to run on a TinyPICO ESP32 development board and be built by PlatformIO in Visual Code Studio.
To use this code, first edit include/Configuration.h
as needed, then build and upload to the TinyPICO. The Panasonic SN-GCJA5 is connected to the TinyPICO via it's serial connection at pin 33.
Currently this project very much a work in progress.
To build this project, you will need the folloing components:
- Panasonic SN-GCJA5 Sensor - This is the particulate counter that the project is centered around.
- GHR-05V-S Cable Housing - You need to make a cable to connect the SN-GCJA5. This is the connector housing fo rthe end of the cable that connects to the sensor. You are free to determine how you connect the other end of the cable to the microntroller.
- Pre-crimped Jumper Wire - These are pre-made cables that have the special connector for the SN-GCJA5 crimped onto both ends. You only need the connector on one end, and that end gets inserted into the cable housing from the previous line. At a minimum you need three of these, for the +5V, GND, and TX connection on the sensor. If you wish to make a cable that also enables the I2C connection to the sensor (even though this project does not use it), get 5 to fully pupulate the cable housing. See the SN-GCJA5 Product Specification for information on placement of each cable with respect to the connector n the sensor.
- ESP32 Microcontroller Board - This code is written to support various ESP32 microntorller development boards:
- TinyPICO ESP32 Microcontroller Board - The TinyPICO is very versatile, has a good WiFi antenna, has PSRAM already installed (which this project uses), and the form factor can't be beat. The TinyPICO is the preferred ESP32 board for this project.
- EzSBC ESP32 Development Board - Another fine ESP32 development board. However, this EzSBC board does not come with PSRAM installed, which limits the historical data that can be retained by the microcontroller.
- Dupont Cable Housing - My prefered way of connectng the sensor to the TinyPICO is to use female dupont connectors to the pins that get soldered to the TinyPICO. Here are the housings to make those connectors on the other end of the cable you need to build to connect the SN-GCJA5.
- Female Pin Dupont Connector - My prefered way of connectng the sensor to the TinyPICO is to use femal dupont connectors to the pins that get soldered to the TinyPICO. Here are the female connectors needed to make the connectors.
- OPTIONAL BME680 Environment Sensor Board - You can optionally attach a BME680 sensor to this project to additionally get temperature, pressure, and humidity measurements along with the air quality measurement that the SN-GCJA5 provides. Note that you will need some 26 to 30 AWG hook up wire to construct the cables needed to connect the BME680 to to the TinyPICO, but you can use on either end of those cables the dupont connectors that you are ordering SN-GCJA5.
ESP32 Pin | Sesnor Pin | Description |
---|---|---|
5V |
5 | The Panasonic SN-GCJA5 uses 5V power. On most ESP32 boards this is marked as either 5V or Vusb . |
GND |
4 | Ground |
IO33 |
1 | The Panasonic SN-GCJA5 serial TX line (so RX on the ESP32). Note that this serial line operates at 3.3V, so it is voltage safe for the ESP32 |
ESP32 Pin | Sesnor Pin | Description |
---|---|---|
3v3 |
Vcc |
The BME680 runs off of 3.3V. |
GND |
GND |
Ground |
IO22 |
SCL |
The I2C clock line |
IO21 |
SDA |
The I2C data line |
This code has the option to push all of the granular and detailed data collected from the connected sensors to a data collection service in a JSON format for later analysis. This is done by editing the TELEMETRY_URL
macro in the include/Configuration.h
header file. A recommended data collection service is the Simple JSON Collector Service.
The following features are planned. Listed in no particular order.
Allow different rates for data collection from sensor and data posting to telemetry service. Note that the data collection rate must be greater than or equal to the telemetry posting rate.Give options for look-back window of average AQI in the web UI- Add cookie to remember user's last selected averaging window.
Add support for the BME680 sensor, which would give gas, pressure, temperature & humidity readings.- Make the units used for the display of the temperature (celsius or fahrenheit) configurable
- Add support for an ePaper display that does the following:
- Display the average AQI (configurable look back window)
- Display a warning based on the color code of the AQI
- Display the BME 680 sensor data, if attached.
- Display the web UI URL
- Create a web UI to set up and configure the monitor, replacing the
Configuration.h
file. Would depend on ePaper display to display the temporary WiFi AP the user needs to connect to to configure. - Add ability to download history as a CSV from web UI.