[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.
Seems you've been busy, as usual. 😀
I have stocked the MHZ-19B in the Tindie Store but I'm having a problem with the USB adapters I obtained. They seem to be a correct board - but they don't show up as a device and rather than getting a solid PWR indicator - an LED flashes three times.
I suspect a wrong component or counterfeit. The boards have "HW" and "hw-199" on the back. The boards I've used previously had no markings. I can drop images of the board to warn off others, I'm still working with the Ebay vendor on how to resolve that problem.
I was trying to figure out an alternative and the cheapest idea I could come up with was an 8266 module that sends via MQTT. The 3.3v serial port levels are the major problem to solve I think. Calibration would have to be implemented.
I forgot to mention - I've been thinking about the ZH03B problem and I'm wondering if I need to look at checking the CRC - the device IIRC appends a CRC that I didn't bother to check. I've been de-decaffeinating the last few weeks and that seems to be helping with thinking this over.
Yes, Mycodo has stayed my busiest project! In fact, I just released 8.6.0 less than an hour ago, which has a lot of new features and bug fixes.
That's good to hear, about getting the sensors in stock. I updated the link on the build materials list. That's unfortunate about the communication boards, though. I hope it gets resolved without too much issue.
I recall having the thought about the CRC, but haven't looked into it more than that. It would be nice to incorporate its use. De-decaffeinating has got me though quite a many problem-solving sessions myself.