The fake camera looks like this out of the box.
Take off the cover, which clips on. There are no screws
Remove the back cover, which has four screws.
Remove the front cover, which has four screws
Step 4.1. Take apart the Camera Enclosure
With a long thin Phillips head screwdriver take apart the camera case. See images above.
Keep the leads to the red LED (see image below on right), but clip off all other wires including the fake wire coming out of the back cover. The solar panel will not be used.
Continue taking apart the camera following the images below. I tried with and without the plastic lens. The plastic lens reflects light and causes videos to be hazy.
Remove the fake LED ring. It has 3 screws. Pop out the fake camera insert (smaller round tube in middle of image) and throw it away
Unscrew the inner ring. Pop out the plastic clear lens (lower middle) and throw this away.
Shows the leads to the Red LED in the fake LED ring. It is fake because all the white LEDs are not connected to anything.
Raspberry Pi GPIO pins provide either 3.3 or 5 Volts (V). The maximum current draw (I) for a Raspberry Pi per GPIO pin is 16mA. And a total of 100mA. The PoE Hat provides power and does not subtract from the 100mA maximum.
The white LED is spec'd at a maximum of 600-700mA. However, the white LED works with current below 16mA. Ohm's law is:
I = V / R
The red LED that comes with the camera uses a 1.5K Ohm resistor. The Raspberry Pi's pull-up/pull-don resistors are rate at ~50K Ohms.
2.2mA = 3.3V / 1.5K Ohm
Resistor calculator Brown, Green, Red, Gold = 1.5K Ohm resistor, connected to 3.3V
Because I am lazy, I was going to use the same resistor for both the red and white LEDs. However, I was disappointed with the intensity of the white LED and 1.5K Ohm resistor.
The image shows two identical white LED lights. The one on the left uses the 1.5K Ohm resistor, and the one on the right uses a 220 Ohm resistor (15mA = 3.3V / 0.220K Ohm).
Start with two sets of two different color jump jumper wires. Need the female end to connect to Raspberry Pi GPIO pins
Use one color for ground (blue) and the other for power (red)
Cut the wires to between 3-4 inches
Strip about 1/4 inch from end of each wire
Cut the red wires about 1/2 inch from the female connector. Strip 1/4 inch from the resulting wires, as shown above
Cut three sections from a 1.5mm Heat Shrink tube
Solder a 1.5K Ohm resistor as shown for the red LED or a 220 Ohm resistor for the white LED
Push the Heat Shrink tubes in place around the resistor. I shutoff the solder gun and use the barrel of the solder iron to gently shrink the tube
Step 4.3. Create two sets of LED wires
My fake camera enclosures uses a red and blue wire (the colors are arbitrary and might be different with your camera)
Follow the directions above from left to right and build two sets of wires. One for the red LED (uses 1.5K Ohm resistor) and one for the white LED (uses 220 Ohm resistor)
The resistors should be far away from the camera's ribbon cable, which is why they are close to the GPIO pins..
Solder a red (+) and blue wire (-) to the appropriate end of each LED.
The white LED has plus and minus marked on the leads.
The red LED's flat side is negative (-), and the other side is (+)
Step 4.4. LED Lights and fake LED ring
Red LED
The red LED that comes with the enclosure blinks. Gently twist out the Red LED from the fake LED and toss it away.
Raspberry Pi Ground (physical pin 1) is connected to flat side of the red LED using blue wire
Raspberry Pi 3.3V pin (physical pin 6) is connected to round side of the red LED using red wire (1.5K Ohm resistor)
Insert a red LED with the wires in the hole where the blinking LED was removed. Push it in tight and use hot glue to hold it in place
White LED
The PoE Hat uses the 2x2 header pins and the I2C pins
Raspberry Pi Ground (physical pin 9) is connected to the "-" lead on the white LED using blue wire
Raspberry Pi GPIO 17 (physical pin 11) is connected to the "+" lead on the white LED using red wire (220 Ohm resistor)
There is another hole similar to the blinking red LED, in that hole put the white LED with its wires attached. Use hot glue to hold it in place
Screw the inner ring back in. Use the lower holes
Screw the fake LED ring back into the front cover
Twist out the existing red LED
Insert the red and white LEDs and hot glue. Align LEDs so the leads can reach GPIO pins on Raspberry Pi
Put the bottom two screws into the front cover and into the camera body's bottom.
In the image above, I confirmed the camera body top could slide into the front cover
The inner ring holding the lens in place has 3 screw holes that are lower than the top.
The notches on the fake faceplate must align with through holes on the front cover
The blinking red LED in the fake face plate needs to be at the top when the face plate is attached.
Remove the red LED that comes with the faceplate by gently twisting with a needle nose pliers
Hot glue the white LED at the top and the red LED on the side.
Both of these need to be above the 1/2-way point because this where the Raspberry Pi board will rest.
Step 4.5. Add Raspberry Pi to Enclosure
Put the case back together following the images above for the front cover
Hot glue the camera and the Raspberry Pi into the body of the camera following the images below.
Mark the "+" and "-" for each LED on the fake LED ring.
Before closing it all up, test if the white LEDs can be controlled
$ gpio mode 0 out # set pin 17 to output mode
$ gpio write 0 1 # turn white LED on
$ gpio write 0 0 # turn white LED off
Hot glue the camera to the front cover
Be sure it is correctly aligned with the top of the camera front face.
Hot glue the USB and Ethernet end of the Raspberry Pi into the case. Use the hot glue generously
Put some small dabs of hot glue at the front, being careful not to touch the camera ribbon cable
Step 4.6. Put the top cover on
The top cover is the same shape and size as the bottom cover. Wait on the longer top cover for a later step
Gently bend the pins and camera ribbon cable so the top case can be put on. Try to minimize sliding the top case.
Put in and tighten the two screws in the front cover
Step 4.7. Put the back cover on
An ethernet cable will not fit in the back cover hole (see image below).
Using a 7/8 inch bit, drill a hole in the back cover new the top
Remove the nut and rubber gasket from the Waterproof RJ45 connector
Push the long end through the back cover. On the outside, pull the gasket down to the back cover. Put the nut on and tighten so the rubber gasket makes a strong seal. The tab on the ethernet connector should face up on the inside.
Put the Ultra Short 3 inch ethernet cable in the Raspberry Pi and into Waterproof ethernet connector.
Put hot glue in three spots around the waterproof connector:
Around the threads on the inside
Around the base on the inside
Around the rubber gasket on the outside
Slip the back cover on and insert the four back screws
Put hot glue in the back cover screw holes
Step 4.8. Seal the Camera and put the longer top on
My cameras will be mounted on the eaves (or soffit) under the roof. So, they shouldn't get water on them. But, just to be certain, ensure there are no openings that will let in water or bugs.
Put hot glue everywhere it is needed to prevent water or bugs from crawling into the enclosure. I assume the camera will be angled down once installed. Here are the spots I hot glued:
Battery tab and edges of battery opening
The fake ethernet hole
The four points where the front and back covers touch the middle rib on the case
The four screw holes in the back
Put the longer top on and then from the backside fill the gap between the longer top and the case with hot glue
Step 4.9. Motion Notifications
There are two things to do when motion is detected:
send a text message
turn on the white LED
First install some supporting packages (python2.7 is the default, I prefer python3):
$ pip3 install astral
$ pip3 install python-dateutil
$ pip install astral
$ pip install python-dateutil
Get the script from github:
$ cd ~/.
$ wget https://raw.githubusercontent.com/dumbo25/security-camera/main/motion.py
Open a browser
Enter url: http://<-your-camera-hostname>:8765/
Go to hamburger menu and scroll down to Motion Notifications
Select Run a command
Enter:
/usr/bin/python3 /home/pi/motion.py
Click Apply
I was hoping running the cable would be easy because it is winter in Texas so the attic isn't terribly hot. And my rack mounted PoE switch backs up to the attic. All I have to do is run the cable from the attic into rack enclosure (easy) and then drill a hole from the outside of the soffit or eave into the house, and then run the cable through that hole.
Getting into the corner is difficult because all of the joists are covered by 6 or more inches of fluffy insulation, and my interior roof has shingle nails coming through.
I ended up using a flexible plastic rod, pushed in from outside, and hooked the ethernet cable to it. Then went back outside to pull it through. Sounds easy. But the first camera took about two hours to install. Once I worked out how to do it, I thought subsequent installs would go faster, but I do not seem to have the right skillset to run the cables.
I hired an installer to run the cables, and he did a much better job. He ran all three remaining camera cables in less than 1.5 hours. He used unterminated cable; drilled a much smaller hole than I did. From the outside, he used a stiff metal rod to push through from the outside to the switch. He used special hangers to attach the cable to the inside of the fascia making it much less visible.
Step 4.12. Mounting Camera to House
Each of the four corners of my house, where a camera is mounted, looks like the image. It is an architectural ornament and doesn't seem to have any functional purpose.
There is a thin sheet of vertical hardy board or masonite. The camera is lightweight. So, I drilled a small pilot hole and used the screws provided with the camera to attach it. I did not use the plastic anchors.
The wire in the photo is loose. I have secured the wire in the corner of the eave. I left a little play at the end, and then hot glued the ethernet connection so no water could drip in.
References:
Notes about references:
Format: Author/Source, Title with Link, Brief Description
There are many excellent references making this quite an easy project.
I read through most of them, and listed them in order of importance to me. Each takes a slightly different approach.
elinux.org, RPi-Cam-Web-Interface, reference
Instructables: MisterM, Raven Pi Security Camera, shows how to add MotionEye to Raspberry Pi OS
github: Calin Crisan, MotionEye OS install on Raspbian, this is really part one of installing MotionEye on Raspberry Pi OS
github: Calin Crisan, MotionEye Installation, the above is better, but this makes it complete
Instructables: scavix, Raspberry-Pi-as-low-cost-HD-surveillance-camera, this was my inspiration. Uses Wi-Fi and motion
howchoo, How to Build a DIY Raspberry Pi Security Camera, howchoo always has great guides
How To Build a Custom Video Surveillance System, excellent!
ReoLink Surveillance System, $399
PiMyLifeUp: Gus, Build a Raspberry Pi Security Camera Network, solid tutorial uses MotionEye OS
Instar, MotionEye Wiki, very complete list of instructions on installing and configuring MotionEye
Tom's Hardware: Les Pounder, How to Create a Raspberry Pi Security Camera with Motion Alerts, uses telegram and IFTTT and is detailed such as setting up a motion sensor
bouvet, Building a Motion Activated Security Camera with the Raspberry Pi Zero, use Camera Noir, Motion and Pi Zero. Excellent evaluation of final videos
How To Build a Custom Video Surveillance System, excellent!
Arrow Electronics, MotionEyeOS Camera Setup on Raspberry Pi Zero W, uses motioneye os and RPi zero
Make Use Of, Build a Motion Capture Security System Using a Raspberry Pi,
MagPi, The Official Raspberry Pi Camera Guide, Chapter 16 Set up a Security Camera
Instructables: nochanceinhell3856, Raspberry Pi DropCam Alternative, uses DropBox and Motion
Raspberry Pi Tutorials, How to setup a Raspberry Pi Security Camera Livestream, uses Motion
TechRadar, How to build a Raspberry Pi Security Camera, uses an apache2 website and motion
hackster.io: Narender Singh, Portable Video Streaming Camera with Raspberry Pi Zero W, uses motion very quick setup
MalwareBytes Labs, How to build your ownMotion Activated Security Camera, uses a different camera and has detailed troubleshooting and motioneye setup explanations
ITPro: Mark Mayne, How to build a Raspberry Pi security camera, assumes reader knows a lot
Troubleshooting:
check if codec is enabled
vcgencmd codec_enabled H264
Raspberry Pi Camera troubleshooting
Future Improvements:
Could it be done with a Raspberry Pi zero?
Could OpenCV be added (or are the exclusive)?
Motion and MotionEye do not support audio yet. If this is added, then this would be a great future improvement.
Add rpi-monitor?
Allow access from outside my home's LAN to the main server using self-signed cert, or store significant videos to Google Drive.
Finsihed!. Go to a previous part of the Security Camera project or add another camera.