Silicon ChipRoomGuard: A Low-Cost Intruder Alarm - April 2000 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Internet companies an unknown quantity
  4. Review: Jamo Concert 8 Loudspeaker System by Louis Challis
  5. Feature: How To Run A 3-Phase Induction Motor From 240VAC by Peter Laughton
  6. Project: A Digital Tachometer For Your Car by John Clarke
  7. Project: RoomGuard: A Low-Cost Intruder Alarm by John Clarke
  8. Back Issues
  9. Project: Build A Hot Wire Cutter by Leo Simpson
  10. Order Form
  11. Feature: Atmel's ICE 200 In-Circuit Emulator by Peter Smith
  12. Product Showcase
  13. Project: The OzTrip Car Computer; Pt.2 by Robert Priestley
  14. Project: Build A Temperature Logger by Mark Roberts
  15. Review: Mitsubishi's Diamond View DV180 LCD Monitor by Peter Smith
  16. Book Store
  17. Market Centre
  18. Outer Back Cover

This is only a preview of the April 2000 issue of Silicon Chip.

You can view 33 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 "A Digital Tachometer For Your Car":
  • PIC16F84(A)-04/P programmed for the Digital Tachometer [TACHO.HEX] (Programmed Microcontroller, AUD $10.00)
  • PIC16F84 firmware and source code for the Digital Tachometer [TACHO.HEX] (Software, Free)
  • Digital Tachometer PCB patterns (PDF download) [05104001/05104002] (Free)
  • Digital Tachometer panel artwork (PDF download) (Free)
Items relevant to "RoomGuard: A Low-Cost Intruder Alarm":
  • RoomGuard PCB pattern (PDF download) [03104001] (Free)
  • RoomGuard panel artwork (PDF download) (Free)
Articles in this series:
  • The OzTrip Car Computer; Pt.1 (March 2000)
  • The OzTrip Car Computer; Pt.1 (March 2000)
  • The OzTrip Car Computer; Pt.2 (April 2000)
  • The OzTrip Car Computer; Pt.2 (April 2000)
How to Protect Life AND Property: ROOMGUARD Smoke alarms are very common nowadays – in fact, in many states they’re required by law in all new homes. But why have just a smoke alarm? Here’s how to make one do double duty as an effective but low cost intruder alarm. by JOHN CLARKE F ITTING A SMOKE ALARM makes a lot of sense. For not much more than $10 – including a battery – they offer peace-of-mind and security, especially while the family sleeps. Typically though, the one place they are not normally fitted is the one place they should be – in bedrooms. That extra few minutes (or even seconds) of warning time could literally be the difference between life and death. But smoke detectors in bedrooms, especially teenage kid’s bedrooms, aren’t cool. They don’t want ’em! What they really want is something to keep little brother or sister out while they’re not home. The “keep out” sign on the door doesn’t work real well, even if it does threaten some exotic disease to anyone entering except the occupant. Where is all this leading? Well, how do you think they’d like an alarm system which will keep a sibling at bay? It just happens to look like a smoke detector and yes, it will shriek its head off if there is smoke in the room 28  Silicon Chip (darn! now they can’t smoke in their bedrooms...). Well, here it is. The SILICON CHIP ROOMGUARD looks and works just like a typical smoke detector – mostly because it is a typical smoke detector with its normal action completely unchanged! But it’s much more. By wiring in a suitable control circuit (and even pinching power from the detector’s 9V battery) we can make the detector sound an alarm when triggered by virtually any alarm detection device – switches on the doors or windows, pressure mats outside the door, light beam relays, even passive infrared (PIR) movement sensors and so on. But more on these devices anon. The features available on low-cost smoke alarms include a loud siren, a test input to sound the alarm, a low battery warning and of course a battery supply. These are all used as the main alarm section for the Room­Guard. Connections to the smoke alarm are deliberately kept very simple. Take one low-cost battery-operated smoke detector, add a little extra circuitry and an intruder detection device or two . . . and you have a low cost, battery-operated smoke detector which screams its head off when there’s smoke or intruders. It’s simple to build, too! They include the battery connections mentioned above and just two other connections which go to the “test” button. Normally this button is simply used to sound the alarm and so check the battery. We bridge it out to sound the alarm to indicate an intruder. What we have added to the smoke alarm to make up the RoomGuard system are two instant alarm inputs, a delayed input, an exit delay and an arm/disarm switch. The instant inputs make the smoke alarm sound immediately while the delayed input gives you time to get in and turn off the alarm side before the smoke alarm sounds. Alarm sensors are usually one of two types: at rest they are open circuit and they close when tripped or triggered – this is the normally open (NO) variety. The opposite, normally closed or NC type, is normally a short circuit which opens when triggered. The inputs to this alarm can be either normally open (NO) or normally closed (NC) types and more than one can be used per input if connected in parallel or series respectively. You cannot mix NO and NC types together on one input but you can have NO sensors on one input and NC sensors on the other input circuit. The intruder circuit has been designed to minimise current consumption so as to conserve the smoke alarm battery as much as possible. Actual life of the battery will depend on the amount of use the RoomGuard is given. It typically draws 250µA when armed and zero current when disarmed. A 1Ah (1000mAh) alkaline battery will provide a nominal 5.5 months of continuous use. In practice, if the RoomGuard is armed for 12 hours per day you could expect the battery to provide over eight months of use, including the consumption of the smoke alarm itself. This is significantly longer than the recommended time for batteries in smoke alarms: fire authorities say they should be changed every time you change your clocks for daylight saving (ie, roughly every six months). What readers in states without daylight saving do we’re not sure! The RoomGuard circuit is housed in a small plastic case which can be mounted anywhere practical: inside a cupboard, behind a bedhead, in fact, in any “hidden” location. The wires from the RoomGuard to the smoke alarm need to be hidden as much as possible – ideally, they should be taken up the wall and into the ceiling cavity. The wires could then be brought out to the smoke alarm unit (which is normally mounted on the ceiling). Wires to the sensor inputs could run down the wall to the floor and then under the floor to the sensor switches – or perhaps these could also run through the ceiling cavity, especially if they went to devices such as PIR detectors. Anyway, we’re getting a little ahead of ourselves. Let’s look at how the system works. The block diagram (Fig.1) shows the general arrangement of the Room­ April 2000  29 Fig.1: follow this block diagram and the text – and you should have no trouble working out just what the RoomGuard does. Guard alarm. It consists of three sensor inputs and three timers – a delay timer for one of the inputs, an exit delay timer and an “alarm on” timer which keeps the alarm sounding even if the input sensor is quickly returned to its normal state. The two instant alarm inputs (IC1a and IC1b) directly trigger the alarmon timer (IC2) immediately while the delayed input (IC1c) activates the delay timer which triggers the alarm-on timer after about 25 seconds. When activated, the alarm-on timer drives an optocoupler which is used to short out the “Test” switch on the smoke alarm to sound the siren. The arm/disarm switch (S1) incorporates an exit delay so that the RoomGuard is initially disabled for a short time (about 24 seconds) to allow exit from the room; this stops the sensors from having any effect even if they are triggered. After this delay the RoomGuard becomes fully active. A bi-colour LED (LED1) shows the two states – disabled and armed. The delay circuits do not affect the smoke alarm operation in any way – if there was a fire in that 24 seconds (or any time thereafter) the smoke detector would scream its head off! Of course the siren is shared between the smoke alarm and the Room­ Guard and so when the siren sounds, you have to decide if it is an intruder or a fire that caused the alarm. Here’s a clue: fires are hotter than intruders and have lots of smoke. The circuit for the RoomGuard is shown in Fig.2. It uses just four lowcost ICs, several resistors, capacitors and diodes, a switch and the bi-coloured LED. IC1 contains four exclusive-OR gates. The output of these gates (eg, pin 4) is only high whenever one of its inputs (eg, pin 5 and 6) is at a different logic level to the other. So if pin 5 goes high before pin 6, we get a short-duration high output. If pin 6 reaches the same logic level (its upper threshold voltage), the output then goes low. Both instant inputs work the same way, so we will concentrate on Input 1. It can operate with either normally open (NO) or normally (NC) contacts in the sensors. If the contact is initially closed both inputs to IC1a are low and the output is low. When the switch opens, the 0.22µF capacitor and 1µF capacitor both start to charge to the positive supply voltage via the 1MΩ resistor. But the smaller 0.22µF capacitor charges faster than Inside the RoomGuard controller box. Everything is mounted on a single PC board with connections to both the smoke detector (left side) and alarm sensor devices (right side) via on-board terminal blocks. At this stage no sensors were fitted. 30  Silicon Chip the 1µF capacitor and so pin 5 reaches its upper threshold before pin 6. Therefore the output (pin 4) goes high. Should the switch close again, pin 5 will be low but pin 6 will stay high until the 1µF capacitor discharges via the 100kΩ resistor. Thus we get a high output when the switch closes. Note that for this type of circuit to work we must have the delay from the 1µF input longer than the delay for the 0.22µF input. The time constant (the time it takes for the capacitor to charge to 63% of the applied voltage) is set at 0.22 seconds for the 0.22µF capacitor (time constant T = R x C where R is in ohms and C is in Farads – or 1,000,000 x .00000022) when the switch opens. Similarly, the 1µF capacitor time constant is 1.1 seconds when the switch opens ([1,000,000 + 100,000] x .000001). When the switch closes, the 0.22µF input goes low virtually instantly, while the 1µF capacitor must discharge via the 100kΩ resistor, giving a time constant of 100ms. A reverse operation occurs if the sensors have normally open contacts. Both gate inputs are held high by the charged capacitors but if the sensor contacts close, pin 5 goes low immediately while the capacitor at pin 6 must discharge through the 100kΩ resistor. Therefore the gate output goes high. The outputs of IC1a or IC1b drive gate IC1d via diode D1 and/or D2. IC1d is set up as a buffer so when pin 9 goes high, so does pin 10. When this happens, pin 10 charges the 0.15µF capacitor to the 9V supply rail. When pin 10 goes low, pin 2 of IC2 is pulled low to trigger the alarm-on timer. The .015µF capacitor charges via the 560kΩ resistor so that the trigger input goes high after about 10ms. Diode D5 prevents the pin 2 (trigger) input from going above the 9V supply whenever pin 10 of IC1d goes high. Without D5, the trigger input to IC2 could be damaged by excessive voltage. IC2 is a 7555 connected as a mono­ stable timer. The 220µF capacitor at its threshold input (pin 6) is charged via the 560kΩ and 10kΩ resistors towards the positive supply. During the charging period, the output (pin 3) is high. After about 138 seconds, or a little over two minutes, the 220µF capacitor is charged to 2/3rds the supply voltage. Pin 3 then goes low and the 220µF capacitor is discharged via the 10kΩ resistor and pin 7. The 10kΩ resistor limits the discharge current through pin 7. IC4 is an optocoupler which contains a LED and a phototransistor. When the LED is off, the photo­ transistor is off and when the LED is on, the phototransistor is on. But there is no electrical connection between the two devices. Fig.2: there’s not a great deal to the RoomGuard because the alarm itself is actually in the smoke detector. All we need to do is sense the intruder and tell the smoke alarm’s siren to sound. Operation of the smoke detector remains unaltered. April 2000  31 3* 2* Parts List 1 battery-operated smoke detector (see text) 1 PC board, code 03303001, 62mm x 105mm 1 front panel label 127 x 63mm 1 plastic case 130 x 68 x 44mm 1 6-way PC terminals 1 4-way PC terminals 1 SPDT toggle switch, S1 1 50mm length of 0.8mm tinned copper wire 2 10mm rubber grommets 3 PC stakes Semiconductors 1 4030 quad XOR gate (IC1) 2 7555, LMC555CN, TLC555CN, CMOS 555 timer (IC2, IC3) 1 4N28 optocoupler (IC4) 6 1N4148, 1N914 switching diodes (D1-D6) 1 5mm bicolour (red/green) LED (LED1) Capacitors 1 220µF 16VW PC electrolytic 1 100µF 16VW PC electrolytic 2 47µF 16VW PC electrolytic 2 10µF 16VW PC electrolytic 3 1µF 16VW PC electrolytic 3 0.22µF MKT polyester 2 0.1µF MKT polyester 2 .015µF MKT polyester Resistors (0.25W 1%) 5 1MΩ 5 560kΩ1 470kΩ 3 100kΩ 3 10kΩ 1 1kΩ 1 470Ω Misccellaneous Suitable length 4-core cable Suitable alarm detection devices (see text and panel) 32  Silicon Chip 1* The high pin 3 output of IC2 drives the LED within IC4. This in turn switches on the internal transistor which is connected across the “test” switch in the smoke alarm. The smoke alarm is tricked into believing the test switch has been pressed – and sounds its siren. The output transistor in IC4 is fully floating with respect to the power supply, which means that it can operate the test terminals of the smoke alarm regardless of whether it is connected to switch to ground or to the positive supply. However, it is important to have the polarity correct when connecting to the test switch terminals so that the optocoupler transistor will operate. This can be easily determined with a multimeter. Entry delay Timer IC3, which is triggered by the delayed sensor circuit (IC1c), operates in a similar manner to IC2, charging a 47µF capacitor to give a nominal 24-second time period which gives you enough time to enter and turn off the (hidden!) “arm” switch, S1. Like the other input circuits, its output also triggers IC2 (the alarm-on timer), in this case via diode D4 and IC1d. The 100kΩ resistor holds pin 9 of IC1d low when the diodes are not conducting, preventing false alarms. Exit delay The exit delay is provided by holding the pin 4 reset inputs to IC2 and IC3 low for a short period. This prevents these timers from being triggered immediately after the circuit is armed. To initiate the exit delay, when S1 applies power the 100µF capacitor (C1) charges via the 1MΩ resistor Fig.3: this is the component overlay of the RoomGuard with the PC board pattern shown underneath. Use this diagram in conjunction with the photograph when assembling the PC board. toward the positive supply. When the reset inputs of IC2 and IC3 (pin 4) reach about 1V, the timers are free to operate normally. Moving S1 to off disconnects the exit delay circuit from the 9V supply and connects it to ground. This will discharge capacitor C1 via the 10kΩ resistor and D6. LED1 is included to indicate the RoomGuard status. When switched to the armed position, the red LED in the bicoloured LED1 lights briefly as the 47µF capacitor charges towards the ground supply rail via that LED and 1kΩ resistor. When the switch is moved to off, the +9V supply is removed and the green LED within LED1 lights momentarily as the 47µF capac­itor discharges through it. Note that the bicolour LED only confirms the status of the RoomGaurd as you switch it on or off. At all other times the LED is off. If you use a key operated switch instead of the toggle type, it will only have a single pole switch contact. Connect it between the common and armed positions for S1. A 1MΩ resistor will be required to discharge capacitor C2 when power is switched off. The green disarmed LED will not momentarily flash with this arrangement but the red armed LED indication will still operate. The resistor has been catered for on the PC board and is designated R1. In this case, the more expensive bicolour LED could be substituted with a standard red LED. Construction The RoomGuard is housed in a plastic case measuring 130 x 68 x 44mm. The components are mounted on a PC board coded 03303001 and measuring 62 x 105mm. Begin construction by checking the PC board for shorts between tracks and for any hairline cracks. Check that the PC board is a neat fit into the integral side clips in the case (no screws are required for mounting the PC board). The sides may need to be filed slightly so that the PC board fits easily in the case. You can begin assembly of the PC board by inserting the resistors and link. Use the accompanying resistor colour code table to assist you in selecting the correct value for each position. A digital multimeter could also be used to measure the values. Insert the diodes and ICs next, taking care with their orientation. The capacitors can be installed next. The accompanying capacitor code table shows the possible labelling for each value. The electrolytic capacitors are marked directly in µF and must be oriented with the polarity shown on the overlay diagram. Solder in PC stakes for switch S1 and the 6-way and 4-way PC terminals. LED1 is mounted so that the top of its lens is 31mm above the PC board, while switch S1 is mounted by soldering the terminals to the top of the PC stakes. Resistor R1 will only be required if you intend to use a single pole single throw (SPST) switch for S1 (for example, a key-type switch). Connect the switch between positions 1 & 3. Testing You can test the RoomGuard operation without connecting it to a smoke alarm. First, connect power between the +9V and 0V terminals using a 9V battery or power supply. (Any voltage from about 6-12V can be used without changing the circuit operation). Check that the ICs have power by measuring between the 0V terminal and the positive supply pin. This is pin 14 on IC1 and pin 8 on IC2 & IC3. Check that LED1 lights when switch S1 is toggled between on and off and note the comment earlier in the article about the LED operation if a single throw key-switch is used for S1. Connect your multimeter between the test terminal outputs with the plus side to the positive lead on the multimeter. Set the multimeter to read resistance. Switch off the alarm and then switch it to the armed position. The meter should read over 10MΩ. Try to trigger the alarm by momen- We haven’t been too specific about how to connect the RoomGuard to a Smoke Alarm because there are so many on the market. However, all have “Test” buttons to check the battery. We simply wire across this switch and to +9V and 0V. tarily shorting the GND and input 1 terminals. These are the instant terminals but do not expect anything to happen since the delayed exit timer should still be operating. Continue to short these terminals every second or so until the multi­ meter reads a low resistance value. This should occur after about 20-25 seconds. The low resistance indicates that the circuit has triggered. The multimeter reading should be about 4.7kΩ. Check that this alarm time lasts for about two minutes after which the resistance reading should again go high. Now switch the alarm off again and then on to arm the circuit. Check the second input by waiting for 25 seconds and triggering between ground and input 2. The resistance should again go low. Finally, the delayed input can be tested by waiting until the resistance goes high again and retriggering the alarm by shorting the ground and input 3 terminals. Check that the resistance goes low after about 24 seconds from triggering. The case will require drilling at each end for the wire entry grommets. Also the lid needs two holes – one for the LED and the second for the switch. Use the front panel artwork as a guide to the positioning of these holes or refer to the photograph if using the Jaycar plastic case with the grid on the lid. The label can now be glued to the front panel. Installation Before we look at the alarm detection devices, we’ll examine how the RoomGuard is connected to your smoke alarm. First of all, though, we should point out that the RoomGuard is designed to be used with a low-cost battery-only powered unit – it should not be installed on a mains-powered, battery-backed smoke alarm. Having said that, the RoomGuard should operate with virtually any battery-operated smoke alarm available. It will be very difficult, if not impossible, to attach the wiring to the smoke alarm in situ (ie, on the ceiling). So if you’re connecting to an existing smoke alarm, first of all carefully remove the April 2000  33 At left is a full-size front panel which can be glued to the case lid, shown above. You can see how the “armed” switch and indicator LED holes have been lined up on the lid’s dot grid in this plastic case from Jaycar. If you use another case (without a grid) use the label as a drilling template. screws holding your smoke alarm in place (some smoke alarms simply twist to remove them). Take out the smoke alarm battery then carefully remove the PC board. Sometimes this is a little tricky – there are often hidden catches which must be pushed back. Few modern smoke alarms use screws to hold the PC board in place (screws cost money!) There are four wires which connect the RoomGuard to the smoke alarm. The first two, the “+” and “-” battery connections, are very easy. Simply solder the wires to the points on the smoke detector PC board where the battery wires connect. Some smoke alarms use an integral battery connector but even this is not hard to identify. Just make sure you get the polarity right: “+” to “+” and “-” to “-” (or red to red and black to black). Now for the more difficult (though not too difficult) part – identifying the test button connections. In many cases you will find little more than a piece of spring metal which shorts out when a tab or button on the outer case is pressed. Line up the PC board with the test button and see where it lies on the PC board. Turn the board over to the track side and identify which two points are shorted when the test button is pressed. As we mentioned before, you need to know if the test button connects power to the test button, or whether it shorts to ground. With a multimeter (preferably digital) check the polarity of the two terminals of the test button. The more positive terminal connects to the + terminal of connector 2 in the RoomGuard and obviously the more negative terminal to the – terminal of connector 2. Some test buttons short to the radioactive smoke detector case itself which is often stainless steel or aluminium. Resistor Colour Codes     No.  5  5  1  3  3  1  1 Value 1MΩ 560kΩ 470kΩ 100kΩ 10kΩ 1kΩ 470Ω 34  Silicon Chip 4-Band Code (1%) brown black green brown green blue yellow brown yellow violet yellow brown brown black yellow brown brown black orange brown brown black red brown yellow violet brown brown 5-Band Code (1%) brown black black yellow brown green blue black orange brown yellow violet black orange brown brown black black orange brown brown black black red brown brown black black brown brown yellow violet black black brown This may be difficult (or impossible) to solder to so an alligator clip might be used to clip to the case. Alarm sensors/detectors You will need to install the Room­ Guard in a hidden place that is also convenient for access. Note the method of wiring normally open (NO) or normally closed (NC) switches: NO types all connect in parallel while NC types connect in series. Some types of sensor are only available in one type but if you have the choice of using either normally open or normally closed sensors, we recommend normally open devices because these will have the lowest current drain in our circuit, thus making the battery last longest. While we have called this alarm a RoomGuard, it can protect a whole home. You should divide the house or home unit into three sectors for the three inputs on the alarm. The instant inputs can be used for the windows and most doors except for the main door that you need to make your entry. This door sensor should be connected to the delayed entry input. Reed switches are commonly used for alarm sensors. These are tiny, magnetically-activated switches which can be hidden inside door jambs and window frames, with small magnets hidden in the door or windows them- Capacitor Codes    Value 0.22µF 0.1µF .015µF EIA 224 104 153 IEC 220n 100n 15n Fig.4: the full-size artwork for the PC board pattern. This can be used to make your own board or as a checking aid for commercial boards. selves. Reed switches are (usually) normally open but when the magnet is brought close by, they close. Thus an opening window or door can remove the magnet and so cause the reed switch to open, triggering the alarm. Note, however, that some reed switch- es are normally closed and some even have both NO & NC contacts. Another possibility, usually even easier to mount, is one of the small passive infrared (PIR) detectors which detect the movement of people. These can be either normally open or normally closed devices but the disadvantage is that they will require their own power supply (usually 12V). Any passive infrared unit which will be triggered when you enter the house to switch off the alarm must be also connected to the delayed entry input. There are many other types of detection devices – pressure mats which go under carpets or doormats, light beam relays which you can buy or make yourself, even the old spy novel trick of tying a piece of very, very fine wire across a doorway or entrance so that anyone walking through will break it. (It has to be extremely fine so they cannot see it and also to ensure it breaks when disturbed). You may come up with even more ideas to protect your room. Finally, when you’ve completed installation of both the RoomGuard and your alarm sensors, testing the unit is simply a matter of triggering all of the sensors you have connected. Get ready to turn it off quickly, though: smoke detector sirens are SC designed to be loud! Alarm Intruder Detection Devices Here are a few devices from the Jaycar Electronics catalog (free in this issue of SILICON CHIP) which are commonly used to trigger alarm systems. As mentioned in the text, magnetic reed switches are commonly used to alert an alarm system when an intrusion takes place. As their name suggests, these switches are magnetically activated – when a magnet is brought into close proximity to the switch a reed inside it makes (or less usually breaks) a contact, which activates the alarm. Where wood-framed doors and windows are used, a   completely “invisible” reed Photo 1 switch can be used, as shown in photo 1. The magnet is housed in a hole drilled in the door or window itself while the reed is housed in the architrave or frame so that when the door or window is closed, the two parts line up. The connecting cables can go inside the cavity and no-one will know there is an alarm in place. Where aluminium or steel doors or windows need protection, the reed Photo 2 switches can be the surface-mount type shown in photos 2 and 3. Naturally these can be seen which usually means slightly less security. Reed switches are usually normally-open (NO) devices but the reed switch set shown in photo 3 is different: it is both NO and NC – you select which way you want it to work by wiring the appropriate terminals. The door Photo 3 switch shown in photo 4 is similar to that found in cars to turn their interior lights on and off. It is actually a nor-mally closed device but is held in the “NO” position by the closed door. When the door opens a Photo 4 spring causes two parts to short together. These are cheap, reliable switches but are sometimes more difficult to fit than other types. The last detection device shown here is a Passive Infrared (PIR) detector (photo 5) which senses the movement of people. They used to be very expensive but are now relatively cheap. PIRs usually have both NO and NC contacts but also require Photo 5 a 12V DC supply. They can also sometimes be triggered by pets, etc. Finally, note how NO and NC devices are wired: NO are always wired in parallel, while NC are always wired in series April 2000  35