With this guide, you will be able to build a device to measure air quality by using a Honeywell HPMA115SO sensor, which measures PM 2.5 and PM 10 particles.
1. Sensor Honeywell HPMA115S0
2. ESP32 Mini Kit board (Bluetooth-Wifi)
3. Display OLED 64x48 pixels display module for D1 Mini ESP32
4. Battery Shield single lithium battery charging & boost for D1 Mini
5. Sensor Mollex cable assembly
6. Battery 3.7v 800mAh a 2000mAh (Maximum dimension 34x10x52 mm)
7. Slide switch
8. Pin headers (included with boards)
9. Tools and others: Pliers/tweezers, side-cutting shears, silicon or glue, soldering iron, solder, foam, 0.3mm MDF board for the box.
NOTE: The battery is one of the most difficult components to import due to restrictions in each country. In some countries there are problems to import this type of batteries sometimes, but there are local suppliers who sometimes have them. The battery used in the project has maximum dimensions of 34x10x52 millimeters, but can be smaller than that in order to fit in the box, always of the same voltage, the value in current determines the duration time of the device turned on.
Below are some important sections of the video to consider:
Only four wires of the Honeywell sensor need to be connected (2, 8, 7 and 6 pins) to four pins of the display board (VCC, GND, 16 and 17), as shown next and in the previous video.
The video shows how the switch is installed between the board and the battery. First attach the negative (black) battery cable to the board (-), then the pin of the switch half to the positive pin of the board (+) as shown in the video and the following images; make sure the switch is centered and sufficiently displaced outwards to facilitate switching on and off. Check that the positive and negative are not joined together, then fix the switch with silicone or glue and verify that it is strong enough.
Note: Do not turn on until next step.
NOTE: Board Position
Verify that all boards, display and battery charger are aligned backwards, as shown in the figure:
The device requires a software called firmware when talking about hardware, which will control the sensor, Bluetooth and other peripherals such as the screen or WiFi type radios. For the moment, to load the firmware the following steps are required:
On your PC please install PlatformIO which is responsible for compiling and uploading the firmware to the device, also it is Arduino compatible firmare, this software can be installed in a minimum version, CLI, in Windows, Mac or Linux as described in the link and will be responsible for managing the USB port of your PC to connect the device and achieve this task every time you need to update the firmware.
If installation was correct, you should have the pio command in your console or Windows PowerShell, so check it out by running:
$ pio --version
PlatformIO, version 3.6.1a5
For some libraries, it is recommended to install Git in your system, you will find a version for your PC here
Compilation and Firmware Installation
Follow the steps below from your console or PowerShell by executing the commands described below:
$ git clone https://github.com/kike-canaries/esp32-hpma115s0.git
Cloning into 'esp32-hpma115s0'... remote: Enumerating objects: 208, done. remote: Counting objects: 100% (208/208), done. remote: Compressing objects: 100% (132/132), done. remote: Total 492 (delta 105), reused 167 (delta 68), pack-reused 284 Receiving objects: 100% (492/492), 7.18 MiB | 2.71 MiB/s, done. Resolving deltas: 100% (239/239), done. Checking connectivity... done.
Enter the directory:
$ cd esp32-hpma115s0
Turn off your device from the switch, connect your sensor from the lower micro USB (ESP32 board) to a USB port on your PC and run the following command to compile and upload the firmware:
$ pio run --target upload
Configuring flash size... Auto-detected Flash size: 4MB Compressed 15088 bytes to 9755... Wrote 15088 bytes (9755 compressed) (effective 916.2 kbit/s)... Hash of data verified.... Leaving... Hard resetting via RTS pin... ================== [SUCCESS] Took 86.99 seconds ==========================
After uploading the firmware it should appear on the display:
For more detail of the compilation process, firmware upload or problems with it, check the official Github of the application. If you find problems or errors you can also report them there.
Install from GooglePlay the official application of CanAirIO. This application requires Bluetooth and localization permissions if you are going to use the sensor, but it is possible to use it without a sensor only to see reports from the citizen network. With the device turned on, launch the application and choose My Device section, press "SCAN" and connect to your device. This procedure is required to be done only once. With the red button you can record samples of air quality to be shared later.
If you wish, you can print a box for your device by laser cutting. In the attachments section you will find the template to print a single box in MDF 0.3 mm or another one for 14 boxes in a sheet of the same thickness with a similar content to this image: