It's unfortunately forest fire season again in British Columbia, and we've had a pretty terrible start with a lethal heatwave, highest ever recorded temperatures in Canada at the town of Lytton followed shortly by its destruction due to a fire.
Currently, there are hundreds of active fires around BC, and I am reminded by what happened less than a year ago, when we returned from our cross Canada moving trip, we drove right back to a pretty smoggy BC:
I decided to get two of them to compare any inter-device variation, and while it was possible to get another microcontroller to talk to it, the quickest way appeared to be via the python interface, which was able to access the sensor data with a few lines of code. Out of the box, the sensor will be always on and query every second, but apparently this is not good for the long term longevity and of course will also draw more power since the fan and diode are on all the time. So here's the overall process for an occasional poll:
- init device with serial port
- wake up the device (if asleep).
- wait 15 seconds (probably to purge the measurement chamer)
- query the sensor (returns two values, PM2.5 and PM10)
- put it back to sleep (this prolongs sensor life)
- delay for the desired sleep period (subtract warmup time above)
... rinse and repeat as needed.
From here, I was able to read the data pretty quickly (I spent more time updating macports and installing python3...)
Since I had two of them, the obvious first thing to do is see how much inter-device variation there is between the two I got. I ran the two sensors for two tests consisting of about an hour each, with 1 minute polling intervals. Data plot to come...
No comments:
Post a Comment