Silicon ChipSimple Voltage Switch For Car Sensors - December 2008 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Electric vehicles might be a technological dead-end
  4. Feature: The Chevrolet Volt Electric Car by Ross Tester
  5. Feature: Digital Cinema: Digitising The Movies by Barrie Smith
  6. Project: Versatile Car Scrolling Display, Pt.1 by Mauro Grassi
  7. Project: Test The Salt Content Of Your Swimming Pool by Leo Simpson
  8. Project: Build A Brownout Protector by John Clarke
  9. Review: Owon Digital Hand-Held Oscilloscope by Mauro Grassi
  10. Project: Simple Voltage Switch For Car Sensors by John Clarke
  11. Feature: The 2008 AEVA Electric Vehicle Field Day by Leo Simpson
  12. Vintage Radio: The Leak TL/12 Plus Valve Amplifier by Rodney Champness
  13. Book Store
  14. Advertising Index
  15. Outer Back Cover

This is only a preview of the December 2008 issue of Silicon Chip.

You can view 29 of the 96 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 "Versatile Car Scrolling Display, Pt.1":
  • PIC18F4550-I/P programmed for the Multi-Purpose Car Scolling Display [0510109A.hex] (Programmed Microcontroller, AUD $15.00)
  • Software and documentation for the Multi-Purpose Car Scrolling Display [0510109A.HEX] (Free)
  • Multi-Purpose Car Scrolling Display PCB patterns (PDF download) [05101091/2] (Free)
Articles in this series:
  • Versatile Car Scrolling Display, Pt.1 (December 2008)
  • Versatile Car Scrolling Display, Pt.1 (December 2008)
  • Multi-Purpose Car Scrolling Display, Pt.2 (January 2009)
  • Multi-Purpose Car Scrolling Display, Pt.2 (January 2009)
  • Multi-Purpose Car Scrolling Display, Pt.3 (February 2009)
  • Multi-Purpose Car Scrolling Display, Pt.3 (February 2009)
Items relevant to "Build A Brownout Protector":
  • Brownout Protector PCB pattern (PDF download) [10112081] (Free)
  • Brownout Protector panel artwork (PDF download) (Free)
Items relevant to "Simple Voltage Switch For Car Sensors":
  • Simple Voltage Switch PCB [05112081] (AUD $5.00)
  • Simple Voltage Switch PCB pattern (PDF download) [05112081] (Free)

Purchase a printed copy of this issue for $10.00.

Any sensor that outputs a varying voltage can be used by the Simple Voltage Switch to turn things on and off . . . intercooler sprays, boost control solenoids, warning lights, fans, water injection – you name it! Design by JOHN CLARKE Simple Voltage Switch For Car Sensors This Simple Voltage Switch can be used anywhere you want a relay to switch when a voltage reaches a preset level. It has lots of applications in cars but can be used in any application where you have 12V DC available. Having switched the relay on, it will then switch if off as the voltage being monitored drops below the preset level. I N CAR APPLICATIONS, many engine sensors have variable voltage outputs and these can be used for relay switching. For example, if your car has an air-flow meter with a voltage output (most cars have), then you Main Features • Adjustable switching level between 0V and 16V at input • DPDT 5A relay • Configurable to switch on rising or falling voltage • Adjustable hysteresis • High input impedance – won’t load down sensors 72  Silicon Chip can use that as an engine load signal to switch things on and off. For example, do you want a warning when fuel usage is going through the roof, as it will be when the air-flow is high? If you use this project, it can turn on a light and/or sound a buzzer so you can ease off on the accelerator or change down a gear, or both. Or you could use the throttle position sensor directly, to do the same thing. Or going back to the air-flow sensor, in a turbocharged engine, you could use the Simple Voltage Switch to run a solenoid to close off the turbo waste from the boost pressure source whenever engine loads are low. Or maybe you could use the unit to control a water spray onto the intercooler. We are sure that you will be able to think of plenty of nifty ideas. This project was first presented in our “Performance Electronics for Cars” book published a few years ago and we are re-presenting it this issue to give it a wider exposure. It is quite simple in presentation; just a PC board with a relay and a handful of other components. You should be able to assemble it in less than one hour. Circuit description Fig.1 shows the circuit of the Simple Voltage Switch. It relies on comparator IC1a, which compares the input voltage to a preset reference level. The input voltage (VIN) is divided via two 1MΩ resistors in series which effectively apply one half of the voltsiliconchip.com.au Fig.3: the circuit is based on comparators IC1a & IC1b. IC1a compares the input voltage (VIN) to a reference voltage set by trimpot VR1 and switches its output (pin 1) high or low accordingly. IC1b acts as an inverter, while link LK1 allows the circuit to be set to trigger on either a rising voltage or a falling voltage. The selected comparator output drives transistor Q1 & the relay. age to the inverting input, pin 2, of IC1a. Zener diode ZD2 and the 100nF capacitor are there to protect against transient voltages on the input signal. IC1a’s non-inverting input (pin 3) is connected to reference trimpot VR1, via a 10kΩ resistor. When pin 2 is above pin 3, IC1a’s pin 1 output is low, ie, close to 0V. When pin 2 is below pin 3, pin 1 is high, at around +10V. Hysteresis (positive feedback from pin 1 to pin 3) has been added to prevent the output from oscillating at the trigger voltage. This is provided via trimpot VR2 and diode D3. This feedback causes the output to “pull” the voltage at pin 3 either higher or lower, depending on whether the output at pin 1 is high or low and also on the orientation of diode D3. If D3 is installed as shown (ie, anode to pin 3), the voltage on pin 3 will be pulled lower than the reference voltage set by VR1 when IC1a’s output (pin 1) goes low. However, if pin 1 is high, D3 will be reverse biased and the reference voltage is unaffected. siliconchip.com.au Conversely, if D3 is installed the other way around (cathode to pin 3), pin 3 will be pulled higher than the reference voltage if IC1a’s output goes high. In practice, this means that diode D3 is inserted with its anode towards pin 3 if you want the Simple Voltage Switch to trigger on a low to high (L\H) transition and with its cathode towards pin 3 if you want it to trigger on a high to low (H\L) transition. Basically, the hysteresis is the difference between the switch-on and switch-off voltages and this is set using VR2. We need hysteresis in the circuit otherwise the relay would tend to switch on and off very rapidly when Suggested Uses For the Voltage Switch • Intercooler water spray control (from air-flow meter, throttle position sensor or oxygen sensor signals) • Anti-lag turbo wastegate control (operating a wastegate disconnect solenoid triggered from the air-flow meter signal) • • • • Nitrous oxide switching (from throttle position sensor signal) Intercooler fan control (from air-flow meter signal) Dashboard monitoring LED (eg, oxygen sensor output signal) Switching in and out engine management and auto transmission control modifications (from air-flow meter, throttle position sensor or oxygen sensor signals) • Low battery voltage warning and/or disconnect December 2008  73 Parts List 1 PC board, code 05112081 or 05car061, 106 x 61mm 5 PC-mount 2-way screw terminals, 5mm pin spacing 1 12V PC-mount DPDT 5A relay (Relay1) 1 3-way header, 2.54mm spacing 1 jumper shunt, 2.54mm spacing 1 1kΩ multi-turn top adjust trimpot (VR1) 1 1MΩ horizontal trimpot (VR2) Semiconductors 1 LM358 dual op amp (IC1) 1 7808 3-terminal regulator (REG1) 1 BC337 NPN transistor (Q1) 1 5mm red LED (LED1) 2 16V 1W zener diodes (ZD1,ZD2) 2 1N4004 1A diodes (D1,D2) 1 1N4148 small signal diode (D3) Capacitors 2 100μF 16V PC electrolytic 2 10μF 16V PC electrolytic 1 100nF MKT polyester (code 104 or 100n) Resistors (0.25W, 1%) 2 1MΩ 1 1.8kΩ 1 22kΩ 1 1kΩ 4 10kΩ 1 10Ω the input voltage is close the to preset threshold. IC1b is an inverter and it provides a signal which is the opposite polarity to IC1a’s output. It compares IC1a’s output with the +5.5V set on its noninverting input. When IC1a’s output goes high, IC1b’s output goes low. And when IC1a’s output goes low, IC2a’s output goes high. Link LK1 provides the option of driving the relay with a falling (H/L) input voltage or a rising (L/H) input voltage, respectively. The output The Simple Voltage Switch could be used to monitor the oxygen sensor signal, allowing devices to be turned on or off when the mixture is too rich or too lean. The unit won’t load down the signal, so it can still be used by the ECU. selected (either from IC1a or IC1b) drives transistor Q1 which in turn drives the relay. The diode across the relay coil (D2) is there to quench the reverse voltage that is generated by the collapsing magnetic field of the relay coil when it is switched off. Without the diode, the relay could generate very high positive voltages which could blow the transistor. Power for the circuit is obtained from the switched +12V ignition supply. Diode D1 gives reverse connection protection, while the 10Ω resistor, 100µF capacitor and zener diode ZD1 provide transient protection at the input of regulator REG1. The reference circuitry is powered from the output of REG1 (+8V), while the remainder of the circuit is powered from the +11.4V rails which are derived before the regulator. Construction While the unit is simple to build, Resistor Colour Codes Value 4-Band Code (1%) 5-Band Code (1%) 1MΩ 22kΩ 10kΩ 1.8kΩ 1kΩ 10Ω brown black green brown red red orange brown brown black orange brown brown grey red brown brown black red brown brown black black brown brown black black yellow brown red red black red brown brown black black red brown brown grey black brown brown brown black black brown brown brown black black gold brown 74  Silicon Chip you need to know one thing about its eventual application. Will you be using it to detect a voltage that will be increasing (L/H) to the preset trip point or falling (H/L) to the preset trip point? The unit can be made to work either way but if you know this before you assemble it, there will be no need to make changes when it is ultimately installed. The low to high (L/H) voltage condition will be the most common, as in our example of switching an intercooler spray when the air-flow signal rises above a particular point, say 4V. Below 4V, the spray is off and above 4V, the spray comes on. So ideally, you need to know which configuration you want before starting assembly. That way, you will know how to set the position of the link on the board and the orientation of diode D3. On the other hand, if you do build and later decide to change the application, it is a simple matter of changing the link setting and the orientation of D3. So for a rising voltage detection, the moveable link LK1 is placed in the “L/H” position, as shown in the component overlay diagram of Fig.2. Then diode D3 is orientated so that its cathode band is closest to the top of the board. For the opposite condition, detection of a falling voltage, the link is moved to its “H/L” position and the diode’s orientation is reversed. When assembling the PC board we siliconchip.com.au D1 1N4004 + 100 µF 10 µF 1k + L/H LK1H/L L/ H Q1 + CN NC } } RELAY CONTACTS 1 6 0ra c 5 0 1 CN 22k C COM A The placement of the link and the orientation of diode D3 (both circled here) will depend on whether you want to activate the switch on a rising voltage or a falling voltage. As shown here, the unit is configured to trigger on a rising voltage, which is the most common requirement. To trigger on a falling voltage, reverse the orientation of diode D3 and move the link to the H/L position. ON NO 100 µF H/L K 10k 1M 100nF ZD2 niV Vin COM NC 1 10 µF 1M K 1M NO RELAY CONTACTS 2 A LED1 IC1 LM358 + 1N 4148 ZD1 A K 10k K 10k GND D3* MAX 10k REG1 7808 VR2 1.8k MIN K D2 1N4004 10Ω +12V A VR1 1k C ON H CTI WS E GATL OV K 1N4148 A RELAY 1 A BC337 * REVERSE D3 IF LK1 IS IN 'H/L' POSITION Fig.1: install the parts on the PC board as shown on this layout diagram. Don’t forget to reverse D3 if LK1 is placed in the H/L position, ie, if you want the unit to trigger on a falling voltage instead of a rising voltage. suggest that you start with the resistors and diodes and then progress to the larger components. Carefully check each component value before you install it and make sure that you insert the polarised components (diodes, IC, LED, transistor, voltage regulator and electrolytic capacitors) with the correct polarity. Testing it Test the kit at your workbench (or kitchen table) to make sure that it is working, as it should. Do not be tempted to install it straight into your car or other application before you know that it is definitely working properly. You will need a 12V battery or DC power supply and a variable voltage, to simulate the sensor output that the unit will be monitoring. The easiest way to do this is as is shown in the photo on page 76 – it’s just a matter of connecting a pot (eg, 10kΩ or more) across the supply, to give a 0-12V variable voltage at the wiper terminal. Connect the DC supply and a potentiometer, as shown in the photo. Now rotate the potentiometer back to forth over its full range. At some point as you are rotating the potentiometer, the relay should click and LED1 should turn on or off. Rotating the potentiometer back the other way should again make the relay click and switch LED1 back off. siliconchip.com.au Fig.2: here is a typical set-up. The Simple Voltage Switch is connected to an ignition-switched +12V supply rail and to chassis, while the signal input is wired to the air-flow meter’s output signal. One of the relay’s normally open (NO) connections is also connected to the ignitionswitched +12V rail, while the adjacent common terminal is connected to an intercooler water spray pump. The other side of the pump is earthed. When the engine load exceeds a preset level, the water spray will be triggered into action. This view shows the fully-assembled PC board. Make sure that you install the polarised components the correct way around. December 2008  75 An easy way to bench test the Simple Voltage Switch is to temporarily wire a 10kΩ (or higher) pot across the power supply to provide a variable signal voltage. An adjustable 0-12V will be available on the centre terminal of the pot. Here, the blue wire connects this variable voltage to the signal input of the Simple Voltage Switch. Connect the +12V and earth terminals to the red and black wires respectively and you can easily test the operation of the device. Using a multimeter, measure the voltage at the signal input (ie, connect the positive probe of the multimeter to the signal wire and the negative probe to earth) and measure the voltage at which the unit is activating the relay. For example, with the unit arranged to read rising voltages, as you gradually raise the input voltage the unit might turn on at 6.00V. Now very slowly reduce the voltage to see at what point the relay turns off. You might find that the latter voltage is 5.7V, meaning that the hysteresis (the difference between the switchon and switch-off voltages) is 0.3V. Rotate VR2, the hysteresis pot, to make sure that the hysteresis changes. For example, with a switch-on voltage of 5.00V the switch-off voltage might now be only 4.96V; but a hysteresis of just 0.04V is making it too critical! As you rotate VR2 clockwise, the hysteresis will increase. Note that changing the hysteresis will not change the trip point, allowing the two to be set individually. Next, you can test VR1, which sets the trip point. As you turn VR1 clockwise, the trip voltage will increase. VR1 is a multi-turn trimpot, so that the trip point can be set very precisely. Note that you can keep on turning this type of trimpot endlessly and never reach a clear “stop”. Installation Fitting the unit to a car is straightforward. You will need to provide an ignition-switched +12V supply, earth (chassis) and the connection to the 76  Silicon Chip sensor signal you want to monitor. For example, if you are triggering the unit from the air-flow meter, you’ll need to use the workshop manual and a multimeter to find this wire. You will need to confirm that it has a voltage on it that rises with engine load and you will need to drive the car to do this. The device to be switched by the relay will be connected to the Normally Open and Common relay contacts. Fig.2 shows these connections. Note that because a double-pole, double-throw (DPDT) relay has been used, another independent circuit can be switched simultaneously. This other circuit can even turn off the second device as the first is switched on. If you want to simply monitor a voltage such as that from the oxygen sensor, you can delete the relay and mount the LED on the dashboard. In this way, the LED will come on when the fuel mixture is rich, flash when the mixture is oscillating in closed loop mode, and turn off when the mixture is lean. Setting it up There are two ways of setting up the Simple Voltage Switch: (1) Measure the sensor voltage and then set up the unit on the bench to operate at this voltage. This will probably avoid any need for fine-tuning in the car. (2) Do the complete set-up on the car itself. If you are using an oxygen sensor to trip the unit, then the first way is better. For example, if you want the unit to trip when the sensor signal rises above 0.6V, then set it up on the bench to do this. When you subsequently install the unit in the car, you will only need to make a small adjustment to VR1. However, if you want to turn on a device when monitoring the air-flow meter, it’s best to do it on the car, because the air-flow meter signal varies over a much wider range. When setting up, set the hysteresis pot to its minimum setting (ie, fully anticlockwise) and then adjust the trip point until the unit triggers when you want it to. If the relay tends to chatter around the trip point, rotate VR2 clockwise to increase the hysteresis. When it is tripping at the correct voltage, check how long the device continues to operate as the voltage again drops (assuming the unit is set to trip on a rising voltage). For example, if you are using the unit to trip an intercooler water spray on the basis of air-flow output, does the spray go off fairly quickly as the load again drops? In some applications, the hysteresis setting will be critical while in other applications it won’t matter much at all. In most cases, once the unit has been set up, it won’t need to be altered. The PC board fits into a standard 130 x 68 x 42mm jiffy box, so when the system is working correctly the board can be fitted into the box and installed under the dash or wherever SC it is convenient. Footnote: a kit for this project is available from Jaycar Electronics, Cat. KC5377. siliconchip.com.au