Concerned that my aging furnace may soon begin to leak unhealthy levels of Carbon Monoxide gas, I began looking into available sensitive low -level Carbon Monoxide detectors. I found the Winsen ZE07_CO Electrochemical CO Module to be exactly what I was looking for. It provides a UART I/O interface that yields Carbon Monoxide(CO) concentration levels ranging from 0.5 ppm to 500 ppm with a resolution of 0.1 ppm. It also provides an analog DAC output ranging from 0.4 to 2.0 Volts linearly proportional to CO concentration levels ranging from 0 to 500ppm. However, to make use of this analog output with the same resolution would require the addition of a high resolution ADC with a precision voltage reference. Considering that this module's onboard electronics already provides this hardware it makes little sense to duplicate it if a serial port is available. I think the DAC output is most suited for applications that may simply employ an analog comparator chip to trigger an alarm at a threshold level, and/or possibly a Voltmeter scaled in ppm.
Since I could not find a working Arduino library that would make it easy to use the UART I/O I set out to develop the necessary code, and in that effort I also created my first Arduino library.
UART I/O operation is well documented as "User Manual Version:1.7 Valid from 10/19/2020", available at
https://www.winsen-sensor.com/sensors/co-sensor/ze07-co.htm
There are two modes of UART communication. A default mode that runs on a new device that has not previously been reconfigured is called "initiative upload". In this mode UART data is automatically transmitted periodically at one second intervals. I will refer to this as Mode 1. The second UART communication mode is called "question and answer (Q&A)" which I will refer to as Mode 2. In this mode a request for data must be received by the device before data is transmitted. Additional commands must be sent to set the mode to be used. All UART communication takes place using unique nine byte data blocks.
My Arduino library now provides the code required to read CO concentration levels from this device via. a software serial port and two or three simple function calls. Included examples ZE7_UART_Mode1, and ZE7_UART_Mode2 demonstrate the use of both modes.
These examples were setup to run on a NodeMcu development board. Since all pin numbers are defined it should not be difficult to modify them to run on most any Arduino compatible board. Install this Arduino library in "libraries" and give the examples a try.
Be advised that the pin spacing on this device makes it impossible to plug it into a standard breadboard with 0.1 inch (2.54mm) spacing. An adaptor PCB that remedies this problem is available at https://www.tindie.com/products/ga_mecatronics/pcb-breakout-boards-for-winsen-ze07-co-modules. Close pin spacing does require good soldering skill, and a good soldering iron or soldering station to make use of this breakout board.
Comments