Learn how to build a trail camera (also know as a camera trap) using a Raspberry Pi Zero micro-computer and a few other common components.

This guide is an updated version of my popular how-to guide on building a trail camera with a Raspberry Pi. This version takes into account the latest hardware and software updates.


Trail cameras have become very popular over the last 5 years across a range of applications. For me, they are an invaluable tool for monitoring sites where I want to discover more about the activity of the wildlife in the area but can't commit to days on end keeping watch. As a battery-powered, self-contained unit, trail cameras can be deployed away from power sources making them ideal for monitoring remote areas which sets them apart from other, similar 'webcam' style systems that are hooked up to mains power and the internet.

There are many trail camera products already on the market - most of which are excellent but can come with a hefty price-tag. Therefore, I wanted to see if I could build my own and work out the pros and cons of doing so both in terms of cost and functionality.

In my last guide, I started my project with a Raspberry Pi B+ but alluded to using the smaller A+ and Zero models. Now in 2018, the Raspberry Pi Zero W is available which combines a tiny form-factor with built-in WiFi which makes the whole process of development far easier! Since the last guide there have also been updates to operating systems and some of the software libraries so now seems like a good time to re-vamp my how-to guide.


Like the last project I wanted to achieve the following with my trail camera:

  • Record images or video
  • Use away from mains power (e.g. battery powered)
  • Include a removable storage system so that the camera could remain in place and have the storage drive replaced.
  • Weatherproof
  • Keep the design as small as possible
  • Optional - Record in both daylight and at night

What you need

  • A computer connected to the internet with an SD card slot (or some other way of attaching an SD-card).
  • A wireless network such as your home broadband.
  • Raspberry Pi Zero W - you can use other models but the Zero W is cheaper than most and has built in WiFi which is extremely useful.
  • Raspberry Pi camera module - there are several options available here depending on what time of day you want to capture footage. See the section below for an explanation.‚Äč
  • Pi Zero camera cable - if using a Raspberry Pi Zero.
  • Micro SD card and SD card adapter. 8GBs should be adequate as we're going to store our footage on a removable device.
  • USB power bank. I use an Anker PowerCore 10000 due to its size and capacity.
  • MicroUSB to USB adapter. An adapter with a short cable length is ideal when it comes to positioning things in the casing.
  • USB drive for storing the footage. 16GBs or more and small form factors are recommended here.
  • PIR sensor
  • 3 Jumper wires to hook up the PIR sensor
  • A real time clock (RTC) - if you want to timestamp your footage and why wouldn't you?
  • Weatherproof casing - I find an air-tight kitchen storage box really cheap and perfect for the job.
  • Tape or something like Sugru for fixing things in the casing.
  • Optional - IR LEDs - for night time recording. Bright-Pi is an possible all-in-one solution.


Camera modules

The default Raspberry Pi camera module can only see in daylight unless you provide a large amount of illumination while recording at night (which is not practical). The NOIR camera module is an infra-red version of the camera although images made during daylight will look a bit weird due to the camera letting in infra-red light. There is an option to use a camera that can operate during both day and night although I have not tested this and required an extra bit of wiring and coding.

If you only want to know what's in a location and when and don't mind some dodgy looking footage, use the NOIR module (night vision camera). However, you'll need to provide some illumination via some IR LEDs. For better image quality but only throughout the day, use the normal camera module. You don't need any IR LEDs to provide extra light.

  • Camera module V2 - for daylight recording only
  • Camera module NOIR V2 - for recording a night with IR LED illumination. This camera can record throughout the day but the colours will appear strange.
  • 'IR-CUT' camera module - with a little bit more work, this camera can be used to get the best of both worlds. Remember, you'll still need some IR LEDs for nighttime recording.


For the majority of this guide, I'll assume we're using the standard camera module and any additional steps taken to make the camera useful at nighttime will be addressed at the end.

Once you've got all your things together, let's move on to Part 2 of the guide and set up our Raspberry Pi Zero.