Is it possible to run multiple MH-Z19B CO 2 sensors via UART-USB converters?

Hi All,

Been looking all over the internet to find any information about using two UART-USB converters on a RSPI 4b.

I’m trying to run two MH-Z19B CO 2 sensor, when connected individually they work connected to tty/usb0 but when i connect the second one to another port say usb3 it doesn’t work. assuming this has something to do with the PI board itself rather than the Mycodo configuration.
Can I run more than one of these sensors, if so how do i approach this?

Thanks,

1 Like

Yes. Each will show up as a different USB device. Take care to ensure you are accessing the device you intend to access.

Thanks for the link. What would be given me this error when configuring the sensor. I now realised that i get this issue as soon as i select another usb port other than ttyUSB0.

1 Like

Does that device exist?

I’m pretty sure i figured out! I obviously got confused with the device number. I had physically added the second UART device to Port 3, and assumed this is what i needed to set it to in the input configuration. Once i change this to /dev/tty/USB1 (first UART device already setup as /ttyUSB0) it worked.
The error I made was thinking physical USB port number and UART device number needed to match.

USB devices are created sequentially in the order in which they are detected. If being plugged in while the system is running, this will be in the order you plug them in. However, if more than one are connected at boot time, they can be detected in different orders (this is explained in the part of the manual I linked to).

Thanks mate, Appreciate the help. :+1:

1 Like