Bird Nest Cam
After finding the nest of a Carolina Wren in our garage, I wanted to setup a live stream to keep tabs on the nest. I had a busted switch laying around that didn't make the trash for some reason and decided to gut it out and use the case for a raspberry pi based streaming camera.
Supplies
Case that will fit a Raspberry Pi 3 and the 2.1 noir camera.
1 normally open momentary push button
15 IR LEDs
5 57Ohm resistors
a bit of wire and heat shrink tubing
5v 2amp power supply
Gutting the Case
Remove the innards of the switch and any screw posts or other items that might be in the way.
Install Stand-offs
I made a quick paper template of the hole pattern on the rpi and transferred that to the case. I used a dremel to drill the holes and used nylon standoffs I got from adafruit some time back. The fit into the rpi holes was very tight. I had to remove the posts from the case and then thread them into the rpi as they wouldn't just slip into the mounting holes.
Wire Up Button
The button is a simple two wire job with one lead going to ground and the other a GPIO pin.
There is some good info at this link to review in order to get the button working, as there is the need for a small script. https://howchoo.com/g/mwnlytk3zmm/how-to-add-a-pow...
Mounting the Camera
I followed the same idea with the camera as I did the rpi board. Small paper template, drill some holes,and mount. I also used the dremel to make a hole for the ribbon cable that connects the camera to the rpi. I really made that opening look like poop!
One thing to watch out for here is to ensure you have the cable facing the proper way in the rpi in the board and in the camera to ensure there won't be any unneeded twisting of the cable.
What's Your Clearence, Clarence.
After installing the camera, I did a test fit of the top plate and realized the rpi is sitting way too high. I was using stand-offs that were .395" and switched down to .243" and all was well.
IR LED Array
This was the most time consuming part of the build for me. Drilled holes for the LEDs, wired up resistors, wired the LEDs in series, attached leads to each series, and then wired in parallel. Initial testing here seemed to indicate that the lights were not working but it ended up being the fact that I wasn't providing enough power to the board. I switched from a powered usb hub to a dedicated 2 amp 5v wall plug and the lights worked fine.
I found http://led.linear1.org/led.wiz useful to calculate the wiring schematic for the led array.
Almost Done...
With a dremel, I cut a groove in the far end of the case bottom to allow clearance for the power cord.
Build Complete
After the build was complete, I installed the latest Raspbian.
I used https://github.com/mpromonet/v4l2rtspserver to provide the RTSP stream using the below commands. These can be run at the terminal or configure into a systemd service.
/usr/bin/v4l2-ctl --set-fmt-video=width=1296,height=972,pixelformat=H264 --set-parm=25 --overlay=0 --set-ctrl=vertical_flip=1,horizontal_flip=1
/usr/local/bin/v4l2rtspserver -f -F 0 -u live /dev/video0
I have a Blue Iris server running on my network that takes the rtsp stream and creates a rtmp stream that I have youtube live consuming.
There are alternatives to go direct from rpi to youtube live but I didn't explore any of those options as I already knew I could leverage the blue iris server.