Fully-featured Outdoor Security Camera Based on Raspberry Pi

11 Mar.,2024

 

For building an indoor webcam, a simple Raspberry Pi (any model) and an attached camera (any model) with IR LEDs for night vision would work just fine. There are already plenty of kits available with this combination so if this is what you want to achieve, buy one of those and skip to step 12.

The same hardware though would not fit for an outdoor camera: the picture taken from the IR-capable Raspberry camera outside your house would look mostly pinky (due to the infrared light being captured by the camera) and with the small out-of-the-box IR LEDs you would not be able to see anything past 3 feet / 1 meter.

To solve the first problem, we need something called mechanical IR CUT filterwhich basically gives you back the true colors in day light but still allowing to capture the IR lights during the night. Most of the devices in the market have two wires: one short pulse on one wire will move the IR filter in front of the sensor (day mode), one short pulse on the other wire will remove the filter (night mode). They usually operate between 3v and 9v and if attached to our Raspberry, we can have full control over when to toggle night mode. However, the IR Cut filter cannot be controlled directly from a pin of the Raspberry since the mechanical part inside it requires much more current than the one the Pi can supply. We will work around it by using a H-Bridge powered by the Raspberry's 5v and controlled by two pins.

To address the second problem, we would need a more powerful IR LEDs board to achieve a decent night vision. Boards with fewer but bigger leds are preferred over those with a lot of tiny leds. Most of the boards in the market have also a LDR (Light Dependent Resistor) attached which is used to determine when to turn the LEDs on if dark. They usually operate at 12v and have a small plug (labelled "IRC") that can be used to connect an IR cut filter. However, no pulse is sent out directly through this plug but during the night (LEDs on), a (usually) 5v voltage drop between both the wires and ground is created. If attaching one of the wires to our Raspberry and monitoring the signal of the pin, we can determine if we are entering or leaving night mode (which is exactly what PiWebcam does)

One last thing to consider regarding the hardware is how to power the Raspberry Pi. Since we have a 12v power supply and we need 5v to feed the Pi, a voltage regulator is needed.

Want more information on Raspberry Pi Cameras? Click the link below to contact us.