[Solved] ZH-03B particle sensor sample anomalies - spikes in sample data
I've run a few of these sensors in Mycodo and I've noticed spikes in the graphs. These are indoor and I have a HEPA filter running constantly. When I have run the sensor under conditions of moderate pollution ( the mountains nearby are on fire ) I haven't noticed this as much - however under light conditions I see this problem more often.
I'm going to see if I can add some software detection/removal of these anomalies, since they can cause all sorts of issues with conditionals/triggers that rely on the measurement data to perform actions.
Thanks Kyle! That was my concern as well - I had wondered why those folks that designed the PurpleAir gizmo used 2 of these. At first I thought it may be a sensor failure consideration but it could be due to these random spikes. The sensor is otherwise pretty good when there is something to sense. The housing solution they came up with is a pretty good idea and easy to replicate.
I just updated the winsen_zh03b.py input module (available in the next release) with a new option to specify the number of measurements to acquire. If any measurements are above 1000, they are discarded. If more than 1 measurement (for each particle size) remain after measuring and discarding, the stored value will be an average of the remaining measurements. I also added a 100 ms sleep between measurements that has improved reliability of multiple successive measurements. I set the default to 3 measurements and it seems to be working great so far. 2 measurements would likely work well but I wanted to ensure the highest likelihood of success without too many excessive measurements.