This instructable is how to make a web based security camera based on a Raspberry Pi Zero + Raspberry camera module housed in a 'dummy' security camera housing. It uses power over ethernet to power the unit so the only connection is a single ethernet cable into the back of the unit.
The Pi Zero is a very small unit which fits easily within the small dummy security housings but does not natively have an Ethernet connection. Two small electronic modules are added to the Pi Zero; a mini buck voltage regulator to power the Zero from Ethernet and a USB to LAN converter to provide the base networking connection.
Step 1: Shopping List
- Raspberry Pi Zero module ~ £4.80
- Raspberry Pi Camera module ~£20
- Pi Zero camera cable ~£4
- Micro SD card 8GB or higher ~ £5
- Mini Buck voltage converter EBay ~£1
- Micro USB to LAN module EBay ~£1.50
- Dummy Security camera EBay ~ £4
It is possible to get V1 camera with zero cable included at a significantly cheaper price. V1 has a lower still image resolution than V2 but still good and video is the same. In addition the networking should have some power injection method. I used a simple 4 port + uplink power injecting hub that can support 4 cameras. Suitable units are available on EBay for about £14. Single pass through power injectors can also be obtained for about £3. A 12V 2A PSU is a good central power source.
Step 2: Preparing the Pi Zero Module
The Pi Zero just needs a way of feeding the power in from the buck converter. This is fed directly in to the GPIO pins. +5V is on GPIO pin 2 and 0V is on GPI pin 6.
Solder wire into these pins. The 0V can go straight up. The +5V should be insulated and bent so that it lies along the board and bends up so that the buck converter outputs can be threaded through directly.
The camera cable can be fitted at this stage into the Pi Zero connector. Take care over this as the connector is quite fragile. Make sure it is 'opened' up before trying to insert the cable and push down while gently closing it after inserting the cable.
The standard cable can be removed from the camera and the new Zero cable inserted in its place.
Step 3: Preparing the Buck Converter
The buck converter should have 2 right angle pins soldered onto its input connections.
Before connecting to the Pi the converter must be adjusted so that it delivers 5V out. Temporarily connect a 12V power supply to its inputs, measure the output with a voltmeter and adjust the potentiometer so that the output is 5V. I normally adjust to 5.2V to make sure power is good even if the converter drops a bit under load.
After adjustment the converter may now be soldered onto the Pi Zero
Step 4: Preparing the LAN Converter
The LAN module is supplied with a short micro USB cable and a RJ-45 LAN connector in a plastic housing. For this project we split the plastic housing apart and discard. There is a small circuit board with a RJ-45 socket soldered at one end and the USN cable soldered at the other.
Remove the plastic housing of the RJ-45 socket revealing the 8 wires. Only 4 of these are required (1,2,3,6) for the 100Mb operation. The others should be clipped off. One can verify which ones by looking at the traces on the board as only 4 are connected. Bend and spread the remaining 4 at right angles fairly flush with the board. As these wires are fairly thin they may be a slightly loose fit onto jumper connectors. One can improve the fit by lightly tinning the wires with solder.
The micro USB cable plus plug will be too big to fit. I cut the cable about half way and remove the outer cable shroud to make it more flexible. I then solder the USB cables onto a micro USB plug and glue into a half cut down plastic shell. This the will only stick out a small way from the Pi Zero USB connector.
One 'feature of these LAN modules is that they do not have a unique MAC address. This is not a problem with one camera on the network, but would prevent puting more than one on. The MAC address can be spoofed however to get round this and this is dealt with in the software section.
Step 5: Preparing the Housing
The housing comes apart easily with screws revealing a slide in plastic tray with battery housing. The front is a dummy circular 'camera' module. The back will have a dummy cable stub going through a 'grommet which is a good fit for cat-5 cable.
Remove the plastic lens from the centre of the camera disc. I prefer to get rid of the false LED bubbles by sawing them off and sanding flat. This is not strictly necessary but makes it easier to mount the camera and also allows painting it black if required. The camera can then be mounted by marking and drilling 4 1.6mm holes and using 2.2mm self tappers. It is quite tricky to miss the existing holes so take a bit of care here. It doesn't matter too much if only 3 holes are used.
For the tray place the Pi Zero on and mark the 4 mounting holes. I drill through with a 1.6mm drill and then mount with 2.2mm self tappers. An alternative would just be to hot glue it onto the tray. The Pi Zero should be mounted with the GPIO side close to the edge of the tray and central along the tray. I also glue a couple of plastic spacers onto the tray on the USB connector. When the Pi Zero is screwed in it is then tilted up a bit so that the USB plug clears the tray.
The LAN module may be hot glued to the base of the tray with the 4 LAN connectors pointing to the back of the camera housing (away from camera module) and the USB plugged into the Pi Zero
The camera disc is screwed back on the front of the tray with cable going underneath the tray and looping up through the front. Note that the micro SD card may be difficult to insert or withdraw with the camera disc screwed in place so it may need to be temporarily unscrewed to do this.
Step 6: Cabling and Final Assembly
Feed a Cat 5 cable through the back of the camera housing and strip back about 12cm of the sheath.
The blue/blue-white form the +V connection, the brown/brown white form the 0V connection. The other 4 are the actual Ethernet data connection. These should be made shorter.
To make it easier to assemble and disassemble I put jumper socket connectors on these wires. One can either get raw connectors or I just retrieve them from existing jumper leads. It is also good to mark the polarity of the power connections to avoid mistakes.
The power leads may be plugged on and the data connections made. Orange/White(1), Orange(2), GreenWhite(3), Green(6). The tray can then be slid back into the housing while simultaneously withdrawing the Ethernet cable back..
Step 7: Software
I use a software build called RPi-Cam-Web-Interface. This is simple to install and gives a web interface with a live preview and a comprehensive set of motion detection, recording management and scheduling functions.
If more than one camera is used on the same network then it is necessary to spoof the MAC address. To do this edit the /etc/network/interfaces file
Add edit the following into the eth0 section
iface eth0 inet dhcp
hwaddress ether 00:e0:4c:53:44:59
where the Mac address can be changed to make it unique locally.