Antilog converter linearizes carbon dioxide sensor
While most carbon dioxide sensors use IR technology, electrochemical sensors are a serious competitor because of their high sensitivity, wide measurement range, and low price. As a rule, electrochemical sensors connect to a microcontroller through a buffer amplifier with an extremely low bias current (<1pA). The micro is needed to linearize the logarithmic response of the sensor. A good example of this approach is the SEN-000007 module from Sandbox Electronics, which uses an MG-811 CO2 sensor from Hanwei Electronics. Reference 1 reveals the circuits and the code, but does not specify accuracy.
This Design Idea shows a pure hardware solution to the linearization problem with a simple and cheap circuit that features easy adjustment and good accuracy. The output signal can go directly to a panel meter or a microcontroller, requiring no complex data manipulation such as log or antilog calculations.
The MG-811 sensor measures CO2 concentration from 400 to 10,000 ppm (0.04% to 1%). Figure 1 displays the transfer function of the sensor. The data points come from the datasheet of the MG-811. The line and equation are generated by the curve fitting tool of Microsoft Excel.
Figure 1 The sensor has a logarithmic response with a 265mV offset.
Figure 2 presents the circuit. It uses a quad op-amp and a pair of matched transistors. IC2A and IC2B, make a conditioning circuit that provides high input resistance to the sensor, removes the 265mV offset from the sensor response, and amplifies the resulting signal. The goal is to modify the sensor response to the form VS = lnC (C is CO2 concentration) so the antilog converter (built with IC2C, IC2D, and the matched transistors, Reference 2) can implement the elnC = C identity, thus providing a linear relation between VOUT and CO2 concentration. The 2.5V reference IC1 allows the circuit to work with other gas sensors – like the TGS4161 from Figaro – that require not 6V, but a 5V power supply. Note that the sensor draws a lot of current.
Figure 2 A quad op-amp and a pair of matched transistors provide simple and cheap linearization. R7 is a standard compensating resistor, as from PRC.
The circuit needs only a full-scale adjustment (R11) for calibration. Accuracy is ±0.3% (see Figure 3), which matches well to a 3.5-digit panel meter, and is much better than the expected accuracy of this type of sensor.
Figure 3 Accuracy is enough for a 3.5-digit panel meter.
2. AN-30 Log Converters, National Semiconductor (TI)
- Log-ratio amplifier has six-decade dynamic range
- Op amp linearizes attenuator control response
- Single-cycle logarithms & antilogs