91ɫƬ

How to build your own intruder alarm with basic electronics

Worried about unwanted visitors in your garden? Here's how to build a simple alarm system with basic electronics, a plastic folder, kitchen foil and a sponge

WHAT did your motion-sensitive wildlife camera spot last week? Perhaps you saw beautiful birds, or hedgehogs snuffling around at twilight. Or perhaps you snapped a photo of the neighbourhood cats digging up your plants, or foxes menacing your bins.

If it was either of this second pair, this week’s project will help protect your petunias and keep a lid on your garbage by surprising any creatures that stray where they aren’t welcome.

To detect the intruders, we are going to make a simple pressure plate switch that will trigger when stepped on. Take the plastic folder and cut along the spine so you have two similarly sized sheets of plastic. Wrap each with kitchen foil so one side is totally covered and secure the foil with tape or glue.

Next, take two lengths of wire and strip a few centimetres of the plastic insulation off both ends. Tape one piece of wire to each plastic sheet so the bare end is in contact with the foil. Ordinary tape is fine, but for a more reliable connection you could use copper tape, which conducts electricity.

Cut your sponge into pieces a few centimetres across and arrange them around the edge of one of the sheets on the foil-covered side. Place the other sheet on top so the foil sides are facing and secure the sponges in place. When something presses on top, the sponges will compress, bringing the foils into contact, completing a circuit.

Now connect the other ends of the wires to your BBC micro:bit. Use crocodile clips to attach one to pin 1 and the other to ground. That is the switch done. Now we need a noise maker to deter whatever steps on the device.

Connect the red wire of your piezo buzzer to pin 0 and the black wire to ground. Moving on to the MakeCode editor, grab an “if \<\> then” block from “Logic” and snap it into “forever”. Take “pin 0 is pressed” from “Input” and use the drop-down to change it to “p1”, then slot this over the default “true” in your “if” block. Now, from the “Music” menu, take a “start melody” block and nestle it into your “if”. Use the drop-down to choose a melody – the default “dadadum” is suitably scary.

You are now ready to go outside. Put the micro:bit, battery and piezo in a weatherproof container and cover the foil plates with something light and rainproof – perhaps a plastic bag. This will prevent rainwater getting in and causing erroneous connections between the sheets, as well as disguising your device.

You can customise the scarer as well, changing the tune in case wildlife gets wise to it. Or find another way to spook them: flashing lights, or a waving flag or scarecrow attached to a mini motor. Just be sure to warn any guests that step into your garden.


New stuff you need

Kitchen foil

Soft sponges

Plastic document folder

Piezo buzzer

Electrical wire

Waterproof container

For next week

waterproof temperature probe

1×4700 ohm and 1×470 ohm

red LED

Old wire coat hanger


Next in the series

1Moisture-sensing plant

2 Moisture and temperature-sensing plant

3 Plant auto-waterer

4 Tweeting wildlife cam

5 Pest scarer

6 BBQ thermometer Perfectly cooked food while you relax

7 Rain alarm

8 Mini weather station

9 & 10 Remote controlled pest-proof bird feeder parts 1&2

To download a printable version of this page click here

Email:maker@newscientist.com

Topics: Electronics