Silicon ChipWideband Oxygen Sensor Controller Mk.2, Pt.2 - July 2012 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Australia has missed out on the Square Kilometre Array
  4. Feature: Peter Olsen & His Flashing School Lights by Ross Tester
  5. Feature: The Square Kilometre Array: Australia Misses Out by Geoff Graham
  6. Project: Soft Starter For Power Tools by Nicholas Vinen
  7. Project: Wideband Oxygen Sensor Controller Mk.2, Pt.2 by John Clarke
  8. Project: 10A DCC Booster For Model Railways by Jeff Monegal
  9. Feature: Modifying CD-ROM Motors For High Power Operation by Dave Thompson
  10. Project: 6-Decade Capacitance Substitution Box by Nicholas Vinen
  11. Vintage Radio: The AWA 157P 7-transistor portable radio by Rodney Champness
  12. PartShop
  13. Order Form
  14. Advertising Index
  15. Outer Back Cover

This is only a preview of the July 2012 issue of Silicon Chip.

You can view 27 of the 104 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Items relevant to "Soft Starter For Power Tools":
  • Soft Starter For Power Tools PCB [10107121] (AUD $7.50)
  • SL32 10015 NTC thermistor (Component, AUD $7.00)
  • Soft Starter For Power Tools PCB pattern (PDF download) [10107121] (Free)
  • Soft Starter for Power Tools panel artwork (PDF download) (Free)
Items relevant to "Wideband Oxygen Sensor Controller Mk.2, Pt.2":
  • Wideband Oxygen Controller Mk.2 Display PCB [05106122] (AUD $7.50)
  • Wideband Oxygen Controller Mk.2 PCB [05106121] (AUD $15.00)
  • PIC16F1507-I/P programmed for the Wideband Oxygen Sensor Controller Mk2 [0510612A.HEX] (Programmed Microcontroller, AUD $10.00)
  • PIC16F88-E/P programmed for the Wideband Oxygen Sensor Controller Mk2 Display [0510612B.HEX] (Programmed Microcontroller, AUD $15.00)
  • Firmware (ASM and HEX) files for the Wideband Oxygen Sensor Controller Mk2 [0510612A/B] (Software, Free)
  • Wideband Oxygen Controller Mk.2 Display PCB pattern (PDF download) [05106122] (Free)
  • Wideband Oxygen Controller Mk.2 PCB pattern (PDF download) [05106121] (Free)
  • Wideband Oxygen Controller Mk.2 panel artwork (PDF download) (Free)
Articles in this series:
  • Wideband Oxygen Sensor Controller Mk.2, Pt.1 (June 2012)
  • Wideband Oxygen Sensor Controller Mk.2, Pt.1 (June 2012)
  • Wideband Oxygen Sensor Controller Mk.2, Pt.2 (July 2012)
  • Wideband Oxygen Sensor Controller Mk.2, Pt.2 (July 2012)
  • Wideband Oxygen Sensor Controller Mk.2, Pt.3 (August 2012)
  • Wideband Oxygen Sensor Controller Mk.2, Pt.3 (August 2012)
Items relevant to "6-Decade Capacitance Substitution Box":
  • Capacitance Decade Box PCB [04106121] (AUD $12.50)
  • Capacitance Decade Box panel/lid [04106122] (PCB, AUD $15.00)
  • Capacitance Decade Box PCB pattern (PDF download) [04106121] (Free)
  • Capacitance Decade Box panel/lid artwork (PNG download) [04106122] (Panel Artwork, Free)
Pt.2: By JOHN CLARKE Wideband Oxygen Sensor Controller Mk.2 Last month, we introduced our new Wideband Oxygen Sensor Controller Mk.2 and described the circuit. This month, we give the circuit for the display unit and the full construction details. W HILE A VOLTMETER could be used to monitor the Wideband Controller’s 0-5V output, the measured voltage does not directly indicate the lambda value. Instead, you would need to use the equation lambda = [V x 0.228 + 0.70] to convert the controller’s wideband output voltage (V) to the corresponding lambda value. That’s where the Wideband Oxygen Sensor Display comes in. It plugs directly into the controller unit and automatically calculates and displays the correct lambda value. What’s more, the Wideband Oxygen Sensor Display is set up to give the correct 0.70-1.84 lambda range by default, so you do not have to make any adjustments during construction. Alternatively, you can alter the dis30  Silicon Chip play to show the air-fuel ratio or you can program the unit to monitor any other signal source over a 0-5V range and display a corresponding readout (see panel). As shown in the photos, the display unit is built into a small plastic case and this measures 83 x 54 x 31mm. Three 7-segment LED readouts are used to display the reading and these are visible through a red Perspex or acrylic window that takes the place of the original box lid. A single cable fitted with a 3.5mm stereo jack plug connects the unit to the wideband output on the controller and this carries both the signal and power (12V). The unit itself consists of a PIC­ 16F88-I/P microcontroller, three 7-segment displays, a 3-terminal regulator and not much else. It features display dimming in low ambient light (so it’s not too bright at night), while four micro tactile switches allow the displayed values to be adjusted during set-up (if necessary). Circuit details Take a look now at Fig.13 for the circuit details of the Wideband Oxygen Sensor Display. It’s built around PIC microcontroller IC1, with most of the complexity hidden inside its software program. IC1 monitors the signal from the Wideband Controller, processes the data and drives the three 7-segment LED displays to show the calculated lambda value (or the air-fuel ratio if preferred). Output ports RB0-RB7 drive the display segment cathodes, while PNP transistors Q1-Q3 (BC327) siliconchip.com.au D1 1N4004 +12V GND (0V) A K REG1 LM317T ADJ 100 F 16V TP+5V OUT IN 120 10k 100 F VR1 500 S1 B 100nF 4 2 Q1 BC327 B C S4 E Q2 BC327 B C Q3 BC327 14 AN3/RA3 RA2/AN2 RA6 LDR1  RA1 RA0 RA7 IC1 PIC16F88 3 E Vdd RA5/MCLR 2.2k C 2.2k 22k S3 S2 E SIGNAL IN UP DOWN SELECT MODE 10 F AN4/RA4 RB5 RB0 RB2 RB1 10nF RB4 RB7 RB6 RB3 Vss 1 4 x 2.2k 15 18 17 16 11 3 6 7 6 4 2 1 9 10 5 8 7 10 13 12 a b c d e fe g a f a b c d e b g d dp c fe g dp dp a f a b c d e b g d c fe g dp dp a f g c d dp 9 DISP1 8 x 100 DISP2 DISP3 5 LM317T BC327 SC  2012 B 1N4004 WIDEBAND O2 DISPLAY A K E OUT ADJ C OUT IN b 8 10 12 76 34 5 Fig.13 (above): the circuit is based on a PIC16F88-I/P microcontroller (IC1). This monitors the signal from the Wideband Controller at its AN4 (pin 3) input and drives three 7-segment LED displays (DISP1-DISP3). switch the common display anodes, so that only one display digit is driven at any given time (ie, the displays are multiplexed). Note that the cathode segments common to each display are tied together. For example, the “a” segment of DISP1 connects to the “a” segments of DISP2 and DISP3. These “a” segments are driven from the RB5 output of IC1 via a 100Ω resistor. As a result, when this output is low, the “a” segment in one display will light, depending on which digit driver transistor is turned on. Transistors Q1-Q3 are driven by ports RA6, RA1 & RA0 via 2.2kΩ resistors. For example, transistor Q1 is controlled by RA6 and when this output is high, Q1 is held off. Conversely, when RA1 goes low (0V), Q1’s base is pulled low and so Q1 turns on. As a result, any segments within DISP1 that have their cathodes pulled low via IC1’s RB outputs (and their respective 100Ω resistors) would then light. Transistors Q2 and Q3 are driven siliconchip.com.au Display Unit Features & Specifications Features • 3-digit LED display • Preset display range of 0.70 to 1.84 lambda • 0-5V input range & linear display ranging • Adjustable 0V and 5V endpoint values • Decimal point positioning adjustable • Automatic leading zero suppression • Display dimming with minimum brightness adjustment • Quieting period used for input measurement to ensure accuracy Specifications • Power supply: 6-15V <at> 240mA • Input current loading: less than 1µA • Digit update period: 250ms • Wideband display reading range: 0-999 in a similar manner to Q1 to control 7-segment displays DISP2 and DISP3. This on-off switching of the displays is done at such a fast rate (around 2kHz) that the displays all appear to be continuously lit, even though only July 2012  31 1P HOSE IC4 Vs Ip 15V Rcal 150 VR5 1k IC3 LMC6482 470k 10k 510 R ZD2 150 LMC6482 VR4 10k TP1 470k 560k 10k 1W 62 4148 BC327 BC337 CON4 D4 10k D3 220nF 100k 4148 22pF 22k 1M 100nF 62k WIDEBAND OUTPUT 22k TP11 10F TP10 CON3 SIMULATED NARROWBAND OUTPUT S CURVE TPV– A 560k 0.1 5W PLUG 2P INLET TP +5V TP12 D2 470 TP GND VR6 0-5V OUT T 3.3nF 4148 10 TP2 TP4 Vs/Ip 100k 10F VR2 WIDEBAND CONTROLLER TP5 22k Q1 IRF540N 100nF 10k LINK CONNECTIONS 1&2 AND 3&4 IF SENSOR1 IS NOT INSTALLED 10k IC1 PIC16F1507 20k TP9 TP8 SENSOR1 120 100nF 4 3 2 1 CON2 VR1 150 10F TP3 100nF 100nF JP1 10k F1 5A 100F 10F 1k 500 CON1 100nF TP12V REG2 LM2940 CT-12 100nF IC2 LMC6484 100nF VR3 10k 4004 ZD1 1W H+ REG1 LM317T 16V H– GND1 GND2 +12V 12160150 10 © 2012 RELLORTNOC DNABEDD1 IW TP6 TP7 LED1 100F Q2 Q3 100F 100F Fig.14: install the parts on the Wideband Controller PCB as shown here, making sure that the semiconductors and electrolytic capacitors are all orientated correctly. Use PC stakes at the external wiring points and note that the wire links between pins 1 & 2 and 3 & 4 of CON2 are installed only if the pressure sensor is not fitted. The lower (righthand port) of the pressure sensor must be plugged using silicone (see text). one transistor is on at any time, ie, first Q1, then Q2 and then Q3. The RA7 output is used to monitor pushbutton switch S4. This output is momentarily taken low after transistor Q3 is switched off and before Q1 is switched on again (more about this later). Display dimming Light dependent resistor LDR1 is used to sense the ambient light to control the display dimming. This is connected in series with a 22kΩ resistor to form a voltage divider across the +5V rail and its output is fed to IC1’s AN3 input. When the ambient light level is high, the LDR has a low resistance and the voltage at the AN3 input is pulled down close to 0V. Conversely, in low ambient light, the LDR has a high resistance and the AN3 input is pulled close to the +5V rail via the 22kΩ resistor. And at intermediate light levels, the voltage on AN3 will sit somewhere between 0V and +5V. Microcontroller IC1 dims the displays in response to its AN3 voltage. That’s done by limiting the amount of time that the displays are lit. In bright light, each display is lit for almost 25% of the total time but this reduces as the voltage on AN3 rises in response to falling light levels. In fact, at very low light levels, each 32  Silicon Chip display might only be lit for about 2% of the time. Pushbutton switches Switches S1-S4 allow the unit to be programmed by providing the Mode, Select, Down & Up functions. These switches are commoned on one side and connected to the +5V rail via a single 10kΩ resistor. They are also connected to IC1’s AN2 input and this monitors the switches as described below. The other sides of switches S1-S3 are connected respectively to the bases of transistors Q1-Q3, while S4 connects to the RA7 output via a 2.2kΩ resistor (as mentioned previously). If S1-S4 are all open, IC1’s AN2 input will be held at +5V via the 10kΩ pullup resistor. However, if a switch is closed, AN2 will either be connected to the base of the corresponding transistor or to RA7 via the 2.2kΩ resistor. As a result, if one of switches S1-S3 is pressed, the voltage on AN2 will drop to about 0.6V below the +5V rail (ie, to 4.4V) when the corresponding transistor switches on. Alternatively, if S4 is pressed, the AN2 voltage will drop to about 900mV each time the RA7 output goes low, due to the voltage divider action of the 10kΩ resistor to the +5V rail and the 2.2kΩ resistor in series with RA7. In operation, the microcontroller periodically checks the voltage at its AN2 input. As a result, it can decide if a switch has been closed based on the AN2 voltage and then determine which switch it is by checking which transistor is currently switched on or if RA7 is low. Input signal The input signal from the Wideband Controller is fed to the AN4 pin of IC1 via a 2.2kΩ current-limiting resistor and filtered using a 10nF capacitor. IC1 converts this input voltage into a 10-bit digital value which is then processed by the software and the resulting calculated value fed to the LED displays. The 2.2kΩ input resistor and internal clamping diodes inside IC1 protect the AN4 port if the input goes above the +5V supply or below the 0V rail; ie, out-of-range input voltages are clamped to the supply rails. The 10nF capacitor filters any voltage spikes that may be applied to the input. A feature of unit is that it switches off all the displays for a short period before measuring the input voltage. This minimises any voltage drops that could occur due to supply current flowing in the ground wiring if the displays were lit and ensures accurate measurements. Timing for IC1 comes from an internal oscillator running at 4MHz. This siliconchip.com.au This view shows the fully-assembled Wideband Controller, with all wiring completed. Fit heatshrink over all wiring connections to the PCB and the 8-pin panel plug to prevent shorts. Note that the ICs should be left out of their sockets until after some initial tests have been completed (see text). has an accuracy of about 2% which is close enough for this application, as the timing is not critical. the +5V rail provides the power-on reset signal for IC1. Power supply OK, let’s now build the Wideband Controller unit. It’s quite straight­ forward to assemble, with all parts (except for the wideband oxygen sensor) mounted on a PCB coded 05106121 and measuring 149 x 76mm. This is housed in an ABS box measuring 155 x 90 x 28mm. An 8-pin circular multi-pole panel plug connector is used to provide the interface to the external wideband sensor. This sensor is mounted on the exhaust (either directly or via an adaptor pipe) and connects to the controller via a 7-way extension cable. A separate cable enters through a cable gland at the other end of the box and this supplies power to the controller PCB. The wires in this 3-way cable terminate to an on-board screw terminal block. The wideband and narrowband outputs are fed out on one side of the case via 3.5mm stereo jack sockets. Fig.14 shows the parts layout on the PCB. Begin by checking the board for any defects such as shorted tracks or breaks in the copper. Check also that the corners have been shaped to clear Power (ie, 12V) is derived from the Wideband Controller via reverse polarity protection diode D1 and fed to an adjustable 3-terminal regulator (REG1). The 100µF capacitors across REG1’s input and output terminals provide bypassing, while the 10µF capacitor at the adjust (ADJ) terminal reduces the output ripple. Trimpot VR1 sets the output voltage and is adjusted to produce a + 5V rail. In works like this: REG1 has a 1.25V reference between its OUT and ADJ terminals and so a current of 10.4mA flows through the associated 120Ω resistor. This current also flows through VR1. If VR1 is adjusted to 360Ω, it will have 3.75V across it and the output voltage from REG1 will be 3.75 + 1.25V = 5V. Note that, in practice, the 1.25V reference can be anywhere between 1.2V and 1.3V, which is why we need to adjust the output using VR1. The supply rail to IC1 is further decoupled using a 100nF capacitor at pin 14. In addition, a 2.2kΩ resistor between IC1’s MCLR input (pin 4) and siliconchip.com.au Building the controller the internal moulding of the box by test-fitting it in place. Note that the box comprises a base and a lid (as well as front and rear panels) and each is clearly labelled on the inside surface. The PCB mounts onto the base. Once these checks are complete, start the PCB assembly by installing the resistors. Table 1 shows the resistor colour codes but you should also check each one using a digital multimeter before soldering it in place. The 0.1Ω 5W resistor runs cold and can be mounted flush against the PCB. Next, install the diodes, zener diodes and the IC sockets. Make sure that each socket is orientated correctly (ie, with its notched end towards the top of the PCB). Follow with the capacitors, taking care to install the electrolytic types with the polarity indicated. That done, install REG1, REG2 and Q1. These parts are all mounted flat against the PCB, so you will have to bend their leads down through 90° to get them to fit. This involves bending the two outer leads of each device down about 8mm from its body, while the middle lead is bent down about 6mm away. Secure each device to the PCB using an M3 x 10mm screw and nut before July 2012  33 The front side panel has a hole drilled at the lefthand end so that a plastic hose can be run to the upper port of the pressure sensor. The status LED fits through a 3mm hole in the centre of this panel. (SIDE PANEL) 8-PIN PANEL PLUG (REAR VIEW) CABLE GLAND (REAR VIEW) 4 5 3 2 7.5A WIRES CABLE TIE 7.5A WIRES 6 8 7 1 WIDEBAND CONTROLLER 16V H– H+ GND1 GND2 +12V 4004 © 2012 Vs/Ip Vs 15V Rcal 4148 4148 4148 Ip Fig.15: follow this diagram to complete the external wiring. Be sure to use 7.5A cables where indicated and note that two power supply earth leads are run out through the cable gland at left and secured to the vehicle’s chassis near the battery earth point (the second earth lead is necessary to handle the heater current). soldering its leads. Make sure that each device goes in the correct location. Transistors Q2 and Q3 can go in next. Be sure to use a BC327 for Q2 and a BC337 for Q3 (do not get them mixed up). Once they’re in, install the 2-way pin header for JP1 (below REG2), then install PC stakes at the test points and 34  Silicon Chip external wiring positions. LED1 is next on the list. This is installed by first orientating the LED as shown in Fig.14 (anode to the left) and bending its leads down at right angles about 8mm away from its body. That done, the LED is mounted in position with its leads some 6mm above the board surface. A 6mm spacer will make it easy to set the height correctly. The six trimpots (VR1-VR6) can now go in. Check that the correct value is installed at each location and orientate each one with its adjusting screw as shown on Fig.14 (this ensures that the voltages at their wipers increase with siliconchip.com.au Table 1: Wideband Controller Resistor Colour Codes o o o o o o o o o o o o o o o o o No.   1   2   2   2   1   3   1   4   1   1   1   3   1   1   2   1 Value 1MΩ 560kΩ 470kΩ 100kΩ 62kΩ 22kΩ 20kΩ 10kΩ 1kΩ 500Ω 470Ω 150Ω 120Ω 62Ω 10Ω 0.1Ω 5W clockwise rotation). Note that these trimpots may be marked with a code other than the actual resistance value in ohms, ie, the 500Ω trimpot may be coded as 501, the 10kΩ trimpots may be coded as 103 and the 1kΩ trimpot may be coded as 102. The 3-way and 2-way screw terminal blocks that comprise CON1 can now be installed. These must be dovetailed together to form a 5-way block before soldering them in position (the wiring access holes must face towards the rear of the PCB). The fuse clips can then be installed, taking care to ensure that the stopper flange on each clip goes to the outside (otherwise you won’t be able to insert the fuse later on). Follow these parts with the 3.5mm stereo sockets (CON2 and CON3). Check that these sockets are seated flush against the PCB before soldering their leads. Finally, complete the PCB assembly by installing the pressure sensor (Sensor1). This is installed by bending its leads down through 90° and plugging it into a 4-way socket strip (CON2). Solder the socket strip to the PCB first, then carefully examine the pressure sensor. This has a small notch in its pin 1 lead and this must go to the right. Once you’ve got its orientation sorted out, bend its leads down and plug it into the socket strip. The sensor can then be secured to the PCB using two M3 x 15mm screws and nuts. Note that the pressure sensor is optional (although it should be installed siliconchip.com.au 4-Band Code (1%) brown black green brown green blue yellow brown yellow violet yellow brown brown black yellow brown blue red orange brown red red orange brown red black orange brown brown black orange brown brown black red brown green black brown brown yellow violet brown brown brown green brown brown brown red brown brown blue red black brown brown black black brown not applicable 5-Band Code (1%) brown black black yellow brown green blue black orange brown yellow violet black orange brown brown black black orange brown blue red black red brown red red black red brown red black black red brown brown black black red brown brown black black brown brown green black black black brown yellow violet black black brown brown green black black brown brown red black black brown blue red black gold brown brown black black gold brown not applicable if you wish to compensate for exhaust manifold pressure). If the sensor is not installed, then pins 1 & 2 of CON2 must be bridged. The same goes for pins 3 & 4. This is best done by bridging the solder connections on the underside of the PCB, or you can simply install wire links through the PCB in place of CON2. Table 2: Capacitor Codes Value 220nF 100nF 3.3nF 1nF 22pF µF Value 0.22µF 0.1µF .0033µF .001µF NA IEC Code EIA Code 220n 224 100n 104   3n3 332    1n 102   22p   22 Boxing it up Once the PCB is finished, you’re ready to install it in the ABS case. This case is opened up by unclipping the front and rear panels – just squeeze the top and bottom sections of the case at the positions indicated by the arrows and pull the panels off. The PCB assembly is secured to the integral mounting bushes on the base. Before doing this though, you will need to file two half circles in the righthand side of the case to provide clearance for the threaded collars of the stereo jack sockets. This can be done using a small rat-tail file. Similarly, the matching side of the lid must also be filed to complete the Sensor Input Power Input (16V maximum) (Bosch LSU4.9 Wideband Sensor) SILICON CHIP Display Output (0-5V = 0.7-1.84) WIDEBAND CONTROLLER Status LED Pressure Input Simulated Narrowband Output Continuously lit = sensor heating Rapid flashing = normal operation Slow flashing = sensor error/out of range Fig.16: this full-size front panel for the Wideband Controller can either be copied or downloaded in PDF format from the SILICON CHIP website. July 2012  35 The two 3.5mm stereo jack sockets protrude through holes at one end of the case. the leads from breaking. This means that you have to slide a length of heatshrink over each lead before soldering it to the connector. After soldering, the heatshrink is pushed over the connection and shrunk down with a hot-air gun. The power supply leads must be fed through the cable gland before connecting them to the screw terminal block. Note that because of the currents involved in the heater circuit, two power supply earth wires must be used as shown in Fig.15. These connect together at the vehicle’s chassis near the battery’s negative lead while the +12V lead goes to the vehicle’s battery via the switched ignition circuit. Alternatively, for temporary use, the cigarette lighter socket can be used to provide power via a lighter plug connector. Sensor extension cable circular clearance holes required for the 3.5mm socket collars. The front panel can now be drilled and reamed to provide the necessary holes for the LED and pressure sensor (if used). You will need to drill a 3mm hole right in the centre of the panel for the LED and a hole directly in front of the top port of the pressure sensor (about 11mm down from the top and 13mm in from the side). The diameter of this latter hole will depend on the diameter of the plastic tubing used but will be about 9mm. On the rear panel, the cable gland and the circular connector are both positioned 19mm in from their respective ends. Both are centred vertically. Once the holes are drilled and reamed to size, mount the gland and the connector in position. Note that the hexagonal nut that’s used in each case must be orientated so that two of its flat sections are parallel to the top H+ Rcal 5 H– 3 6 2 8 7 1 The sensor extension cable is made using a 6-way sheathed and shielded lead from TechEdge (see parts list last month). It’s wired as shown in Fig.17. Make sure that the wiring is correct and be sure to use heavy duty (7.5A) leads in the cable for the H+ and H- leads. The wiring is shown from the back (soldering side) of each connector, so be sure to follow Fig.17 carefully. Note that the 6-pin connector includes rubber sealing glands and these are placed over each lead before it is attached to the 2.8mm female crimp spade terminals. Setting up Before setting up the completed unit, first check that all the ICs are out of their sockets, that the sensor is unplugged and that there’s no jumper plug for JP1. It’s then simply a matter of following this step-by-step procedure: Ip Vs/Ip 8-PIN CIRCULAR LINE SOCKET (REAR) 2 H+ SHIELD WIRE (TO PIN 7) 3 1 Vs/Ip Ip Rcal H– NOTE: H+ AND H– WIRES SHOULD BE RATED FOR 7.5A 4 Vs and bottom edges of the panel. If you don’t do this, the nuts will interfere with the top and bottom case sections when you try to attach the panel. Note also that some cable gland nuts have a moulded circular section behind the nut and this will need to be cut away so that its faces are flat. Once all the holes have been drilled, secure the board in position using four M3 x 5mm screws, then run the wiring as shown in Fig.15. Note that you must use 7.5A rated wire for the 12V supply, ground and heater wires. The 8-pin circular panel connector is wired by first connecting the sensor leads to the PC stakes on the PCB and the heater and earth leads to the screw terminal block. The free ends of these leads are then soldered to the connector itself. Note that each soldered pin on the connector is covered with heatshrink tubing to avoid shorts and to prevent 5 4 6 Vs 6-PIN 7200 TYPE FEMALE LINE CONNECTOR (REAR) Fig.17: this diagram shows the wiring details for the sensor extension cable, with the socket connections shown from the rear. Make sure that the wiring is correct, otherwise the oxygen sensor could be damaged. Note that you must use heavy-duty cable for the heater H+ and H- leads. 36  Silicon Chip siliconchip.com.au Above: the completed extension cable with the oxygen sensor attached. The sheathed lead that’s used to make the extension cable is available from TechEdge – see parts list last month. Step 1: connect a multimeter between TP3 and Rcal, set the meter to read ohms and adjust trimpot VR5 for a reading of 311Ω. Step 2: Apply power (12V) to the circuit, monitor the voltage between TP +5V and TP GND and adjust VR1 for a reading of 5.00V. Step 3: Connect the multimeter between TP GND and TP2 and adjust VR2 for 4V. This initially sets the engine-started battery voltage detection at 12V. Step 4: Switch off, install IC2, IC3 & IC4 (but not IC1) and apply power again. Monitor the voltage between TP1 and TP GND and adjust VR3 for a reading of 3.3V, then monitor the voltage between TP4 and TP GND and adjust VR4 for a reading of 3.92V. Step 5: Switch off and install IC1 in siliconchip.com.au This view shows the female 6-pin connector (left) at the end of the extension cable and the matching male plug that comes fitted to the sensor (right). its socket (watch its orientation). Reapply power and check that TP12V is at about 12V (note: it will be slightly lower than 12V if the supply is only 12V). Step 6: Check that the voltage at TPV- is close to -2.5V. If the latter voltage is positive, check the orientation of diodes D2-D4 and check the placement of Q2 & Q3. Check the orientation of the 100µF capacitors as well. Step 7: With the sensor still unJuly 2012  37 S3 2.2k DISP1 2.2k DISP3 2.2k DISP2 3x100  SIL 888 5x100  SIL ARRAY 10k 22160150 d n a b e di w y alpsi d REG1 LM317T TP+5V 120 100nF 10nF © 2012 IN GND +12V 2.2k VR1 500 100 F 4004 D1 SHIELD BRAID CONNECTS TO GND PIN TIP (3.5mm STEREO PLUG) SHIELD BRAID CONNECTS TO SLEEVE RING 100  0.5W RESISTORS PCB ALTERNATIVE TO SIL RESISTOR ARRAY Fig.19: if you are unable to obtain the resistor arrays, separate 100Ω resistors can be used instead. These are mounted end-on, as shown here. plugged, check that the status LED is initially at low brightness when power is applied. Check that it then goes to full brightness for 4s and then flashes at a 1s rate, indicating an error with the sensor connection. Step 8: As mentioned in Pt.1, VR6 sets the pressure offset in the event that the pressure sensor is plugged at an altitude above sea level. Adjust this trimpot to set TP10 to 1V/1000m. For example, at 500m above sea level, adjust VR6 to set TP10 at 0.5V. At sea level, adjust VR6 for 0V on TP10. Step 9: Once step 7 is completed, plug the hole in the pressure sensor’s lower port with silicone sealant. Testing with the O2 sensor The next step is to check the control- 100 F S2 S1 2.2k IC1 PIC16F88 LDR1 2.2k 22k S4 Q3 Q2 Q1 10 F Fig.18 (left): install the parts on the display unit PCB as shown here, taking care to orientate the IC and electrolytic capacitors correctly. The photo directly above shows the fully-assembled board ler’s operation with the oxygen sensor connected. First, switch off and connect the sensor lead to the controller. Now check that there is resistance between the sensor’s H+ and H- heater terminals, as measured at the screw terminal block. You should get a reading of about 3.2Ω at 20°C. When power is subsequently applied, the sensor will become hot, so be sure to first remove the plastic protective cap. In addition, the sensor should be placed on a surface that can withstand 200°C. Glass cookware (eg, Pyrex) is ideal but do not hit the sensor against the glass, otherwise its ceramic element could crack. It’s also important to note that the tip of the sensor can become hot enough to burn skin when power is applied. You will need a 12V supply that can deliver about 2A. Apply power and check that LED1 lights dimly for 2s, then goes to full brightness for around 10s before flashing at a 1s rate. The slow (1s) flashing means that the sensor is measuring a lean mixture beyond its range. That’s because it’s sitting in open air with 21.9% oxygen rather than monitoring a burnt fuel mixture. You can further check the control- ler’s operation by setting it up for an oxygen measurement, to be described in Pt.3 next month. Additional tests can also be carried out after the oxygen sensor is fitted to a vehicle, to measure the exhaust. If the controller doesn’t appear to be operating correctly, check for assembly errors and repeat the setting-up procedure. Having completed the above tests, adjust VR2 so that TP2 is at 4.33V. This sets the controller to wait until the supply voltage reaches 13V (ie, after the engine has started) before beginning to heat the sensor. Building the display unit Fig.18 shows the assembly details for the display unit. All parts are installed on a double-sided PCB with plated-through holes and coded 05106122 (80 x 50mm). The completed assembly is housed in a small plastic case measuring 83 x 54 x 31mm. Table 4: Capacitor Codes Value µF Value IEC Code EIA Code 100nF 0.1µF 100n 104 10nF 0.01µF   10n 103 Table 3: Display Unit Resistor Colour Codes o o o o o No.   1   1   6   1 38  Silicon Chip Value 22kΩ 10kΩ 2.2kΩ 120Ω 4-Band Code (1%) red red orange brown brown black orange brown red red red brown brown red brown brown 5-Band Code (1%) red red black red brown brown black black red brown red red black brown brown brown red black black brown siliconchip.com.au The PCB simply clips into the recommended plastic case, with the output cable emerging through a cable gland as shown at right. Begin by checking the board for any defects and by checking the hole sizes for the major parts. Check also that the PCB is cut and shaped to size so that it clips into the integral side slots in the case. Install diode D1 and the resistors first, taking care to place each in its correct position. Table 3 shows the colour code values but you should also use a digital multimeter to check each resistor before installing it. Note that the 100Ω resistors are in a single in-line (SIL) resistor array. Alternatively, you can use standard 100Ω 0.25W resistors here and these are installed by mounting them end-on as shown in Fig.19. Next, install PC stakes at the test point and external wiring points. The TP+5V PC stake is installed from the top of the PCB while the IN, GND and +12V PC stakes go in on the underside of the PCB (the external wiring connects to the rear of the board). Transistors Q1-Q3 are next on the list. These must be installed so that their tops are no higher than 12mm above the PCB. Once they’re in, install the four switches (S1-S4). These switches can only go in with the correct orientation so if the holes don’t line up, simply rotate them by 90°. Regulator REG1 can now go in. This device mounts horizontally on the PCB, with its leads cranked down through 90° so that they pass through their corresponding holes. Secure its tab to the board using an M3 x 10mm screw and nut before soldering its leads (don’t solder the leads first, otherwise the PCB tracks can crack as the mounting screw is tightened down). siliconchip.com.au Now install the capacitors. Take care to orientate the electrolytics as shown on the layout and note that these need to be no higher than 12mm above the PCB. Mounting the displays Now for the 7-segment LED displays. These are mounted by plugging them into a cut-down DIL40 IC socket, to raise them off the PCB. The first step is to cut off a 2 x 5-pin section from one end of the IC socket using side cutters, a hacksaw or a sharp knife, so that 15 socket pins remain on each side. That done, the socket can be installed on the PCB and the displays inserted, making sure that the decimal points are at bottom right. IC1 is mounted via an 18-pin DIL socket. Be sure to orientate this socket with its notched end towards the top before soldering its pins. Do not plug IC1 in yet, though – that step comes later. The PCB assembly can now be completed by installing trimpot VR1 and then the LDR. The latter should be installed so that its top surface is exactly 15mm above the top of the PCB. Testing Once the assembly is complete, go over the board carefully and check for incorrect parts placement and for missed or shorted solder joints. If this all checks out, check that IC1 is out of its socket, then apply power to the +12V and GND (0V) terminals. Next, connect a multimeter set to measure volts between the TP+5V test point and GND. Adjust VR1 for a reading of 5V on the meter, then disconnect power and install IC1. When power is now reapplied you should be greeted with a display on the 7-segment digits. If not, check the orientation of IC1. If that’s correct, check that transistors Q1-Q3 are BC327 PNP types. Final assembly The PCB is designed to simply clip into the specified plastic case. As mentioned earlier, the lid supplied with the case is discarded and replaced by a transparent red Perspex lid measuring 82 x 54 x 3mm. This not only allows the displays to be seen but also allows the LDR to receive ambient light to control the display dimming. You will need to drill four corner holes in this lid and this can be done using the old lid as a marking template. Note that the new lid sits on the top of the base; ie, it doesn’t fit inside the case and rest on the corner pillars. This is necessary to provide sufficient clearance for the 7-segment displays. Before installing the PCB, you will need to drill a hole in the rear of the case and fit a cable gland. This hole is positioned towards the bottom of the box and is centred horizontally (see photo). Twin-shielded wire (ie, two wires with a common shield) is used for the signal input and power supply connections. As shown on Fig.18, the shield is connected to the GND PC stake on the display PCB, the red wire to the +12V terminal and the blue wire to the signal “IN” stake. Once these connections have been made, push the cable through the cable gland and clip the PCB into position July 2012  39 Displaying The Air-Fuel Ratio Or Other Numbers The Wideband Oxygen Sensor Display is quite a versatile unit and can be used in applications other than with the Wideband Controller. You can change the display to indicate whatever numbers you like at the start and end of the 0-5V input signal range. In addition, the position of the decimal point can be changed. This means that if you prefer to display the air/fuel ratio instead of the lambda value, it’s easy to set up the display unit accordingly. For example, you may wish to set the display to show air/fuel ratio values ranging from 10.3 to 27.1, corresponding to lambda values ranging from 0.70-1.84 for petrol (petrol has an air/fuel ratio of 14.7 at stoichiometric, ie, when lambda = 1). In this case, it’s simply a matter of setting the display unit’s lower (0V) endpoint value to 10.3 (ie, 0.7 x 14.7) and the upper (5V) endpoint value to 27.1 (1.84 x 14.7). If you are using a fuel other than petrol, then you will have to re-calculate the end point values accordingly – eg, diesel typically has a stoichiometric air/ fuel ratio of 14.5:1 (this can vary according to the fuel supplied), while LPG has a stoichiometric air/fuel ratio of 15.5:1 (see panel on p38 of the July 2012 issue). Other uses For other applications, all you have to do is program in the two endpoint values to customise the response. One endpoint value is what you want the display to show when 0V is applied to the input. The second endpoint value is the value that’s to be displayed when 5V is applied to the input. The unit then provides a linear response for input values between these two extremes. Note that you’re not restricted to using a lower endpoint value at the 0V input end than at the 5V input end. It’s quite OK for the endpoint (or display) value for 0V input to be higher than the display value for 5V input. The maximum value that can be displayed is 999 and no negative sign is available. inside the box. The cable gland can then be tightened to secure the cable in position. The other end of the cable connects to a 3.5mm stereo jack plug. Connect the shield to the sleeve of the 3.5mm jack plug, the +12V wire (red) to the ring and the signal lead wire (blue) to the tip. Display adjustments As mentioned previously, the display unit is set up to display the required 0.70 to 1.84 lambda range when used with the Wideband Controller. Alternatively, if you want to change the display values (eg, to display airfuel ratios instead), then this is done using switches S1-S4. Switch S1 (Mode) is used to select the normal display mode or the settings mode. The normal display is automatically selected at power up and this is where display values are shown in response to an input voltage. Each time S1 is pressed it alternates between this normal display mode and the settings mode. The settings mode allows changes to be made for decimal point positioning, 40  Silicon Chip the 0V endpoint (or display) value, the 5V endpoint value and the minimum dimming for the display in that order. Whenever the settings mode is selected with S1, the display initially shows the decimal point positioning, ie, it shows “dP” plus the selected decimal point position. The decimal point can then be moved from left to right using the Down (S3) or Up (S4) switches (note: the decimal point does not light for DISP3 since this is not necessary). Switch S2 (Select) cycles the display through the settings. The first press shows the 0V value, ie, the value that’s displayed for 0V input. You can change this value using the Up and Down switches. Pressing S2 again will show the 5V display value (the display value that shows when the input is at 5V). This can also be changed using the Up and Down switches. Finally, pressing switch S2 again shows the display dimming value. This sets the minimum display brightness that occurs in darkness. The value can be reduced or increased using the Up and Down switches to adjust the minimum brightness, as required. Display Unit Parts List 1 double-sided PCB, code 05106122, 80 x 50mm 1 plastic utility case, 83 x 54 x 31mm. 1 piece of red transparent Perspex or Acrylic sheet, 82 x 54 x 3mm 4 SPDT micro tactile switches with a 6mm actuator (S1-S4) 1 3.5mm stereo jack plug 1 LDR with 48kΩ light resistance 1 DIL40 IC socket, 0.3-inch width (cut to DIL30) 1 DIL18 IC socket 1 3-6.5mm IP65 cable gland 1 M3 x 10mm screw 1 M3 nut 4 PC stakes 1 2m length of twin shielded cable 1 500Ω multi-turn trimpot (3296W type) (Code 501) (VR1) Semiconductors 1 PIC16F88-I/P microcontroller programmed with 0510612B. hex (IC1) 3 13mm common anode red LED displays (DISP1-DISP3) 3 BC327 transistors (Q1-Q3) 1 LM317T adjustable regulator (REG1) 1 1N4004 1A diode (D1) Capacitors 2 100µF 16V electrolytic 1 10µF 16V electrolytic 1 100nF MKT polyester 1 10nF MKT polyester Resistors (0.25W, 1%) 1 22kΩ 6 2.2kΩ 1 10kΩ 1 120Ω Resistor arrays 1 100Ω x 5-resistor isolated 10-pin SIL array (eg, Bournes 4610X-102 100R) 1 100Ω x 3-resistor isolated 6-pin SIL array (eg, Bournes 4606X102 100R) Note: 8 x 100Ω resistors can be used instead of the resistor arrays That’s all we have space for this month. The final article next month details the oxygen sensor installation and describes how the Wideband SC Controller is used. siliconchip.com.au