Skip to main content
Patrick’s Preoccupations
  • Contact
  • Notes
  • Projects
    • Hedgehog Camera

Hedgehog Camera contents

  • Hedgehog Camera
    • IR illuminator
    • Powering the router
    • Installing OpenWRT
    • Video capture
    • USB flash drive power
    • PIR motion detector
    • Webcam unreliability
    • Better automation
    • USB flash drive failure
    • Footage

The Hedgehog Camera Project

By Patrick Wigmore, May 2020, published: 16 July 2023, updated July 2023

A webcam mounted on a short plastic ground stake lies next to a home-made infrared illuminator, which also has a ground stake.
Camera and infrared illuminator for hedgehog-watching

We had been talking about having some kind of wildlife camera in the garden to capture images of hedgehogs.

I already had an old webcam, which I’d previously modified to remove its infrared filter, so I set about looking for a way to use that. How hard could it be?

Cameras and infrared

Most digital camera sensors are sensitive to infrared light, but colour cameras usually have a filter to block it out. If a camera is going to capture colours as the human eye sees them, then it must exclude infrared.

Nevertheless, the IR filters are rarely 100% effective. Pointing a TV remote at a video camera to see the flashes of infrared light is a well-known trick.

I had hoped the infrared filter might just pop out of my old, cheap webcam as a loose part, but it turned out to be firmly bonded in place and I ended up totally destroying the filter in my attempt to remove it. It was a tough, thin, glass-like material, which ultimately crumbled into tiny pieces.

With the filter removed, the colour image is no longer accurate if there is any infrared in the scene, such as from sunlight, but the camera gains the ability to capture a scene that is illuminated purely by invisible infrared light.

Two nearly identical photos of a houseplant with different lighting. The top photo looks normal. The bottom photo is washed out with what the camera sees as bright purple light.
A plant illuminated by an LED lightbulb (top) and by an equivalent incandescent lightbulb (bottom), as seen with no IR filter, showing that the incandescent lightbulb produces infrared light.

Plan A: a very long USB cable

The first plan was to buy a really long USB extension cable; the kind that has electronics in it because it exceeds the maximum length of a standard USB cable; plug the camera into that somewhere out in the garden, and run it back to the house and inside through a window. I also built a USB-powered infrared illuminator to give the camera some light to see by.

A very long USB 2.0 type A extension cable, with a type A plug at one end and a type A socket at the other. It is arranged in two coils, bound with cable ties. Where the cable passes from one coil the the next, there is a plastic lump in the cable; an active repeater module. There is also an active repeater module at the socket end of the cable.

This worked pretty well and gave a nice, clear image. But it quickly became clear that it wasn’t practical. I didn’t have a computer that I could dedicate to recording videos, so I had to keep attaching my laptop to the end of the cable, which was inconvenient. I also couldn’t shut the window properly over the thick and inflexible USB cable, which let a lot of heat out of the house. A rethink was needed.

Plan B: stand-alone recording equipment

I realised that, if I could put the computer out in the garden with the camera, I could power it through a much thinner cable that would fit through a closed window and access the video footage via WiFi.

Raspberry Pi Zeroes were out of stock and ideally I wanted to spend less than the cost of an off-the-shelf wildlife camera, so I decided to use a second-hand WiFi router running OpenWRT. Routers don’t really have the best specifications for this application, but they are very cheap on eBay.

A BT Home Hub 5, type A in its original box, with accessories: a power adapter with removable UK plug section, two UK-style ADSL microfilters, an Ethernet cable and an ADSL cable. The Hub itself is wrapped in clear plastic and sits in a Hub-shaped recess in a cardboard insert which has been moulded to shape like an egg carton or a fast food drinks holder. The rest of the box is made out of ordinary cardboard.
A BT Home Hub 5, type A from eBay. This isn't actually the one I used for the Hedgehog Camera; I didn't want to waste a pristine in-original-box one on that. The actual Hedgehog Home Hub came with a slightly damaged power cable wrapped up in a hair tie and I never quite managed to remove the smell of tobacco smoke from the circuit board.

This project turned out to be an education in hardware limitations and workarounds: the router’s weak CPU, the flaky webcam, the write endurance and power consumption characteristics of USB flash drives and more!

Nevertheless, I eventually got it all working and managed to capture some nice images of our resident wildlife.

You can read more about various aspects of the project in the subsections listed in the project contents.

© 2017-2023 Patrick Wigmore