In this project, we’re using an Arduino Uno and a Raspberry Pi 3 Model B to create an automatic wildlife camera. And, as an added bonus, this camera works at night. Make one of your own to snap photos of local birds, parading pups, or sneaky humans.

With winter out of the way, spring finally arrived. And after a few months of April flowers and May showers, summer is here in its full strength, bringing with it plenty of wildlife! Badgers, foxes, squirrels, and birds are just a few of the creatures I’ve spotted in the countryside—but getting pictures of them has proven difficult.

I was left thinking, “If only there was a way to automatically snap photos of these mischievous beasts whenever they’re out in the open!”

In this episode of the Gentleman Maker, we will build just that—the Life-Cam. It’s an automatic camera system that can take pictures of animals both during the day and at night. No more chasing after chickens and following dogs for this Brit!

Life-Cam BOM

In order to construct your very own Life-Cam, you will need the following materials:

The Schematic

To realize this project, several modules and systems will be combined together: an ultrasonic range finder, an Arduino, an IR floodlight, a Raspberry Pi, and a power source. Capturing images of animals can be done at day, but the most interesting animals are found at night. While a continuous video stream could be taken, it is not very efficient, so, instead, an ultrasonic range finder will detect the presence of animals.

But, photography at night is near impossible without some form of light, and visible light scares off animals. So, instead, an IR floodlight, which is only visible to the camera, should do the trick. The IR flood light (consisting of 10 high powered IR LEDs), consumes a rather large amount of current (500mA), so, instead of it being powered all the time, it is instead controlled using a relay. It should only turn on when an animal is detected.

The circuit behind this project is rather simple. It uses a relay as a power controller for the IR flood light and a single 2N3904 transistor for enabling the relay. The Arduino is connected to the Raspberry Pi via USB and is used to read distance measurements from the ultrasonic module. If you’d like to check out the Scheme-It schematic in more detail, you can do so here.

Once your Life-Cam is constructed, it should look something like this, housed in a container that protects it from the elements.

The Code

I’m using an Arduino in this circuit because the Raspberry Pi cannot probe the ultrasonic module fast enough when using Python. When the Arduino detects an object (the distance reading falls below a pre-defined threshold), a message is sent to the Pi, which triggers the Python program to take several images. While the images are taken, the IR floodlight is also turned on.

If you’re making your own Life-Cam, you can download the code I created at the end of this article.

Your Life-Cam should provide loads of exciting images, like the one pictured here.

Powering the Life-Cam

There are multiple ways this project could be powered, but since my project is being tested in a field at night, I have opted to use a small 20W solar panel with a 12V lead-acid battery. The solar charger has a 5V USB port, which is used to power the Raspberry Pi, while the 12V battery is used as the voltage source for the IR flood light. A 12V battery alone could be used, but the solar panel gives us the option for daytime charging.

With that, you should have everything you need to take photos of your own daily and nightly visitors. If you were set up one of these in your garden, what creatures would it capture?

Want to watch more episodes of the Gentleman Maker?

lifecam_Code.zip