bencorrado / pmsensor

Library to read data from particulate matter sensors
MIT License
20 stars 15 forks source link

Added function to disable ABC logic at mhz19 #12

Closed IATkachenko closed 3 years ago

IATkachenko commented 5 years ago

Automatic baseline correction (ABC) drops 400ppm level to lowest value for last 24 hours, that is not good for regular usage. According to https://www.winsen-sensor.com/d/files/infrared-gas-sensor/mh-z19b-co2-ver1_0.pdf and https://revspace.nl/MHZ19 we may dsable ABC at this device by sending 0x79 command. So we may let user to decide: use ABC or not.

IATkachenko commented 3 years ago

Have no I idea why send_data used instead of ser.write. May be to avoid code repentance for ser initialization.

Any way, it is not good PR. It should be splitted: one for disable ABC and other for refactoring. I'm closing this as stale. Thank you for review and sorry for disturbance.