Closed EfraimManurung closed 5 months ago
Hi Efraim,
There is a track record of operation with MH-Z19C. The MH-Z19 sensor module requires a few minutes preheat time. In case not preheated, you may get the value after preheated.
Thank you for your response Mr. Takeyuki. I tried again after pre-heating for more than 10 minutes, it is working using ESP32/Arduino Uno but it's not working for the Raspberry Pi. I already followed all your procedures Mr. Takeyuki. Are there other things that I can do?
and what do you mean by a track record of operation with MH-Z19C?
Ah, I mean I don't use this with type C, someone reported that this library worked well with type C.
The return value {}
without any error message means that the serial interface is connected normally. This library sent command to the sensor normally, and no response returned.
By the way, I don't know about the setting of UART freq = 250
. How does this work?
Also, this library use the Primary UART (/dev/serial0) as default. If you are using Secondary UART(/dev/serial1) also called Mini UART, please try again with --serial_device SERIAL_DEVICE option.
I already tried it using a different serial Dr. Takeyuki, do you have other solutions?
Oh so do you mean this library only intended for MH-Z19B not for series C?
Hi Efraim,
I don't mean it. I heard a lot of reports that this runs with type C. Indeed, the serial command and response to calibrate CO2 are NOT different between type B and C. Simply this is your problem it's not working with your environment.
What happens if you run it with /dev/serial1
? Not with serial10.
Dear Dr. Takeyuki, thank you for your response
I believe it is working with serial0 because serial1 I cannot access it. Do you have another suggestion? I also reinstall the OS of Raspberry Pi 5 but still not working.
Dear Dr. Takeyuki, I solved it! finally, after I tried using Arduino Uno, I realised there is a different address for Raspberry Pi 5 and you're right. I searched different addresses and matched with /dev/tty/AMA0
Thank you so much for your time! I hope this thread will be helpful for someone too.
Efraim.
dear Dr. Takeyuki,
I have last question, for "sudo python3 -m mh_z19 --all --serial_device /dev/tty AMA0"
how do I set up the program? is there a parameter for it to setup the serial_dev?
the program like in the example "import mh_z19
mh_z19.read_all()"
I'm so glad to hear that your problem was resolved. I appreciate your patient cooperation in investigating and fixing this issue.
Also, thank you for your reporting that there is No documentation
to change serial device. I've added it as set_serialdevice(device).
You can use this library in your program as follows:
import mh_z19
mh_z19.set_serialdevice("/dev/ttyAMA0")
mh_z19.read_all()
Dear dr. Takeyuki, it works! thank you very much for your help. I can continue working on my thesis project.
I hope your thesis project is going well. I would be pleased to see your great thesis once it is completed.
Hallo Mr. Takeyuki and everyone,
I still have a problem with my MH-Z19C sensor, it is still always treturn {}, can someone help me? is it compatible for the MH-Z19C or only for B? I already read many blogs and github and I cannot solve my problem
I did my work on Raspberry Pi 5, and I also tried it on my 3+ but still not working. I already tried the pull-up resistor both for RX or TX pins.
Thank you so much.