Raspberry Pi HD surveillance camera

Intro

In a earlier guide (http://captain-slow.dk/2013/11/01/install-motion-on-a-raspberry-pi/) I showed how to get motion installed and running on a Raspberry Pi, here is what more you can do to make it look a lot more professional, still without adding too much extra value to it. (these extra things are totally worth it in my opinion)

Housing

One of the most important things is of curse the pi itself plus the camera module. But after that it is a good house to put it in.

The house I use can be found on amazon (http://www.amazon.de/dp/B006OKN3TK) and the build quality is beyond anything I would have expected.

418ufDdLY2L

Can’t say this house is cheap, but the quality is in top, and it got plenty of room inside for other sensors, or even the power supply for the pi.

Mounting the pi

2013-11-01 22.00.16 (Large)

Inside the house you will find a metal plate with a plastic piece, looking a bit like a camera. After removing that piece of plastic I drilled two holes and mounted the pi with two bolts, held apart from the metal plate by two 5mm nylon washers.

To hold the camera I 3d printed a mount, but you can most likely be able to modify the dummy piece of plastic too to hold it instead.

If you want to print your own mount, you can generate your own stl file using OpenSCAD and this little script

holeClearance 			= 0.5;

frontWidth 				= 64;
frontHeight 			= 60;
frontThickness 			= 3;

frontMountHoleHeight	= 25;
frontMountHoleWidth		= 12;
frontMountHoleThickness	= 4;
frontMountHoleDistance	= 41.4;
frontMountHoleOffset	= 16;
frontMountHoleDiameter	= 3;

moduleWidth 			= 9;
moduleHeight 			= 9;
moduleOffset			= 1.5;
moduleOffsetDiameter	= 7;

moduleHolesDiameter 	= 2.15;
moduleHolesDistance 	= 21;

ledVisible				= true;
ledHoleDiameter			= 3;
ledHoleOffsetX			= -8.5;
ledHoleOffsetY			= 9.5;

fn						= 10;

finalFrontMountHoleDiameter = frontMountHoleDiameter + holeClearance;
finalModuleHolesDiameter = moduleHolesDiameter + holeClearance;

difference()
{
	union()
	{
		cube([frontWidth,frontHeight,frontThickness]);

		translate([(frontWidth/2)-(frontMountHoleWidth/2)+(frontMountHoleDistance/2), frontHeight-frontMountHoleThickness, frontThickness])
		{
			cube([frontMountHoleWidth,frontMountHoleThickness,frontMountHoleHeight]);
		}

		translate([(frontWidth/2)-(frontMountHoleWidth/2)-(frontMountHoleDistance/2), frontHeight-frontMountHoleThickness, frontThickness])
		{
			cube([frontMountHoleWidth,frontMountHoleThickness,frontMountHoleHeight]);
		}

		translate([frontWidth/2, frontHeight/2, 0])
		{
			translate([moduleHolesDistance/2, 0, (moduleOffset/2)+frontThickness])
			{
				cylinder(h=moduleOffset, r=moduleOffsetDiameter/2, $fn=fn, center = true);
			}

			translate([-moduleHolesDistance/2, 0, (moduleOffset/2)+frontThickness])
			{
				cylinder(h=moduleOffset, r=moduleOffsetDiameter/2, $fn=fn, center = true);
			}
		}
	}

	union()
	{
		translate([frontWidth/2, frontHeight/2, -1])
		{
			translate([0, 0, 2]) cube([moduleWidth,moduleHeight,frontThickness+2], center=true);

			translate([-(moduleHolesDistance/2), 0, ((moduleOffset/2)+frontThickness)-1])
			{
				cylinder(h=frontThickness+2+moduleOffset, r=finalModuleHolesDiameter/2, $fn=fn, center = true);
			}

			translate([(moduleHolesDistance/2), 0, (moduleOffset/2)+frontThickness])
			{
				cylinder(h=frontThickness+2+moduleOffset, r=finalModuleHolesDiameter/2, $fn=fn, center = true);
			}
		}

		if (ledVisible)
		{
			translate([(frontWidth/2)+ledHoleOffsetX, (frontHeight/2)+ledHoleOffsetY, 1])
			{
				cylinder(h=frontThickness+2, r=ledHoleDiameter/2, $fn=fn, center = true);
			}
		}

		translate([(frontWidth/2)-(frontMountHoleDistance/2), frontHeight+1, frontMountHoleOffset])
		{
			rotate([90,0,0])
			{
				cylinder(h=frontMountHoleThickness+2, r=finalFrontMountHoleDiameter/2, $fn=fn);
			}
		}

		translate([(frontWidth/2)+(frontMountHoleDistance/2), frontHeight+1, frontMountHoleOffset])
		{
			rotate([90,0,0])
			{
				cylinder(h=frontMountHoleThickness+2, r=finalFrontMountHoleDiameter/2, $fn=fn);
			}
		}
	}
}

You can tweak it by changing the parameters in the top of it, but it should be fine as it is.

Assembled

2013-11-08 13.20.05 (Large)

The final version of the camera panel got a big larger to fill the entire window in the front of the house, plus I printed it in gray to be a bit less visible, and at the same time this also helps shielding the led from the camera’s lens, so even in total dark the red led can not be seen on the picture. (if you don’t want the led to be visible at all, set ledVisible to false in the script above.)

The power supply is a dirt cheap version I found on eBay, it costs less than $6 and is with free shipping from china. The specs on the power supply is 2A at 5V, and while having it connected to the Raspberry Pi with everything running, I could measure the voltage to 4,98V. It’s not perfect, but seems to be plenty close to have it all running stable. Power supply can be found here: http://www.ebay.co.uk/itm/151156859870

Notice, with this power supply no wires are connected, and you need to solder some on yourself. To connect the power supply to my Raspberry Pi, I decided to power it through the GPIO pins, instead of soldering a wire on with a USB connector, and then plug that connector into the pi. If you want to do the same, you must be sure what pin is for what.

gpio Front_of_Raspberry_Pi

On the top right row (pin 2), you can see the label 5V. This is where you can connect the positive 5V wire. Two below (pin 6) you find GROUND, this is where you connect the negative wire. What is just as important, is to know where pin 1 is, so if you have a look at the raspberry pi to the right of the GPIO pinout, you can find P1 marked on the silkscreen, this is pin 1.

2013-11-08 13.27.24 (Large)

This is the first time I have the camera outside my house, still under roof though. While testing wifi signal strength, I took a few more pictures of the “final” (what project is ever REALLY done?) result. I still think I should print the camera plate in black to make it even more neutral to look at, but that is about it too. The over all look seems professional, thanks to the top quality dummy house.

2013-11-08 13.27.45 (Large)

Even the wire carrying mains power to the power supply inside goes into the case through a good looking fitting with a rubber seal, which will also work as a wire strain relief.

About Author

bld

5 thoughts on “Raspberry Pi HD surveillance camera

  1. Pingback: Raspberry Pi HD surveillance camera #piday #raspberrypi @Raspberry_Pi « adafruit industries blog

  2. I’m just starting on a project to set up a weather cam using the Raspberry Pi camera and in looking for printable mounts, found your website.
    I’m using the exact same dummy camera enclosure so I can just follow what you’re doing – no planning required on my part!

    One change I’ll make though is to run a 9V to 5V converter instead of a main voltage power supply. Illegal to do that here!
    I plan to upload a regular (every 5 minutes?) image to my website and I’m still deciding on the best way to do that.

  3. It’s illegal to wrok on mains electricity here unless you’re a licensed electrician and they don’t work cheap!

    I’ll put a small 9V supply, perhaps a wall wart, in the shed below where the camera is to be mounted. Having an inefficient 9v to 5v converter will provide a little welcome heat come winter. We don’t get snow but often subzero temperatures.

  4. A bit slow but I’ve finally finished the weather camera. All design ideas borrowed from you :-)
    Internal construction was limited to making a bracket for the camera module and drilling a few holes to mount the other components.
    As I’m not using it as a surveilance camera, I wrote some software in python to take images every 5 minutes and upload them to my website. I used the excellent picamera python module to do the heavy lifting.
    I’m not very organised when it comes to projects so not many pictures.
    Thanks for the inspiration.
    Geoff

    Feel free to delete links:
    Build is here http://www.port-huon.com.au/?page_id=504
    Web camera is here http://port-huon.com.au/weather/webcam/weather.jpeg

Leave a Reply