Page 1 of 1

MHZ19B Unknown response

Posted: 10 May 2019, 19:43
by nldanny
Hi,

I receive error below (ESPEASY log file).
I have tried several things on different forum, but nothing works. Does someone has an idea?

153789: MHZ19: Unknown response: 0 0 0 0 0 0 0 0 0
153790: MHZ19: Init OK

MHZ19b blinks now and then red.

Wire scheme:
Wemos D1 mini - MHZ19B
5V - Vin
G - GND
D7 - TX
D5 - RX

ESP Easy settings:
2019-05-10 19_40_41-Window.png
2019-05-10 19_40_41-Window.png (30.97 KiB) Viewed 9577 times
2019-05-10 19_41_56-Window.png
2019-05-10 19_41_56-Window.png (18.63 KiB) Viewed 9577 times
>> Tried also Output High
2019-05-10 19_42_45-Window.png
2019-05-10 19_42_45-Window.png (15.37 KiB) Viewed 9576 times
Hope someone can help

Re: MHZ19B Unknown response

Posted: 10 May 2019, 20:03
by grovkillen
Have you turned off the serial logging in the advanced settings?

Re: MHZ19B Unknown response

Posted: 10 May 2019, 20:04
by grovkillen
Sorry, you're using software serial. You should consider hardware serial.

Re: MHZ19B Unknown response

Posted: 10 May 2019, 20:05
by nldanny
Hi Grovkillen,

I am quiet new with this type of sensors.
This is my first try from ali to do something selfmade.

Can you explain something on how to do this with hardware serial?

Re: MHZ19B Unknown response

Posted: 10 May 2019, 20:10
by grovkillen
You use the pins for those. And set it up to use hardware serial (in the task settings).

Re: MHZ19B Unknown response

Posted: 11 May 2019, 07:38
by nldanny
Okay, but then i see different GPIO's.

Do i need to connect to D7 and D8 for example:
2019-05-11 07_37_34-Window.png
2019-05-11 07_37_34-Window.png (6.94 KiB) Viewed 9551 times

Re: MHZ19B Unknown response

Posted: 11 May 2019, 09:40
by grovkillen
Yes those are the hardware GPIO pins.

Re: MHZ19B Unknown response

Posted: 11 May 2019, 21:51
by TD-er
Software serial should work just fine for the MH-Z19 sensor.
Also double check to see if you have the Rx and Tx connected the right way.
So in your case, TX of the sensor to GPIO-13 (D7) and RX of the sensor to GPIO-14 (D5)

Also you do not have to set the Pin Mode in the GPIO boot states. Just leave them at default.
You have now set the pin mode for GPIO-14 as input, but in the sensor config you have it set to be connected to the RX of the sensor.
But you're sending from ESP to the RX, so the pin is output then.

Re: MHZ19B Unknown response

Posted: 17 May 2019, 18:44
by nldanny
I have checked all connections, this didn't work, made also the changes as recommended, no result.
Hardware serial was also not the solution

I am afraid the sensor is broken.

Re: MHZ19B Unknown response

Posted: 01 Oct 2019, 19:55
by danielhainich
hi, i have the same problem.
i tried all settings found here (hard and softserial, different pins...) and i only got the following message in log:


MHZ19: Unknown response: 0 0 0 0 0 0 0 0 0
MHZ19: Init OK

does anyone has an idea whats wrong, or is the mhz19b DOA?

thanks
daniel

Re: MHZ19B Unknown response

Posted: 01 Oct 2019, 21:16
by TD-er
Has the sensor ever worked?
The bug that was the initial cause of this topic has been resolved a long time ago.

Also make sure you have not swapped RX and TX.
You may also test to swap them in the configuration.

Do you see the red light in the sensor glow every X seconds?
Make sure your power supply is strong enough, although I think you will see reboots if it isn't.
Is the sensor connected to 5V?

Re: MHZ19B Unknown response

Posted: 02 Oct 2019, 07:49
by danielhainich
TD-er wrote: 01 Oct 2019, 21:16 Has the sensor ever worked?
The bug that was the initial cause of this topic has been resolved a long time ago.

Also make sure you have not swapped RX and TX.
You may also test to swap them in the configuration.

Do you see the red light in the sensor glow every X seconds?
Make sure your power supply is strong enough, although I think you will see reboots if it isn't.
Is the sensor connected to 5V?
i have swapped tx and rx but i doesnt matter. output is still the same.
i can see the red led light. sensor is connected to VU of nodemcu. nodemcu is powered with usb.

any other ideas?

Re: MHZ19B Unknown response

Posted: 02 Oct 2019, 22:43
by TD-er
Has the sensor ever worked?
You could test with an old version of ESPEasy, like one of end 2017 or first weeks of 2018.
Just to be sure it isn't something related to a recent change or something related to software serial.
The builds from around that time were even using an older version of software serial.

Re: MHZ19B Unknown response

Posted: 03 Oct 2019, 09:48
by danielhainich
TD-er wrote: 02 Oct 2019, 22:43 Has the sensor ever worked?
You could test with an old version of ESPEasy, like one of end 2017 or first weeks of 2018.
Just to be sure it isn't something related to a recent change or something related to software serial.
The builds from around that time were even using an older version of software serial.
the sensor is brand new and i want to get it working first time.
i flashed nodemcu to first release of 2018 (02012018) and its the same.

356460 : MHZ19: Error, timeout while trying to read
356460 : MHZ19: Unknown response: 0 0 0 0 0 0 0 0 0

red light is flashing, but no data. i tried several pins, changed tx and rx. it seems sensor is death.

Re: MHZ19B Unknown response

Posted: 03 Oct 2019, 10:27
by TD-er
danielhainich wrote: 03 Oct 2019, 09:48 [...]

red light is flashing, but no data. i tried several pins, changed tx and rx. it seems sensor is death.
Yep, so it seems.

Re: MHZ19B Unknown response

Posted: 12 Oct 2019, 19:07
by danielhainich
i got new sensor. this is working without problem. so first sensor is broken.
TD-er wrote: 03 Oct 2019, 10:27 Yep, so it seems.

Re: MHZ19B Unknown response

Posted: 13 Oct 2019, 20:33
by TD-er
Thanks for the update.