RobTillaart / MTP40F

Arduino library for MTP40F CO2 sensor.
MIT License
4 stars 1 forks source link

discuss initial release #2

Closed RobTillaart closed 1 year ago

RobTillaart commented 1 year ago

TODO readme .md

M66B commented 1 year ago

I tried something similar with a Wemos D1 mini version 4, but there was never a response from the sensor. Maybe the signal voltage levels are different?

RobTillaart commented 1 year ago

I tried something similar with a Wemos D1 mini version 4, but there was never a response from the sensor. Maybe the signal voltage levels are different?

I do not have a Wemos to confirm, but the sensor definitely needs +5V to power up. You might add 10K pull ups on the TX and RX line.

RobTillaart commented 1 year ago

test with ESP32 - hardware Serial1 - works. This is a 3V3 device.

5000    2
10000   2
15000   977
20000   1272
25000   1375
30000   1384
35000   1379
40000   1371
45000   1340
50000   1336

TIME    CO2 LEVEL
55000   1328
60000   1321
65000   990

Do you have a link to a pin map of the Wemos used?

M66B commented 1 year ago

If you are looking for pin number mapping Wemos/Arduino:

https://chewett.co.uk/blog/1066/pin-numbering-for-wemos-d1-mini-esp8266/

I've tried two pairs of pins with software serial.

RobTillaart commented 1 year ago

What I often have with serial is that I need to swap TX and RX. Swapped maybe 25 times before I got first light with this sensor :)

image

you could use pin 7 and 8 as hardware serial2 if I read this diagram correctly.

RobTillaart commented 1 year ago

@M66B updated the library to 0.1.1 Most important is a bugfix when the status bit indicate invalid data . Not seen in real life yet but should be handled correctly.

M66B commented 1 year ago

@RobTillaart I've received an MH-Z19B yesterday, which I will be using. Let's see if that works with a Wemos D1 mini.

M66B commented 1 year ago

I had the same problem with the MZ-19B, but I've resolved it. Not all I/O pins are equal:

https://github.com/Erriez/ErriezMHZ19B#pins

Using pin D5 and D6 works!

I'll later test with the MTP40F too, and let you know the results.

M66B commented 1 year ago

It works with the MTP40F too! I'll test a bit more tomorrow, but reading the gas concentration is okay.

RobTillaart commented 1 year ago

Si just a different set op pins solved it. Learned something (again) today

RobTillaart commented 1 year ago

@M66B Found this issue still open after 3 weeks silence. The 0.1.1 version solved most important problems. So I will close this one.

If there are other things that need to be solved in the library, please create a new issue.