The blog of a dedicated radio amateur and electronics enthusiast

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

09 February 2023

Reading PM2.5 data from the Cubic PM1006

Continuing the topic of the last post I can now decode the PM2.5 concentration data from the PM1006 particulate matter sensor. 
I dis-assembled the air-quality monitor, ( AQM ). Inside is an electronic circuit board and the PM1006. To access the data I connected the 'REST' test-pad and 'GND' test-pad on the circuit board to the 'RX' and 'GROUND' respectively of a 'USB-UART' protocol converter dongle. The dongle connects to a pc via usb in order to display the data using a serial terminal program.
(L) USB-UART dongle, (R) AQM control board & PM1006
The PM1006 data sheet states that the serial data format is 8 data bits, 1 stop bit, no check bit and speed 9600bits/second. When I had configured a serial terminal program to match, I was able to view the data bytes. 
I have observed that the control board switches on the sensor's fan, then polls the sensor 7 times. Each time 20bytes of data are output on the 'REST' connection. This process takes about 15 seconds, after which the fan is switched off for 20 seconds before the cycle repeats.
7 x 20 bytes (columns) of data displayed in hexadecimal form
The PM1006 data sheet also states that after 3 bytes of header, ( always 16 11 OB ), there are 16 bytes of data ( data fields DF1-DF16 ) and a checksum byte at the end. DF3 and DF4 ( columns 6 & 7 counting from the left ) contain data relating to the PM2.5 concentration. The actual concentration is found first by converting the hex to decimal and then using the formula ( DF3 x 256 ) + DF4. So '00 26' gives 38ug/cubic metre and '00 25' gives 37ug/cubic metre. The front of the AQM was illuminated yellow at the time; 36-85 is medium concentration and air quality 'OK'.
I extinguished a burning match near the PM1006. DF3 and DF4 peaked at 02 & 81 corresponding to PM2.5 of 641ug/cubic metre. The front was illuminated red.
The next step will be to parse the raw data ( in the image above ) in software and fit a display module to display the actual PM2.5 concentration in a 'user-friendly' form. That's a task for a micro-controller and the topic of a future blog-post !
 
Notes: 2 hex digits = one byte, and UART = Universal Asynchronous Receiver Transmitter. 
 
  

No comments: