Introduction: Raspberry Pi Motion Sensing Camera in Floodlight Housing
I have been tinkering with Raspberry Pi's for a while now using them for a small variety of things but mainly as a CCTV camera for monitering my home whilst away with the ablility to remotely view a live stream but also receive emails of image snapshots when motion is detected.
For a while I have wanted to put one of these cameras up outside and directed upon my front door, but the problem for me was always the aspect of protecting all the parts from the weather, particularly ensuring it is waterproof. After a bit of thinking about it and looking at a flood light I had laying around I decided this would be the perfect housing to use as they are IP44 rated.
So herewith, outlined in my first Instructable, are the steps I took to create this camera set up. :-)
Parts you will need:
- Raspberry Pi Zero W
- USB-A to micro-USB cable
- IP44 rated halogen floodlight
- PIR sensor for Raspberry Pi
- Raspberry Pi camera module. As the Pi Zero board has a smaller CSI connector port, a camera cable that adjust from the standard to smaller pinout is required (or you could use the already designed Pi Zero camera module)
- Old cardboard packing material, or something that is non-conductive that you could mount the camera in to secure it within the housing
- White plastic model making card
- Nuts and screws (I used 6 screws and 14 nuts) - these I salvaged from another Pi case
Tools you will need:
- Soldering iron and wire
- Wire cutters/stripper
- Electrical tap
- Scalpel and scissors
- Drill bits (1 the size of the screw mountings for the camera and PIR sensor and the other for the camera lens itself)
Step 1: Preparing the Pi and OS
First off, we need to prepare out Raspberry Pi and motioEyeOS.
As this project involves more the creation of a housing for the Pi, camera and PIR sensor. and because setting up of motionEyeOS on a Raspberry Pi has been covered quite a bit on numorous forums and possibly even on Instructables, I have decided not to go into detail on this.
Essentiall I installed motionEyeOS onto my memory card, configured my WiFi network and once it was online, customised the settings within motioEyeOS for the sensor and camera behaviour.
Step 2: Preparing the Parts (i) - Housing and USB Power Cable
Gather the parts together and begin by:
Removing the internals of the floodlight. I do not have photos of this
part of the the process unfortunately as I did not think of creating this Instructable at that stage, but basically, usingyour screwdriver open the electrical compartment at the rear of the light and disconnect all the existing wires. We will not need any of these so they can be disposed of. Open the front of the light and remove the bulb (if one is present), unscrew/remove the refelector shield, followed by the bulb terminals. Again, these can be disposed of.
Next, using our wire cutter, we need to cut the microUSB end off of the
USB cable, this is so that it can be fed through the existing cable holes on the light. I estimated roughly 15-20cm's from the end of the cable to allow for enough room for play, however I think 15cm would be adequate.
Gently strip away the ends to expose the individual cables, taking care
to keep the foil shield in tact and using the wires strippers expose the ends.
We then need to feed the long end of the cable through the whole in the
electrical compartment, using the whole and seal provided, followed by the short end we cut off earlier through the whole in the light tot he electrical compartment.
Once I had the cables in place, I re-joined the electrical ends by
twisting them together and then using the soldering iron added a bit of solder to make a good electircal contact. I then wrapped each end in a piece of electrical tape an finally grouped them all together and taped them up. Take care to ensure none of the individual copper/silver of the wires is exposed.
Finally securely screw the electrical compartment back together.
Step 3: Preparing the Parts (ii) - Pi Board, Camera and PIR Sensor Mounting
Next I began assembling the camera 'mount' to go inside the floodlight. For this I used an old piece of cardboard packaging that my new kettle had come in and using the scissors and scalpel cut out a section that would fit snuggly in the light. I also created a grove to slide the Pi board into (as the cardboard I used was L-shaped. I was able to just 'suspend' the Pi board in the middle of the casing this way.
At this stage I also wired up one end of the PIR and camera cables to the board.
Using the rigid plastic white board I had lying around from some other project I carefully measured out where I would place the camera and sensor modules and marked out the screw holes along with the hole for the lens and for the PIR sensor. I also cut it to size so that I could wedge it into the light enough to allow for the glass window of the floodlight housing to close properly.
Using the scalpel I cut out the square for the PIR sensor.
Using the drill bits I made the screw holes and the camera lens hole.
I then mounted both camera and PIR, screwing them securely in place using the screws and nuts.
I then connected up the cables for PIR and camera and plugged the USB power lead in to the Pi board.
The final thing then was just to wedge the plastic board in place and close up the light.
I have not as yet completed the mounting of the light outside but as soon as I have done so, I will update this Instructable with that :-)
Thanks for reading.