Home surveillance and alarm systems are increasingly affordable, but there’s no need to buy dedicated hardware: a single-board computer like the Raspberry Pi can do the job perfectly well. With low-cost peripherals such as microphones, proximity detectors and motion sensors, you can build your own security system to rival high-end commercial offerings. Any model of Pi will work, but here’s how we did it using a cheap, compact Raspberry Pi Zero 2 W.
STEP 1 Install the operating system
You can buy a microSD card with Raspberry Pi OS pre-installed from shop.pimoroni.com; the 32GB version costs £9.90, the 64GB option is £19.90. But you probably own a microSD card already, and they cost from £6.19 on amazon.co.uk at the time of writing.
Start by flashing a microSD card with the latest build of Raspberry Pi OS. You can do this using the Raspberry Pi Imager from raspberrypi.com/software; before imaging the card, accept the option to change your settings, as doing so at this point greatly simplifies matters when you come to boot your board.
Tick the box to specify a hostname, and give it a meaningful name – we’ve chosen alarmpi.local. Enter a username and password for logging in, and provide your network credentials so the Pi can connect to the network at boot. Click through to the second tab and enable SSH so you can administer the board remotely from your Windows machine.
Now allow the imager to download the OS and write it to your card. This can take a few minutes; when it’s finished, eject the card and insert it into the slot on your Raspberry Pi.
STEP 2 Install the camera
The last element required for a basic home security system is the camera. You can buy a Pi-compatible camera for under £30; note that Raspberry Pi produces both regular and NoIR camera hardware. The NoIR version (tinyurl.com/354pinoir) is sensitive to infrared light, and can be used to take pictures in the dark, while the standard version (tinyurl.com/354camera) produces better results in regular lighting. There are also wide-angle versions of each, and a high-res model, but for our purposes the standard camera unit is fine.
Raspberry Pi cameras all come with a standard ribbon cable that fits most Raspberry Pi boards, but to fit our Raspberry Pi Zero 2 W).