Professional Documents
Culture Documents
In the last issue we described the interface board for a wideband lambda probe. This versatile board can
be used in stand-alone mode or more conveniently from the comfort of a PC or laptop using its serial
interface port. When used together with a computer the interface has access to the diagnostic features of
the CJ125 lambda probe interface chip and allows measured values and operating conditions to be stored
for analysis later on. The interface board is set-up and controlled using a simple set of commands.
Last month we took a look at the operating be changed to once per second and the data tor (8 for rich and 17 for lean mixtures) and
principle and circuit of this lambda probe can be sent in an Excel compatible ‘.csv’ for- Rshunt is the 61.9 Ω shunt resistor. Plugging
interface design [1] and its operation in mat. The data packets have the following in some typical values (Lambda: 250) and
stand-alone mode. Included in the circuit simple format, for example: Ap = 8 the pump cell current equates to:
is a TTL/RS232 interface chip giving it the
capability of communication with a PC fit- Lambda: 250 250 × 5
Ip = = 0.0025 A = 2.5mA
ted with this type of serial port. The com- Ref: 252 8 × 61.9 × 1023
munication protocol does not use any hand- Bat: 505
shake signals so only three wires are needed Status: 32 The second value in the data packet ‘Ref’ is
(TXD, RXD and GND), connecting to the CJ: 255 a correction value as already mentioned in
three pins of X1 (see Figure 1). Should your the first article, for the 5 V reference voltage
PC not have an RS232 port then a stand- In MS Excel compatible mode the same val- used by the D/A converters. The value of Ref
ard USB/RS232 adapter cable can be used, ues are output as: is derived from the equation:
allowing communication via one of your 250;252;505;32;255
PC’s spare USB ports. 1.22 × 1023
Ref =
The first line or value in each data packet 5
Data ‘Lambda’ contains the digital value pro-
Before the serial interface can be used it will duced from the 10-bit A/D conversion of the 1.22 V (±1 %) is a precise reference voltage
be necessary to set up the PC’s COM port UA voltage from the CJ125. Using this value on ADC3 (Pin 26) of the ATmega8. Any devi-
(or virtual COM port). The configuration we can determine the pump cell current to ation of Ref from its optimal value of 250
data is 115,200 baud, 8 data-bits, 1 stop- calculate the exact value of lambda: indicates that of the 5 V reference used by
bit, no parity, no handshake. the A/D converters is inaccurate.
Once communication is established the Lambda × 5
Ip =
lambda interface board sends data packets Ap × Rshunt × 1023 It’s probably no surprise that ‘Batt’ is the
containing lambda measurement informa- digital value of the supply voltage Ubatt or
tion at a rate of five per second. The rate can Ap is the pump current amplification fac- Ub. The voltage divider formed by R23/R24
32 02-2012 elektor
52429
DIAHG
of the ATmega8. If the value falls below
MOSI
MISO
SCK
UR
SS
UA
UA
440 (=10.5 V) or rises above 670 (=16.0 V)
+Ub +5V
the ATmega8 stops measurements and
X2
switches to standby mode. R23 R1 R22 L1
R21
4k7
1
UA
C22
10k
39k
R16 3 2
1k
Status and CJ are values representing the 47uH 100n
4 6
100n
C19
1
C1+
V+
VCC
16
IC6
microcontroller status register and the VCC VCC
100n
3
C1–
X1
18 30 12 13 1
CJ125 diagnostics register. The status reg- 29
AVCC
PC6(RESET)
PD0(RXD)
PD1(TXD)
31 11
R1OUT
T1IN
R1IN
T1OUT
14 2
TXD
RXD
28 32 10 7 3
ister bit definition is given in Table 1. The 27
PC5(ADC5/SCL)
PC4(ADC4/SDA)
PD2(INT0)
PD3(INT1)
1 9
T2IN
R2OUT
T2OUT
R2IN
8 C24
GND
PC0(ADC0) PD7(AIN1)
needs a clean restart. The CJ error bit indi- ATMEGA8-AI
6
C23
19 12 MOSI
cates an error in the CJ125 which is specified 22
ADC6
ADC7
PB0(ICP)
PB1(OC1A)
13 DIAHG
100n
470R
4 R9 2
IC5
10k
1k UL
14MHz74
255 i.e. all bits have the value ‘1’. C1 C4 C3 C8 C7 LED2 LED1
100n LMV321M7
elektor 02-2012 33
52429
Figure 2. The relationship between oxygen concentration and pump cell current
Internet Link
shows good linearity. [1] www.elektor.com/110363
34 02-2012 elektor