zenria / mh-z19-rs Goto Github PK
View Code? Open in Web Editor NEWWinsen Infrared CO2 Module MH-Z19 serial "api" implementation in Rust.
License: Apache License 2.0
Winsen Infrared CO2 Module MH-Z19 serial "api" implementation in Rust.
License: Apache License 2.0
This library converts a u16 to bytes as follows:
(value & 0xff00 >> 8) as u8,
(value & 0xff) as u8,
However, because of operator precedence, this is actually just (value & 0xff) as u8
twice. Attempting to set detection range to 2000 (0x07D0) instead creates the number 53456 (0xD0D0).
And in set_detection_range this library tries to set the range by writing bytes 3 and 4, but the actual bytes are 6 and 7.
(Supposedly MH-Z19B actually respects bytes 4,5,6,7 as range, in which case trying to set detection range to 0-2000 is actually setting it to 0-3489660928.)
According to datasheet, another sensor from Zhengzhou Winsen Electronics Technology, MH-Z14 has the same protocol as MH-Z19. At least I can't find any differences.
I tried this crate with MH-Z14 and it reads gas concentration successfully. This is my example repo.
I didn't yet checked if Zhengzhou Winsen Electronics Technology has any other sensors with the same protocol. This is webpage that lists CO2 sensors manufactured by this company.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.