A couple of my friends were interested in monitoring of quality of air in places where they live. I have decided to make for them an air quality monitoring station with optional monitoring for temperature, humidity and pressure. I have found nice project which provides firmware for devices like ESP32 or ESP8266 and allows to usage various of dust, temperature or humidity sensors. Here is github page about this project: Smogly.
I have decided to use following configuration:
- ESP8266,
- PMS7003 as dust sensors,
- BME280 as temperature, humidity and pressure sensor.
First stage was to create schematic and PCB for these devices. I used a online version of EasyEDA were I was able to quickly design PCB. Below are schematic and designed PCB:
Next step was to made of PCB. I have decided to use my 3 in 1 convertible device and made PCB with CNC. I have used FlatCAM to generate proper g-code and AutollevlerEA tool to add corrections caused by irregularity of copper surface. Due that my CNC device do not had Z-axis probe in mean time I was forced to create it. I posted here about it: Z probe for the CNC machine [part 1] Z probe for the CNC machine [part 2] . Below photos of PCB after milling process:
Next step was to solder everything together. At this stage I found that in future is better to add more spacing between solder pads. After soldering, I used PCB varnish to paint all surface and some upper electronic to achieve better protection from external environment. Below photos of soldered PCB:
Next stage was to create a enclosure. I am at stage of learning and getting familiar with 3D printing, so I decided to print an enclosure. I found here: MySensors Mini Weather Station really nice project (quite similar to Stevenson screen) which I decided to use. I used the Cura firmware to resize and slice this case. Below are final results:
Case was printed with PLA and 30% infill and resolution of 0.2. After printing I painted this case with varnish, to get better protection from external environment. Last step was to add power supply and fit the electronics inside. For supply I have used 3 m wire from USB extension cord. Here are photos from assembly:
Next step was to flash these devices with proper firmware. I have downloaded binary with firmware for my device. For flashing of devices I have used command line tool written in Python called: esptool.py. Below are commands and output from flashing:
bright@moon:~/smogly$ esptool.py --chip esp8266 erase_flash esptool.py v2.8 Found 1 serial ports Serial port /dev/ttyUSB0 Connecting.... Chip is ESP8266EX Features: WiFi Crystal is 26MHz MAC: 8c:aa:b5:59:44:c7 Uploading stub... Running stub... Stub running... Erasing flash (this may take a while)... Chip erase completed successfully in 25.9s Hard resetting via RTS pin... bright@moon:~/smogly$ esptool.py --chip esp8266 --port /dev/ttyUSB0 write_flash --flash_mode dio --flash_size detect 0x0 ESP8266_Smogomierz_2.7.9_PMS_build_3.05.2020.bin esptool.py v2.8 Serial port /dev/ttyUSB0 Connecting.... Chip is ESP8266EX Features: WiFi Crystal is 26MHz MAC: 8c:aa:b5:59:44:c7 Uploading stub... Running stub... Stub running... Configuring flash size... Auto-detected Flash size: 4MB Compressed 581120 bytes to 379917... Wrote 581120 bytes (379917 compressed) at 0x00000000 in 33.6 seconds (effective 138.5 kbit/s)... Hash of data verified. Leaving... Hard resetting via RTS pin..
Last stage was to perform 24 hour test. I have initially configured these devices:
- set proper pinouts for dust sensor,
- set proper pinouts for BMP280 sensor.
Generally this firmware after adding the devices to local Wi-Fi network allow to access them via following address: http://smogly-XXXXXX.local. There is option to configure that these devices would send data to remote services like thingspeak.com etc. Below photos from initial configuration:
It will be nice experiment to check how these sensors performs in outdoor environment. The plan is to mount it on covered balcony.
Top Comments