Night Vision camera project
By Phil King. Posted
Unlike eating carrots, this ingenious infrared camera really does enable you to see in the dark. Phil King stops munching veg to take a look.
It’s late at night and all the lights are out in the house, but someone is sneaking around… Don’t worry, it’s just Dan Aldred testing out his latest Raspberry Pi-powered invention, a portable infrared camera enabling him to see in total darkness.
Dan Aldred is a Raspberry Pi enthusiast, NCCE facilitator, teacher, and coder who enjoys creating new projects and hacks to inspire others to start learning (see magpi.cc/rwepTs). He's still trying to get a Kinect 360, Python, and Raspberry Pi working with each other.
As a child, Dan was a fan of the Splinter Cell stealth shooter video game. “The iconic image from the game is the night-vision goggles that Sam Fisher wears,” he recalls. “I have always been fascinated by the idea that you can see in the dark, and this formed the foundation of my idea to build a portable handheld night vision piece of equipment.”
Success by stealth
Sam’s Night Vision project features a Raspberry Pi Zero and a ZeroCam infrared camera equipped with IR LEDs for night-time ‘illumination’. The live camera view can be shown on a Pimoroni HyperPixel 4in TFT touchscreen, which is also used for a graphical user interface.

For the housing, Dan upcycled a handheld camera flash unit. “The original plan was to use an old-fashioned camera and make a camera that took photos in the dark, but when I went to a car boot sale, all I found was the pivoting flash – it cost a pound, which was a bargain.”
As well as being large enough to house a Raspberry Pi Zero, IR camera, and screen, the flash unit has the bonus of a tilting handle, enabling the user to angle the camera to the desired position.
One of the hardest challenges was that Dan wanted Night Vision to be standalone, portable, and bootable, with minimum interaction from the user to get it running. “The obvious solution was to use a crontab [task scheduler], but this did not load the GUI,” he reveals. “I spent about two weeks trying to find a solution. In the end I opted for a desktop icon which, when you click it, the program runs and the GUI loads.”
From vision to reality
While Dan planned out what he needed to do before he started putting the camera together, not everything went to plan. “There were several points at which I had to take a break and reassess how to find a solution to a problem,” he admits.
“All was going well until I ran the program and realised that the camera image displayed back on the HyperPixel was upside down! Luckily at this point I was using elastic bands to hold the case and hardware together, so I could flip it around. But the IR LEDs were secured in, and breaking the Sugru might damage or split the plastic. As a stroke of fate, the IR LEDs are mounted into holders and guess what, you can pop the LEDs out of the holder. So, I popped them out and then rotated the camera unit and then popped it back into place!”

More trouble was to follow when Dan accidentally cracked the touchscreen. “The whole project was working and perfect, so I was left with the conundrum of either replacing the screen and risking all the inner hardware not fitting back in, or just ‘make do and mend’. I settled for the latter, so the 10-second button does not work, but who wants to see in the dark for only 10 seconds anyway?”

Quick facts
-
The GUI is created in Python using
-
Dan has experimented with object detection using
-
Night Vision is powered using a portable phone charger
-
It would be ideal for detecting vampires/werewolves at Halloween…
-
…or a large bearded man in a red suit at Christmas
See also:
This article was written by Phil King and first appeared in The MagPi 86. Get a free Raspberry Pi with a 12-month subscription to the print edition of The MagPi magazine.
When not editing books and contributing to The MagPi, Phil enjoys playing the piano (badly), astronomy, and watching classic sitcoms.
Subscribe to Raspberry Pi Official Magazine
Save up to 37% off the cover price and get a FREE Raspberry Pi Pico 2 W with a subscription to Raspberry Pi Official Magazine.
More articles
Make your RAM go further – Raspberry Pi OS memory optimisation tips
In issue 164 of Raspberry Pi Official Magazine we have been playing around with the new Raspberry Pi 5 1GB RAM. While the RAM shortage caused by the demands of AI infrastructure is annoying beyond belief, this has been a great chance for us to really get to grips with RAM. Generating images in Stable […]
Read more →
Mighty Projects – 1GB Computer in Raspberry Pi Official Magazine 164
It’s normal for computers to get faster and more pwerful, but the new-ish Raspberry Pi 5 1GB is a step in the other direction: it has all the processing power and the same GPIO pins of its more costly siblings, but with only 1GB of RAM it’s at a price that’s friendlier on the wallet […]
Read more →
Win one of five 256GB Raspberry Pi Flash Drives
If you’ve been around long enough, you know that every Raspberry Pi accessory is top quality, and the latest Flash Drive is no different. Fancy a big one? We have five up for grabs, and you can enter below… Win 1 of 5 256GB Raspberry Pi Flash Drives
Read more →