Issue with MH-Z19 sensor !!

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
vincen
Normal user
Posts: 92
Joined: 26 Jun 2017, 07:15

Issue with MH-Z19 sensor !!

#1 Post by vincen » 20 Aug 2017, 15:30

Hi,

Trying to use the MH-Z19 sensor on my ESP unit but encounters a problem. I have updated my ESP to ESP 2.0 dev 11 so to get MH-Z19 implemented in it.
I declare it this way:
Image
and list of all devices in my system (first one is disconnected right now so normal it has no value !):
Image
If I wire it same way as wiki I get these errors in log of ESP:
19535 : MHZ19: Read error : CRC = 81 / 33 bytes read => 255/255/255/255/255/255/40/140/33/
19538 : MHZ19: Shifted 2 bytes to attempt to fix buffer alignment
and if I reverse TX/RX lines from MHZ to ESP, I got that:
383777 : MHZ19: Error, timeout while trying to read
383778 : MHZ19: Unknown response: 0 0 0 0 0 0 0 0 0
so it looks like wiring of Wiki is correct (which makes sense) but what are these CRC errors ??

Vincèn

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: Issue with MH-Z19 sensor !!

#2 Post by LisaM » 20 Aug 2017, 20:25

Pics of the wiring?

LouiS22
New user
Posts: 2
Joined: 20 Aug 2017, 20:57

Re: Issue with MH-Z19 sensor !!

#3 Post by LouiS22 » 20 Aug 2017, 21:03

I have the exact same problem :( Briefly I was able to make it work but all of a sudden it's just not working anymore. I'm on dev11 as well.

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: Issue with MH-Z19 sensor !!

#4 Post by LisaM » 20 Aug 2017, 23:30

Code: Select all

718891021 : MHZ19: PPM value: 612 Temp/S/U values: 20/64/10360.00
718891022 : EVENT: MH-Z19#PPM=612.00
718891103 : EVENT: MH-Z19#Temperature=20.00
718891183 : EVENT: MH-Z19#U=10360.00
Working reliable for some time now...

vincen
Normal user
Posts: 92
Joined: 26 Jun 2017, 07:15

Re: Issue with MH-Z19 sensor !!

#5 Post by vincen » 21 Aug 2017, 07:50

LisaM wrote: 20 Aug 2017, 20:25 Pics of the wiring?
Well I followed indication of Wiki:
3.3V from ESP -> Vin MH-Z19
GND -> GND
2 GPIO declared to RX and TX or reverse

Crossed and uncrossed TX/RX but not really much more luck out of error log different but not working !

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Issue with MH-Z19 sensor !!

#6 Post by grovkillen » 21 Aug 2017, 08:29

And you are sure the sensor is not broken?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

vincen
Normal user
Posts: 92
Joined: 26 Jun 2017, 07:15

Re: Issue with MH-Z19 sensor !!

#7 Post by vincen » 21 Aug 2017, 08:33

grovkillen wrote: 21 Aug 2017, 08:29 And you are sure the sensor is not broken?
it's brand new but I have only one so difficult to know if it's working or broken :(

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Issue with MH-Z19 sensor !!

#8 Post by grovkillen » 21 Aug 2017, 08:42

As it seems that you have wired it correctly and also the settings seems fine I'd like to try another sensor instead of starting to turn more stones.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: Issue with MH-Z19 sensor !!

#9 Post by LisaM » 21 Aug 2017, 09:42

vincen wrote: 21 Aug 2017, 07:50
LisaM wrote: 20 Aug 2017, 20:25 Pics of the wiring?
Well I followed indication of Wiki:
3.3V from ESP -> Vin MH-Z19
GND -> GND
2 GPIO declared to RX and TX or reverse

Crossed and uncrossed TX/RX but not really much more luck out of error log different but not working !
How long are the wires?
CRC errors might point to a wiring problem.
Where is the 3.3v coming from?

vincen
Normal user
Posts: 92
Joined: 26 Jun 2017, 07:15

Re: Issue with MH-Z19 sensor !!

#10 Post by vincen » 29 Aug 2017, 11:48

LisaM wrote: 21 Aug 2017, 09:42How long are the wires?
15cm approximatively ;)
LisaM wrote: 21 Aug 2017, 09:42CRC errors might point to a wiring problem.
Where is the 3.3v coming from?
3.3V is coming from the ESP board and I used it previously to power some pressure and temperature sensor without problems !

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: Issue with MH-Z19 sensor !!

#11 Post by LisaM » 29 Aug 2017, 20:36

vincen wrote: 29 Aug 2017, 11:48 3.3V is coming from the ESP board and I used it previously to power some pressure and temperature sensor without problems !
MH-Z19 sensor technical parameters:
Working voltage 4.5 V ~ 5.5V DC
Average current < 85 mA
Interface level 3.3 V

I have mine connected to 5V, yours is starving...
:ugeek:

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Issue with MH-Z19 sensor !!

#12 Post by grovkillen » 29 Aug 2017, 22:18

The wiki started (wrongfully) 3.3V, I have now fixed it (5V).

The logics are 3.3V based though, no level converter is needed.

Thanks Lisa!
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

vincen
Normal user
Posts: 92
Joined: 26 Jun 2017, 07:15

Re: Issue with MH-Z19 sensor !!

#13 Post by vincen » 29 Aug 2017, 23:47

grovkillen wrote: 29 Aug 2017, 22:18The logics are 3.3V based though, no level converter is needed.
Just to be sure it means I still need really 5V to power correctly the sensor right ? ;)

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Issue with MH-Z19 sensor !!

#14 Post by grovkillen » 30 Aug 2017, 05:57

Yes, communication is 3.3V based.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 28 guests