USB Camera System

Shopping List

USB Camera System Shopping List

Prepping Your Cams

Many USB cameras will work for this application, but make sure to check before you buy 4 if you go with a different kind! We ran into an issue with getting too cheap originally. For Microsoft LifeCam HD-3000s, the first step is to remove the flexible stand. To do this, follow the tutorial here: https://www.chiefdelphi.com/t/whats-the-best-way-to-take-off-the-rubber-mount-of-the-lifecams/341960/3. After you do this, plug the camera directly into your laptop and open the camera feed in the camera app to make sure that everything still works correctly. Then, cut off the USB end (scary!) and cleanly strip the end of the end of the cable attached to the camera (however much you want, we did about 6cm). Follow Blue Robotics guidelines on cable stripping: https://bluerobotics.com/learn/cable-stripping/#removing-shielding-wrapping-or-fillers. Gently sand the end of the cable jacket above the stripped portion and clean it well (so epoxy sticks better). Congrats! Your camera is prepped.


Prepping your Enclosures

Camera Enclosures:

Mark the center of the wall of the enclosure opposite the open side (the bottom when the acrylic plate is facing up). Drill a 1/8" hole in the center. Sand the outside of the enclosure around the hole you just drilled. Slide a camera cable through the hole with the camera side on the inside of the box, but don't fully pull the camera down yet. Put hot glue on the place where the wire attaches to the camera, then quickly pull it down so it is touching the inside bottom of the enclosure. Make sure the camera is oriented the way you want it while you do this step. If you're using the pre-drilled screw holes as mounts for your cameras, now is the time to install those mounts. Add the O-ring into the enclosure and screw the top on in a star pattern (any corner, then opposite corner, then adjacent corner, then opposite corner, then repeat). Enclosures are prepped!

Raspberry Pi Enclosure:

To ensure that this enclosure makes a good seal, we will just drill one hole at a time between vacuum tests. First, plan out a space for each penetrator which, for us, included 4 camera penetrators, one ethernet penetrator, one power penetrator, and one vent plug. The power penetrator is needed if you are not using a power source from inside the enclosure like a battery. Then, drill one 10mm hole for the vent. Install the Vent using this guide: https://bluerobotics.com/learn/wte-vent-assembly-guide/. Install the O-ring for the clear cap, then tighten the screws in a star pattern. Follow this guide to test the seal on the enclosure: https://bluerobotics.com/learn/using-the-vacuum-test-plug/. Repeat this process for each penetrator as they are ready. 

Epoxy Time 

Find an isolated clean space and lay down a disposable surface like a piece of scrap cardboard. Lay the camera enclosures clear side down with the wire coming straight out. Clamp the penetrators vertically. If you are choosing to use a potted penetrator for your ethernet cable or power source, now is a good time to epoxy those as well. Fill a disposable syringe with a well mixed 2 part epoxy, we recommend using G-flex 650 but any marine grade epoxy will work. Make sure all of the air has been pushed out of the syringe before working. Before potting, strip the ends of the wires, it will make installing USB ends later on easier. For potting the penetrators, follow these instructions from Blue Robotics: https://bluerobotics.com/learn/potting-a-cable-penetrator/. For the cameras, dispense a small amount of epoxy surrounding the wire and shift the wire around, making sure that it fully encloses the hole where the wire enters the enclosure. Now, just wait overnight or longer depending on your epoxy for it to dry.

Adding USB Ends

While the camera penetrators are curing, prep USB ends for your cameras by soldering four wires (about 10cm long) onto the USB ends from McMaster. Follow the diagram from Components 101 with D- as white and D+ as green: https://components101.com/connectors/usb-type-a-male-connector. Make sure these connections are secure, having a bad connection here will make your life so much harder later. Then, strip the opposite ends of these wires and add some heat shrink to prep them for soldering to the camera penetrators. Once the camera penetrators are in the enclosure and the enclosure has passed a vacuum test, solder the wires from your new USB jumpers onto the wires from a camera and heat shrink them to prevent unwanted conduction between wires. Using a laptop, plug the cameras directly in and make sure you can get video using the camera app. If you can't its probably a solder connection problem.

Prepping the Pi

First, flash the recommended pi OS onto your micro SD card. Do not make any customizations at this stage. Once this is done, insert the SD card into the Pi, and connect the pi to a Micro USB 5V 2.5A power supply, a monitor (using the HDMI port), a mouse, a keyboard, and ethernet cable to your laptop. The default username is pi and the default password is raspberry. Follow these instructions to SSH into your Pi from a laptop using PuTTy: https://www.onlogic.com/company/io-hub/how-to-ssh-into-raspberry-pi/. You will have to download PuTTy on the laptop you choose to use. Once you can access the raspberry pi terminal through your laptop using PuTTy, you no longer need the monitor, mouse, and keyboard connected to your Pi. For the next few steps, make sure the laptop that is connected to the Pi has an internet connection. In the raspberry pi terminal on the laptop type:

sudo apt install libjpeg-dev 

Then, type:

git clone https://github.com/kwasmich/PICS.git 

Then, type:

cd ./PICS 

Then, type:

make

Now, PICS is installed and compiled. You no longer need an internet connection. Plug in your cameras into the USB ports on the laptop. Then type:

./PICS

Now, PICS should be up and running. Go to a browser and head to http://raspberrypi.local:8080/dev/video0 . Or video 2 or 4, etc. You should be seeing a live feed from the cameras! Once you are done viewing the stream, go to PuTTy and hit control C to exit streaming mode and shutdown the pi by typing:

sudo shutdown now

This helps ensure that your pi doesn't act crazy. Do this before powering off every time. Now, securely mount all of the components inside the raspberry pi enclosure, close and vacuum test it, then mount your cameras on your robot. You now have a USB camera system! 

Operating the Camera System

Start up:

Shut down:

We found that upgrading to using USB cameras was a much bigger challenge than anticipated, so we wanted to make it easier for other teams to make this jump! This page will provide a shopping list and instructions for streaming up to four USB cameras, though you can modify them to give your cameras more capabilities beyond streaming, add more cameras, etc. Our shopping list includes everything you would need to create this system except for: a 5V 2.5A power source and a means to get it into the camera electronics enclosure, a drill, Phillips head screw drivers (large and small), sandpaper, and basic soldering equipment (like solder, a soldering iron, heat shrink, heat gun, etc.). If you need to buy everything on the list, the total comes out to about $400. Chances are, you don't! Please check before you buy. There are also simple substitutes you can make. For example, we like to use G-Flex epoxy, but if you already have a marine grade 2-part epoxy, it should work fine! Also, please read through the entire page before buying or making anything to determine if we assumed you had any common parts that you don't have or if a step is out of your reach. If you use this resource, please make sure to credit the SeaCows in your Technical Documentation, Marketing Display, and more!