MH-Z14 / MH-Z19 CO2 sensor

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
TD-er
Core team member
Posts: 8738
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MH-Z14 / MH-Z19 CO2 sensor

#51 Post by TD-er » 29 Mar 2018, 19:33

I would say 400 - 700 ppm = green
700 - 1400 = orange
1400+ = red.

Barb232
Normal user
Posts: 40
Joined: 12 Mar 2016, 16:40
Location: Earth
Contact:

Re: MH-Z14 / MH-Z19 CO2 sensor

#52 Post by Barb232 » 29 Mar 2018, 19:35

thats are my practical results, too.
Thank you

I wrote a short blog Post in my Blog, works fine.

https://blog.moneybag.de/fhem-luftquali ... asy-wemos/
Screenshot 2018-03-29 21.22.53.JPG
Screenshot 2018-03-29 21.22.53.JPG (38.1 KiB) Viewed 17416 times

Erik82
New user
Posts: 2
Joined: 16 Apr 2018, 14:12

Re: MH-Z14 / MH-Z19 CO2 sensor

#53 Post by Erik82 » 16 Apr 2018, 14:24

I recently received my MH-Z14a sensor, I want to use it to send CO2 values to my home automation system via MQTT.

When I got it, I first hooked it up to a arduino nano and the PWM example form this site: http://domoticx.com/arduino-co2-sensor-mh-z14/
It seemed to work, The red light was flashing every few seconds, and I got some plausible values.

I now want to do the same with on the ESP8266 ESP-12. When I use the same sketch, I got some odd values and the red light was not flashing. I thing the problem is that my ESP circuit is working on 3.3v, while the sensor requires 5v.
To overcome that problem, I tried using one of these as power supply for the sensor: http://www.mpja.com/images/30175-large.jpg , while keeping the 3.3v power supply for the ESP. Unfortunately the result stayed the same.

I then tried switching to UART instead of PWM, and used a simplified versiopn of this sketch to test it: https://github.com/bertrik/mhz19/blob/m ... 2meter.ino
Unfortunately, it seems that the command bool result = exchange_command(0x86, data, 3000); in that sketch always returns 0 for me.
Any idea where I'm going wrong?

TD-er
Core team member
Posts: 8738
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MH-Z14 / MH-Z19 CO2 sensor

#54 Post by TD-er » 16 Apr 2018, 23:14

Are you sure you set TX on the ESP to RX on the sensor and vice verse?
You could also try this sketch: (section with the UART implementation)
http://domoticx.com/arduino-co2-sensor-mh-z14/

Erik82
New user
Posts: 2
Joined: 16 Apr 2018, 14:12

Re: MH-Z14 / MH-Z19 CO2 sensor

#55 Post by Erik82 » 21 Apr 2018, 17:44

Thanks, it seems like that was actually the case, now that I switched the RX and TX wires, I am able to get some plausible output from the sensor.
Does anyone know by the way what type of the 7 pin connector is? it seems to be as JST connector, but not with the standard 2.54 pitch spacing.

Edit: Figured out that it's most likey a JST-SH connector with 1.0mm spacing.

I did get my MH-Z14a working with the calibration sample from s3030150. I combined it with some code to send the values with a ESP8266 over MQTT (I'm sending it to home assistant)
If anyone is interested: https://github.com/eriknl1982/esp8266_mh-z14a-mqtt

The only issue I'm now facing is that after a while (sometimes a few hours, sometimes a day) the sensor starts returning 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 as response. The only way to get back to normal values is by powering the sensor down and up again.
anyone else experiencing this?

sincze
Normal user
Posts: 43
Joined: 15 Jul 2016, 12:54

Re: MH-Z14 / MH-Z19 CO2 sensor

#56 Post by sincze » 18 Mar 2019, 20:09

Barb232 wrote: 29 Mar 2018, 09:02 Finally, it works.

i downloaded the document
http://www.winsen-sensor.com/d/files/in ... ver1_0.pdf

And i tried the method 8a (manual calibration)
I soldered a button between GND and HD and pressed the button for 7 seconds
waited 20 min with open window
Results: values 395 ppm
Lets wait and see
photo follows
using espeasy
.....

and how can i do that with a gpio LED rgb? rules

what value-ranges should i use?

/robin
You guy saved my life. It is now working.
I used a dupont cable to connect the 2 pins together for 7 seconds. :lol:
esp-co2-v2.JPG
esp-co2-v2.JPG (17.22 KiB) Viewed 14620 times

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests