AN-1146 A GreenPAK Carbon Monoxide Detector

In this project, the Silego GreenPAK™ Configurable Mixed-signal IC (CMIC) is used in the design of a carbon monoxide detector. Carbon monoxide (CO) gas is odorless, colorless, and tasteless, and can lead to carbon monoxide poisoning and ultimately death, depending on the amount of exposure. CO gas is a common product of combustion, and can be produced from cigarette smoke, wood-burning stoves, faulty furnaces and heaters, and many other household sources. Since it’s easily produced and undetectable by human senses, many homes and businesses use CO detectors to sound an alarm when the gas is present above its normal concentration of 0.5 to 5 ppm (parts per million). At 35 ppm, constant exposure will lead to headaches and dizziness within 6-8 hours.

External Components

The external CO sensor used in this project is the SPEC CO sensor 100-102. This is a 15x15 mm, low power sensor that can detect CO at up to 1000 ppm, well above the danger threshold of 35 ppm.

The SPEC CO sensor produces a current that is directly proportional to the concentration of ambient CO, per the following formula:

Sensor current

Using this formula, at 35 ppm we can expect Isensor to be, on average, 166.25 nA.

To use this output with GreenPAK4, it’s necessary to convert Isensor into a voltage. This is accomplished with a conditioning circuit called a potentiostat. Figure 1 shows the schematic for the potentiostat circuit.

In Figure 1, Isensor is the output current from the Working Electrode (WE). The transimpedance amplifier of the potentiostat circuit, configured with op-amp U2, converts Isensor to Vout per the equation

Output voltage

The potentiostat schematic for the SPEC CO sensor 100-102. CE, RE, and WE stand for Counter Electrode, Reference Electrode, and Working Electrode, respectively

Figure 1. The potentiostat schematic for the SPEC CO sensor 100-102. CE, RE, and WE stand for Counter Electrode, Reference Electrode, and Working Electrode, respectively

Using a value of 1.2 MΩ for R7 (in Figure 1), we can calculate that at 35 ppm of CO, Vout will be (on average) 200 mV. This will be the reference voltage for the CO danger threshold.

For easy prototyping, both the potentiostat and LED/Alarm circuit were built on a breadboard (photo in Figure 3).

The external circuit to drive the LED and alarm. More information on these components can be found in the Appendix at the end

Figure 2. The external circuit to drive the LED and alarm. More information on these components can be found in the Appendix at the end

The external circuit to drive the LED and alarm. More information on these components can be found in the Appendix at the end

Figure 3. The potentiostat and LED/Alarm circuit prototyped on a breadboard. The protruding green wires connect to the GreenPAK Universal Development Board. For a full list of the external components used, see Appendix

GreenPAK Design

A high-level overview of the complete CO detector system is illustrated in Figure 4.

To configure the GreenPAK4, you must first download and install GreenPAK Designer. Open the GreenPAK Designer Launcher, and select the appropriate GreenPAK model. This application uses the GreenPAK4 SLG46140V.

If you’re unfamiliar with GreenPAK Designer, you can find video tutorials here.

Using GreenPAK Designer, we configure the GreenPAK4 to control the potentiostat and LED/Alarm circuits.

The potentiostat circuit measures the ambient CO levels, which linearly correspond to the output voltage (labelled Vout in Figure 4). The GreenPAK4 will be configured to compare Vout to a reference of 200 mV, and then to turn on the LED/Alarm circuit if Vout > 200 mV.

High-level block diagram of the full CO detector system

Figure 4. High-level block diagram of the full CO detector system

Create a new GreenPAK Developer file with the SLG46140V

Figure 5. Create a new GreenPAK Developer file with the SLG46140V

To configure the GreenPAK, we’ll start by using PIN 10 to read the value of Vout.

Configuration of PIN 10

Figure 6. Configuration of PIN 10

For the purposes of this application, we’re only concerned with whether or not the amount of ambient CO exceeds the threshold value of 35 ppm. To determine this, we’ll make use of one of the GreenPAK4’s two analog comparators (ACMPs). Again, since we know 35 ppm of CO results in an output voltage of 200 mV, we’ll set 200 mV as the reference value of one of the comparator inputs. We’ll configure ACMP0 as:

Configuration of PIN 10

Figure 7. Configuration of ACMP0 with the IN- source (the reference) set to 200 mV. If the IN+ source (PIN 10) exceeds 200 mV, the output will be high; otherwise, the output is low

In order to save power, we can use GreenPAK to implement on/off cycles of the potentiostat circuit. We configure PIN 4 to output the power for the potentiostat circuit:

Configuration of PIN 4

Figure 8. Configuration of PIN 4

The longer the potentiostat circuit is powered on, the more stable the output. For this application, we’ll create a cycle of 20 seconds on/20 seconds off for the potentiostat and comparator, using a combination of a counter and D Flip Flop (DFF). This will require 3 blocks: the WS Ctrl/14-bit CNT0/DLY0 block, the DFF/LATCH4 block, and the OSC block.

We’ll use a latch, DFF/LATCH5, to save the comparator output between power cycles. Finally, we’ll use PIN 11 to take the output from the latch to drive the LED/Alarm circuit.

Altogether, Figure 13 shows the internal connections of the GreenPAK4.

Configuration of 20 second counter Configuration of the DFF Configuration of the oscillator. Note the power mode has been switched to “Force power on.” Configuration of the latch used to save the comparator values Configuration of PIN 11, which drives the LED/Alarm circuit
Figure 9. Configuration of 20 second counter Figure 10. Configuration of the DFF Figure 11. Configuration of the oscillator. Note the power mode has been switched to “Force power on.” Figure 12. Configuration of the latch used to save the comparator values Figure 13. Configuration of PIN 11, which drives the LED/Alarm circuit

Example Implementation

To ensure the system works, we used a CO test kit having a small glass vial of CO and a plastic bag enclosure.

To test the system, we simply put the tube and potentiostat circuit inside the bag, seal it, and break the tube containing CO.

This should create conditions of approximately 400 ppm of CO.

By powering the potentiostat with a constant voltage of 5 V from the GreenPAK Universal Development Board, we can test the operation of the CO sensor itself.

Once the vial of CO was broken, the output of the potentiostat climbed from 0 V to a maximum value of approximately 2.89 V, then steadily decreasing from this value as more and more CO escaped the bag.

Using the formulas provided in the External Components section, we can conclude that at its highest output, the sensor detected a CO concentration of approximately 500 ppm. This is consistent with the concentration of the test kit, suggesting correct operation of the sensor. [Note: for commercial applications, the sensor may require more precise calibration.

With the sensor providing the expected output, we can turn to testing the configuration of the GreenPAK4.

The internal connections of the GreenPAK4 blocks

Figure 14. The internal connections of the GreenPAK4 blocks

Testing the system by placing the potentiostat and LED/Alarm circuit inside a plastic bag with approximately 400 ppm of CO. The green wires pass through the opening of the bag to connect to the GreenPAK Universal Development Board (not shown)

Figure 15. Testing the system by placing the potentiostat and LED/Alarm circuit inside a plastic bag with approximately 400 ppm of CO. The green wires pass through the opening of the bag to connect to the GreenPAK Universal Development Board (not shown)

This involves switching the constant 5 V power supply to the 20 second power cycle taken from PIN 4, as well as connecting the output of the potentiostat to PIN 10 and the LED/Alarm circuit to PIN 11. This involves switching the constant 5 V power supply to the 20 second power cycle taken from PIN 4, as well as connecting the output of the potentiostat to PIN 10 and the LED/Alarm circuit to PIN 11.

Figure 16 shows the GreenPAK Designer emulation window for this system.

The GreenPAK Designer emulation window used to test the CO detector system

Figure 16. The GreenPAK Designer emulation window used to test the CO detector system

Testing of the full system was successful. Outside of the plastic bag, the LED and alarm remain off. Inside the bag, with CO present, the LED lights up and the alarm sounds continuously, during both the on and off segments of the power cycle.

When the bag is opened and the CO is allowed to escape, the LED and alarm turn off as the CO concentration returns to below the threshold value.

By using an external power source, we can measure the operating current of the entire detector system. Table 1 summarizes these measurements.

State of 20 Second On/Off Power Cycle Operating Current (µA)
On 110
Off 43

 

Table 1. Operating current of the CO detector system during both phases of the power cycle

Extensions

There are multiple features one could add to this application to extend its functionality. For example, other sensors could be added to create a more versatile detector. Many commercial CO detectors also combine smoke detectors to alert occupants in case of fire.

Another possible extension is to make use of the functional relationship between the concentration of CO and output voltage of the potentiostat circuit. By routing the potentiostat output to the GreenPAK4’s analog-to-digital converter (ADC), you can determine the exact concentration of CO detected and display this information to a user. For example, you could add an external display to show the CO concentration in ppm, or send the data to a computer or smartphone.

A more qualitative effect could be achieved without the use of the ADC. Instead, one could use multiple analog comparators to light up multiple LEDs; the more LEDs lit, the higher the CO concentration.

Conclusion

In this application, we used GreenPAK4 to construct a carbon monoxide detector system. Although the design example shown was fairly basic, the GreenPAK4 can easily be used to customize a detector design for a variety of purposes. The development hardware and simple GUI interface of GreenPAK Designer allows users to quickly implement their designs.

External References

1. SPEC CO Sensor 100-102 Datasheet

2. Potentiostat Control Circuit

Appendix

Parts list:

Description Digikey Number
SPEC CO Sensor 100-102 Package 110-102 1684-1000-ND
TI LMC6041 General Purpose Op Amp LMC6041IN/NOPB-ND
Resistor (150 Ω) 150XBK-ND
Resistor (10 kΩ) 10.0KXBK-ND
Resistor (1 MΩ) 1.00MXBK-ND
Resistor (1.2 MΩ) 1.2MQBK-ND
Capacitor (1 nF) 399-4144-ND
Capacitor (10 nF) 399-4148-ND
p-type JFET 2N5460CS-ND
Red LED 67-1105-ND
Alarm 433-1080-ND

About the Author

Name: Michael Alba

Background: Michael holds a degree in Engineering Physics from the University of Alberta, where he spent time researching wireless beamforming and Doppler radar. He currently works as a freelance technical writer.

Contact: appnotes@silego.com

 

Files



See full list of Application Notes