Silicon ChipEmergency 12V Lighting Controller - January 2008 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Electrical energy will cost more in the future
  4. Review: Denon DCD-700AE Compact Disk Player by Leo Simpson
  5. Project: PIC-Controlled Swimming Pool Alarm by John Clarke
  6. Feature: PICAXE VSM: The PICAXE Circuit Simulator! by Clive Seager
  7. Project: Emergency 12V Lighting Controller by Jim Rowe
  8. Project: Build The “Aussie-3” Valve AM Radio by Keith Walters
  9. Project: The Minispot 455kHz Modulated Oscillator by Mauro Grassi
  10. Project: Water Tank Level Meter, Pt.3: The Base Station by John Clarke
  11. Project: Improving The Water Tank Level Meter Pressure Sensor by John Clarke
  12. Vintage Radio: The simple Aristone M1 4-valve mantel receiver by Rodney Champness
  13. Book Store

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

You can view 33 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 "PIC-Controlled Swimming Pool Alarm":
  • Swimming Pool Alarm PCB [03101081] (AUD $10.00)
  • PIC16F88-I/P programmed for the Pool Alarm (Programmed Microcontroller, AUD $15.00)
  • PIC16F88 firmware and source code for the Swimming Pool Alarm [Pool Alarm.HEX] (Software, Free)
  • Pool Aparm PCB pattern (PDF download) [03101081] (Free)
  • Swimming Pool Alarm front panel artwork (PDF download) (Free)
Articles in this series:
  • PICAXE VSM: The PICAXE Circuit Simulator! (January 2008)
  • PICAXE VSM: The PICAXE Circuit Simulator! (January 2008)
  • PICAXE VSM: The PICAXE Circuit Simulator, Pt.2 (February 2008)
  • PICAXE VSM: The PICAXE Circuit Simulator, Pt.2 (February 2008)
  • PICAXE VSM: It’s Time to Play; Pt.3 (March 2008)
  • PICAXE VSM: It’s Time to Play; Pt.3 (March 2008)
Items relevant to "The Minispot 455kHz Modulated Oscillator":
  • Minispot Oscillator PCB [06101081] (AUD $5.00)
  • MiniSpot 455MHz Modulated Oscillator PCB pattern (PDF download) [06101081] (Free)
Items relevant to "Water Tank Level Meter, Pt.3: The Base Station":
  • PIC16F88-I/P programmed for the Water Tank Level Meter telemetry base station (Programmed Microcontroller, AUD $15.00)
  • PIC16F88-I/P programmed for the Water Tank Level Meter main/transmitter unit (Programmed Microcontroller, AUD $15.00)
  • PIC16F88 firmware and source code for the Water Tank Level Meter receiver [water tank level receiver.HEX] (Software, Free)
  • PIC16F88 firmware and source code for the Water Tank Level Meter transmitter (Software, Free)
  • Water Tank Level Meter base station PCB patterns (PDF download) [04101081/2] (Free)
  • Water Tank Level Meter main PCB pattern (PDF download) [04111071] (Free)
  • Water Tank Level Meter base station front panel artwork (PDF download) (Free)
  • Water Tank Level Meter main sensor/transmitter unit front panel artwork (PDF download) (Free)
Articles in this series:
  • PIC-Based Water-Tank Level Meter; Pt.1 (November 2007)
  • PIC-Based Water-Tank Level Meter; Pt.1 (November 2007)
  • PIC-Based Water-Tank Level Meter; Pt.2 (December 2007)
  • PIC-Based Water-Tank Level Meter; Pt.2 (December 2007)
  • Water Tank Level Meter, Pt.3: The Base Station (January 2008)
  • Water Tank Level Meter, Pt.3: The Base Station (January 2008)

Purchase a printed copy of this issue for $10.00.

By JIM ROWE Emergency 12V Lighting Controller This easy-to-build project automatically turns on the power for 12V emergency lights within a second or two of a mains power failure. Build it and you won’t have to search for candles or your torch in the event of a blackout. W HAT HAPPENS AT your place if there’s a sudden “blackout” or mains power failure? It’s a familiar story – if it’s at night, you’re left floundering in the darkness, searching for some candles or your torch. And if you do find the torch, it’s more than likely that the batteries have gone flat. This project means that you should never have to search around in the darkness during a blackout again. As soon as the mains power fails, it automatically turns on the power for some 12V emergency lights within a second or two. It then keeps them operating until either the mains power is restored or its internal 12V sealed 32  Silicon Chip lead-acid (SLA) battery is discharged to the safe minimum level. Basically, the project is designed to be used in conjunction with a small 12V/1A automatic SLA battery charger, such as the Powertech MB-3526 unit sold by Jaycar stores and dealers. This unit normally keeps the internal SLA battery at full charge and we use this project to monitor the charging voltage so that it can determine when there is a mains failure. That’s how it knows when to switch on your 12V emergency lights. Running time The 12V SLA battery specified has a rated capacity of 7.2Ah (amperehours), which should be enough to power typical domestic 12V emergency lights for the duration of all but the most prolonged mains failures. For example, it will power a couple of 12V/16W (twin 8W tubes) fluoro fittings like the Jaycar ST-3016 for around two hours or for a little over one hour if you hook up a 12V/11W single fluoro as well. How can you work out the time it will run a certain combination of 12V emergency lights? As a rough guide, you need to work out how much current each light fitting draws, then add up the total current. Then if you divide the battery capacity by this total current, the answer will be the approximate running time in hours. The reason why this gives only a rough guide to running time is that the nominal capacity of a battery is based on it being discharged over a 20-hour period – ie, at a discharge current rate of C/20, where “C” is the battery’s siliconchip.com.au drops to 5.95Ah. And if you want to discharge it in just one hour, its effective capacity drops to 4.0Ah. So if you want to run say three of the ST-3016 12V/16W fluoro fittings, which each draw around 1.35A, this will result in a total current of 3 x 1.35A = 4.05A. The battery will be able to run these for 4.0/4.05, or just a whisker under one hour. Similarly, you could run, say, four 12V/11W fluoro fittings which each draw about 0.9A (giving a total current of 4 x 0.9 = 3.6A) for a little over an hour (4.0/3.6 = 1.11). In either case, if you just run one lamp, it will probably run for a few hours. A manual over-ride switch is included so that you can turn off the 12V lights manually if they’re not needed – for example, if there’s a blackout during the day. How it works nominal capacity (in this case 7.2Ah, so C/20 = 360mA). When you discharge the battery at a higher rate than this, its effective capacity drops somewhat. For example, if you reduce the discharge time to 10 hours, its effective capacity drops to 6.7Ah. If you want to discharge it in five hours, the effective capacity Refer now to Fig.1 for the circuit details. As you can see, there’s not a lot to it. At its heart is the 12V/7.2Ah SLA battery, which is maintained at full charge by the external automatic charger when mains power is present. The charging current flows through D1 and directly into the battery. Note that D1 is a 1N5822 Schottky diode, which has a low forward voltage drop (typically 390mV for a charging current of 1A), so it doesn’t significantly effect the charger’s operation. The DC input voltage from the charger is also applied to LED1 via a series 1.5kW resistor, with the LED current also flowing through the baseemitter junction of transistor Q1. As a result LED1 turns on whenever mains power is present and Q1 is forward biased as well. This causes Q1 to turn on and pull its collector voltage down to a low level (around 400mV). The collector of Q1 is connected to the reset input (pin 4) of IC1, a 555 timer IC used here as a dual comparator and flipflop. So while ever mains power is present and Q1 is on, IC1 is held in its reset state with its pin 3 output switched low. As a result, the gate of Q4, an N-channel power Mosfet, is also held low also and so Q4 remains off. Basically, Q4 functions as the switch for the 12V emergency lights. When Q4 is off, the lights are off as well. Now consider what happens when the mains power fails. When this happens, there is no charging voltage from the SLA charger and so D1 becomes reverse biased. As a result, LED1 turns off and there is no longer any base current for Q1 which turns off as well. Fig.1: the circuit uses transistors Q1 & Q2 and 555 timer IC1 to detect when the mains fails. When it does, pin 3 of IC1 switches high and Q4 turns on and connects an SLA battery to the emergency lights. Zener diode ZD1 and transistor Q3 trigger IC1 and turn the lights off again to prevent over-discharge if the battery voltage drops below 11.6V. siliconchip.com.au January 2008  33 The Powertech 12V 1A SLA battery charger (Jaycar MB-3526) is ideal for use with the Lighting Controller. Q1’s collector is now pulled high (ie, to the battery voltage) via a 10kW resistor, thus removing the reset signal from IC1. At the same time, the 2.2mF capacitor on the reset line pulls the base of transistor Q2 high. Q2 thus turns on and pulls pin 3 (the “lower threshold” comparator input) of IC1 low. The 2.2mF capacitor now charges via a 10kW resistor and as it does so, its charging current (and hence Q2’s base current) reduces exponentially. After a very short time, the transistor comes out of saturation and its collector voltage begins to rise. As soon as this voltage reaches the lower threshold level of IC1 (around 4V), the internal flipflop is triggered “on”. This switches IC1’s pin 3 output high (ie, to nearly +12V), in turn switching on Q4 and turning on the emergency lights and LED2. A 1.2kW resistor limits the current through LED2. In summary then, when the mains power fails, IC1 quickly switches its pin 3 output high and Q4 and the emergency lights turn on. If necessary, the lights can be turned off manually or prevented from turning on automatically at all, using override switch S1. When this is closed, IC1’s pin 4 reset input is pulled low permanently, regardless as to whether transistor Q1 is conducting or not. As a result IC1 is kept in the reset state and so Q4 and the emergency lights remain off. Preventing over-discharge Zener diode ZD1 and transistor Q3 form a simple protection circuit which prevents the SLA battery from being over-discharged during a prolonged blackout. SLA batteries are not designed for really deep discharging and if that did occur, the battery could suffer permanent damage. The way this circuit works is very simple. While ever the battery voltage remains above about 11.6V, zener diode ZD1 conducts and so current flows through its 3.9kW series resistor and the base-emitter junction of transistor Q3. As a result Q3, turns on and pulls pin 6 (the upper threshold input of IC1) to less than 0.5V. This input is therefore kept inactive. However, if the SLA battery voltage drops just below 11.6V, there is no longer sufficient current through ZD1 to keep Q3 turned on. As a result, Q3 turns off and its collector voltage rises to the battery voltage, taking pin 6 of IC1 with it. As soon pin 6 reaches its upper threshold level of about 8V (12V x 2/3), IC1’s internal flipflop resets and pin 3 switches low. This turns off Q4 and the emergency lights to prevent any further discharging of the battery. IC1 is now kept in the reset state until the battery voltage rises above 11.6V again, which will normally only happen when the mains power is restored. Of course, once this occurs, Q1 will turn on again and hold IC1 in the reset state, thereby preventing Q4 and the lights from turning on until the mains fails on another occasion. Construction Apart from the SLA battery, all of the parts for the Emergency 12V Lighting Controller are installed on a single PC board coded EC8274 and measuring 204 x 64mm. This board has been designed to mount vertically behind the front panel of a vented plastic instrument case measuring 260 x 190 x 80mm (Jaycar Cat.HB-5910). This case size was chosen so that the SLA battery could also be fitted inside, to protect it from damage. As shown in the photos, the battery is fitted on its side at the rear of the case and is held down by a clamp bracket made from sheet aluminium. The output cable from the external SLA charger is brought into the case at rear left, via a cable gland. The individual leads then connect to the rear of the PC board via quick-connect spade connectors. Similarly, the connections between the SLA battery and the PC Resistor Colour Codes o o o o o o No. 6 1 1 1 1 34  Silicon Chip Value 10kW 3.9kW 1.5kW 1.2kW 100W 4-Band Code (1%) brown black orange brown orange white red brown brown green red brown brown red red brown brown black brown brown 5-Band Code (1%) brown black black red brown orange white black brown brown brown green black brown brown brown red black brown brown brown black black black brown siliconchip.com.au board are made via short lengths of heavy-duty cable, fitted with female quick-connect spade connectors at each end. The six 12V output terminals (binding posts) for the emergency lights (or siliconchip.com.au some other load) are actually initially mounted on the front panel of the case rather than the PC board. Their terminals are then later soldered directly to the PC board copper when the otherwise completed PC board assembly is attached to the panel via six M3 x 15mm tapped spacers. Fig.2 shows the parts layout on the PC board. The first step in the assembly is to fit the three male spade lug connectors for the charger and battery January 2008  35 Take care to ensure that all polarised parts (IC, transistors, diodes, LEDs and the tantalum capacitor) are correctly orientated when building the board. The three spade quick-connect terminal lugs (two single-ended, one double-ended) are bolted to the back of the board using M3 x 6mm machine screws, lockwashers and nuts. Note that we used thermal grease to aid heat transfer between Q4’s tab and its heatsink but kits will be supplied with a thermal washer instead. Fig.2: install the parts on the PC board as shown here but do not initially install the six binding post terminals. The latter are mounted on the front panel first and are only soldered to the PC board after testing is complete – see text. Note that Mosfet Q4 has two heatsinks – one under its tab on the top of the board and one directly behind it on the copper side of the board. Parts List 1 vented instrument case, 260 x 190 x 80mm (Jaycar HB5910) 1 PC board, code EC8274, 204 x 64mm 2 19 x 19mm U-shaped TO-220 heatsinks 1 TO-220 thermal washer 1 SPDT mini toggle switch (S1) 1 8-pin IC socket 2 single-ended quick-connect spade lugs 1 double-ended quick-connect spade lug 6 female quick-connect spade connectors 6 M3 x 15mm tapped spacers 6 M3 x 6mm countersink head machine screws 10 M3 x 6mm pan-head machine screws 4 M3 nuts and star lockwashers 3 binding posts/banana jack terminals, red 3 binding posts/banana jack terminals, black 1 12V 7.2Ah SLA battery (Jaycar SB-2486) 1 295 x 75mm piece of 18g (1.3mm) aluminium sheet 3 10mm long self-tapping screws, 4g or 5g 1 cable gland, 3-6.5mm cable size Semiconductors 1 555 timer IC (IC1) connections. These all fit on the rear (copper) side of the board and are fastened in place using M3 x 6mm machine screws, star lockwashers and nuts. These must be tightened quite firmly to ensure a reliable connection (you will need a Posidrive screwdriver and a small shifting spanner to hold the nut). Note that the two single spade lugs are fitted in the upper positions (Charger+ and Battery+), while the double spade lug is fitted in the lower (Charger-/Battery-) position. Once all three spade lugs have been fitted, you can fit the socket for IC1 (with its notch end towards the left), followed by mini toggle switch S1. The switch mounts vertically, with its connection lugs passing down through matching holes in the board 36  Silicon Chip 3 PN100 NPN transistors (Q1, Q2, Q3) 1 STP16NF06 N-channel 60V/16A Mosfet (Q4) 1 1N4741A 11V 1W zener diode (ZD1) 1 5mm green LED (LED1) 1 5mm red LED (LED2) 1 1N5822 40V/3A Schottky diode (D1) 1 1N4148 diode (D2) Capacitors 1 2.2mF tantalum 1 10nF metallised polyester Resistors (0.25W 1%) 6 10kW 1 1.2kW 1 3.9kW 1 100W 1 1.5kW Where To Buy Kits This project was developed by Jaycar Electronics and they hold the copyright on the design and on the PC board. Complete kits will be available from Jaycar Electronics stores and resellers (Cat. KC5456) shortly after publication. In addition, Jaycar can supply the Powertech MB-3526 automatic SLA charger, along with whatever 12V lighting fixtures you need; eg, the ST-3016 and ST-3006 fluorescent lamps (both rated at 16W). and soldered to the pads underneath. The resistors can go in next, followed by the capacitors, diodes D1-D3 and transistors Q1-Q3. Take care to fit the diodes, transistors and 2.2mF tantalum capacitor with the correct orientation. Mounting the Mosfet Mosfet Q4 is next on the list but first its leads must be bent down through 90° at a point 7mm from its body. That done, it can be fastened to the PC board along with its thermal washer and two heatsinks. Secure it using an M3 x 6mm machine screw, flat washer and nut. As shown in Fig.2, the thermal washer goes between Q4’s tab and the heatsink on the top of the board. The second heatsink mounts on the back of the PC board (see photo). Make sure that the latter does not short against any of Q4’s pads when the assembly is tightened down. Now complete the board assembly by installing the two 5mm LEDs. These mount vertically, with their longer anode leads towards the top of the board. They should both be fitted with 12mm lead lengths, so that they will later just protrude through matching holes in the front panel when the board is mounted in the case. A 12mm-wide cardboard strip can be used as a spacer when it comes to mounting each LED. Just position it with its bottom edge against the board and push the LED down onto the top edge, with the leads straddling either side of the cardboard spacer. Once the LEDs are in place, fit the six M3 tapped spacers to the front of the board and secure them using six M3 x 6mm pan head machine screws. Final assembly The board assembly is now complete so the next step is to fit the six binding post terminals into their matching holes in the front panel. The three red positive terminals mount in the upper holes, while the black negative terminals mount in the lower holes. Be sure to tighten up their mounting nuts firmly, so that they don’t work loose later. That done, remove the upper mounting nut from mini toggle switch S1, then offer up the PC board assembly behind the front panel, with the threaded ferrule of S1 and the two LEDs passing through their corresponding holes. At the same time, the solder terminals on the binding post sockets should pass through their corresponding holes in the PC board. Once everything is correct, fasten the assembly together using six M3 x 6mm countersink-head screws. Tighten these screws down firmly, then refit the outer mounting nut to the front of S1, screwing it down just firmly enough to prevent it from coming loose. A small spanner should then be used to wind the rear nut (and washers) up the ferrule to the rear of the panel, to prevent the panel from bowing down when the front nut is tightened. Do not solder the terminals of the binding posts yet. That step comes later, after the unit has been tested. If you do solder these terminals, you siliconchip.com.au This is the view inside the completed Emergency 12V Lighting Controller. The battery in the prototype was secured using an aluminium clamp but kit versions will come with large cable ties to secure the battery. will not be able to access any of the on-board components if something is wrong. The board/panel assembly can be slipped into the lower half of the case – see photo. That done, you can then turn your attention to making up the mounting clamp bracket for the SLA battery. This is fashioned from the piece of sheet aluminium provided – see Fig.4. Note that three 4mm diameter holes need to be drilled in the bracket for the mounting screws; it’s easier to drill these holes before you bend it into shape. Fitting the battery Before fitting the battery into the case, you’ll need to cut away some of the short spacing pillars moulded into the base, so the battery will rest on siliconchip.com.au Fig.3: the leads from the battery and the charger are connected to the spade lugs on the back of the PC board using female quick-connect terminals. Note also how switch S1 is secured. the bottom (this is necessary in order to provide clearance for the case top). The pillars to be cut away are those in the centre, directly below where the battery sits. Make sure you don’t cut away those at either end, which are January 2008  37 The PC board mounts behind the front panel on six M3 x 15mm tapped spacers, secured at the front using countersink head M3 screws. Note how the charger’s leads are secured to the rear panel using a cable gland. This close-up view shows how the connections from the charger and the SLA battery are run to the PC board, via the quick-connect terminals. Note also the U-shaped heatsink on the back of the board. used to screw down the battery clamp bracket – see photos. You should now be able to place the battery on its side in the case and 38  Silicon Chip slide the clamp bracket down over it. Complete the job by fastening the clamp bracket to the bottom of the case bottom using three 10mm-long self-tapping screws. The next step is to fit the cable gland into the 12.5mm round hole in the rear panel. That done, cut the alligator clips off the ends of the SLA charger’s output leads, then pass the leads through the gland and into the case. They can then be fitted with the female quickconnect spade connectors and fitted to the Charger+ and Charger- lugs on the rear of the PC board – see Fig.3. Take care with the polarity of the leads here. As previously mentioned, the SLA battery is connected to the PC board via short lengths of heavy-duty cable, fitted with female quick-connect spade connectors at each end. Complete the wiring by fitting these, again making sure that the connections are correct. Note that if you reverse the battery connections, there may be quite a lot of damage done and a significant amount of smoke released! You have been warned. Checking it out First, lightly tack solder a couple of temporary leads to one pair of output pads on the back of the board (ie, one to a positive output terminal and the other to a negative output terminal). Connect the other ends of these leads to your multimeter and set the meter to the 20V range. Now plug the SLA charger’s mains lead into power outlet and switch on. This should cause the Lighting Controller’s green “Power” LED (LED1) to light, indicating that the charger is supplying power to the circuit and to the SLA battery. If the SLA battery has very little charge in it at this stage, this will be indicated by the charger’s red LED glowing. In that case, leave things for a while until the battery charges, with its terminal voltage up to at least 12.5V. This will be indicated by the red LED on the charger going out and the green “trickle” LED turning on instead. Now make sure that switch S1 is in the “Lights On” (down) position, then switch the charger off at the mains outlet. Within no more than a second or two, LED1 on the Lighting Controller should go out and LED2 should light instead. This indicates that Mosfet Q4 has turned on and that 12V power siliconchip.com.au Fig.4: here’s how to make up the metal clamp that’s used to secure the SLA battery in the case. It’s made from 18-gauge aluminium sheet and can be bent up in a vice. (Note: the Jaycar kits will come with cable ties to secure the battery). from the battery in now available via the output terminals (this should be indicated on your multimeter). In fact, if you connect a 12V emergency light in place of the meter, it should immediately light. Assuming it all works, switch off, remove the temporary leads and solder all six binding post terminals. Your Emergency 12V Lighting Controller is now ready for use, so fit the top of the case and fasten it down using the two machine screws supplied. Once that’s done, switch the charger back on so that it can complete the job of topping up the battery’s charge. While it’s doing that, you can now start mounting your 12V emergency lights and running the cabling to them. Be sure to mount the lights in locations where they will be useful when the SC next blackout occurs. siliconchip.com.au The Emergency Lighting Controller is ideal for use with 12V fluorescent lamp fittings of the type shown here. Both these units are available from Jaycar Electronics (ST-3006 top, ST-3016 bottom), feature twin fluorescent tubes and are rated at 16W. January 2008  39