Interfacing with TWO k30 CO2 sensors

Hi James,

I don't understand why the original code (with pin numbers corrected) didn't work, assuming both sensors were set to the default address. But I understand that you want to use the same Tx and Rx pins for both of them, to reduce the pin count. Sharing the Tx pins should be no problem, however sharing the Rx pins will only work if they have been designed to work with wire-and or wire-or and you add an appropriate pullup or pulldown resistor. Otherwise, you will need to add an external hardware gate (possibly just 2 diodes and a resistor). The K30 datasheet says that the hardware spec is in document "“ModBus on CO2 Engine K30", but I was unable to find that document.

I believe that in line 67, you should replace "readCO2" by "packet".