Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MH-Z19 (PWM) CO2 sensor support package #135

Open
mbz4 opened this issue Jul 4, 2024 · 5 comments
Open

MH-Z19 (PWM) CO2 sensor support package #135

mbz4 opened this issue Jul 4, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@mbz4
Copy link
Collaborator

mbz4 commented Jul 4, 2024

This item focuses on building a support package for the MH-Z19 CO2 sensor using PWM protocol.

Testing w/ this PWM Async library:

No results so far:
Image

Tried several wiring configs:
Image

Useful docs here:

Pin Definition
Vin Vin
GND GND
Vo Analog output (0.4~2 V) or (0~2.5V)
PWM PWM
HD HD (zero calibration, low level lasting for over 7s under low level is effective)
Rx UART (RXD) TTL Level data input
Tx UART (TXD) TTL Level data output
@mbz4 mbz4 converted this from a draft issue Jul 4, 2024
@mbz4 mbz4 added the enhancement New feature or request label Jul 4, 2024
@mbz4
Copy link
Collaborator Author

mbz4 commented Jul 4, 2024

PWM Async example working:
Image

Testing w/ exhale on-to sensor:
Image

On to preparing iotempower driver draft...

@mbz4 mbz4 moved this from Todo 📝 to In Progress 🏗️ in IoTempower Task Manager Jul 4, 2024
@ulno
Copy link
Contributor

ulno commented Jul 4, 2024

What prevents you from using the built-in pwm functionality of IoTempower? This would then allow to run on all esp32 and esp8266 platforms?

@mbz4
Copy link
Collaborator Author

mbz4 commented Jul 4, 2024

What prevents you from using the built-in pwm functionality of IoTempower? This would then allow to run on all esp32 and esp8266 platforms?

not sure mhz19 supports writing over pwm
docs show this PWM output definition for ppm measurements:
Image

will test w/ native iotemp pwm library first, setup.cpp:
pwm(CO2, D2, 2000); ... again, doubt it supports writing over pwm unless undocumented

@ulno
Copy link
Contributor

ulno commented Jul 4, 2024 via email

@mbz4
Copy link
Collaborator Author

mbz4 commented Jul 4, 2024

@ulno pwm(CO2, D2, 2000); gave this:

Image

ah it is for reading pwm - not writing Reading might be impossible until the buffered async reader works - so you might need to help me fix that one first. But all depends on timing. So the serial communication port is just bogus and useless?

ok

i figured i'd try w/ PWM since serial also unsupported
guess one thing at a time, will push back to Todo/Backlog

Do you have an open issue already for async pwm reader?

@mbz4 mbz4 moved this from In Progress 🏗️ to Todo 📝 in IoTempower Task Manager Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo 📝
Development

No branches or pull requests

2 participants