The blog of a dedicated radio amateur and electronics enthusiast

"Having fun on the air and in the workshop - communicating and creating"

12 February 2023

Displaying PM2.5 data from the PM1006 sensor

After I had received the raw data, ( see 9 February ), I then wanted to connect a display module to show the PM2.5 particulate matter concentration value, which would also be a very useful addition to the domestic air quality monitor.
The setup in use while I was developing the software is shown in the image below. The setup comprises an ESP32 microcontroller development board, 128x64 pixel blue OLED display, control board and PM1006. The serial data connection to a hardware UART peripheral on the ESP32 required a resistive level shifter because the PM1006 outputs 5 volt logic high level, whereas the ESP32 UART input is for 3.3 volt and is not 5 volt tolerant. 
PM2.5=47ug/m3, (top-left) note the resistive level shifter
Each time the PM1006 is polled the software filters those bytes received by the UART that I had previously identified as containing the PM2.5 information, does the conversion to ug/cubic metre and sends the result to the display module. The software also selects the header and checksum bytes and uses them to detect any data errors to prevent corrupted data being displayed.
Now it is time to think about re-assembling the air-quality monitor. I'll need to choose a smaller micro-controller board and a different OLED display module to fit in the available space. I'd also like to fit additional sensors for measuring air temperature, relative humidity, TVOC and CO2.
  

No comments: