Introduction: Dog Wearables (Live Streaming Dog Camera)
This is a project of a live streaming camera I made with my friend Jeff for our Physical Computing Class at the VCU Brandcenter. It was inspired by the relationship five little girls I used to babysit have with my dog Borealis. I wanted to give them a way to see his adventures online now that we live in two different cities.
You can easily make adjustments and put it on your own backpack or turn it into a security camera.
Here is what you will need
- Raspberry Pi B+ (you can make adjustments and use a B)
- Raspi Cam
- USB Wifi dongle
- Solar Panel
- USB/DC/Solar Lithium Ion/Polymer Charger
- Power Boost (500 or 1000)
- JST 2-pin cables
- Lithium Ion Battery Pack
- DC Male connector
- USB to micro USB cable
- Dog Backpack
- USB Flash Drive (optional)
Alternatively you can use a Portable Travel Charger.
- Needles and Thread
- Felt or other soft material
- Insta Morph Plastic
- Soldering Iron
- Heat Shrink
- Electric Tape
- Iron on patch
Step 1: Putting Together the Solar Panel
If you don't want to adventure into Solar Energy you can substitute this step by getting a Portable USB Charger. The kind you can buy for your Phone.
- Solder wires to the Solar Panel. The adafruit's solar panel positive lead has a slight orange tint to it and the negative is just silver.
- Strip the DC connectors wires. Pull the heat shrink tubes high up on the wires.
- Solder the positive leads and negative leads together. Pull the heat shrink over the solder points and heat them up to seal the connection.
- Solder two of the JST 2-pin cables together in the same way. Don't forget the heat shrink. (you can use electric tape, but heat sharing works better)
- If your Lithium Ion Battery does not come with the JST 2-pin cables, solder one in.
- The Power Boost's USB needs to be soldered into place as well.
- Finally connect all the pieces together. The Solar Panel's DC connector plugs into the DC plug. The Lithium Ion battery connects to JST 1 and the Power Boost to JST 2 (as show in the picture)
Step 2: Setting Up Your Raspi Cam
If you have used a Raspberry Pi before, you will be familiar with many of these steps, but if you are new to it they will be very helpful.
- Plug in your Raspi Cam's Ribbon connector to the Raspberry Pi. The connector can be found right next to the Ethernet Plug. This video will help you locate it.
- If you are working with a Cana Starter Kit, your SD card will already have the Noobs needed for the Raspberry, so power it up, hook up a monitor and a keyboard and install the Raspian software. The Raspberry Pi Offcial Page has a very well written instructions on how to do it. If you have worked with the Raspberry Pi before, you can skip this step.
- Once you installed the software, the Raspberry Pi configuration screen should pop up. If not just type in: pi@raspberrypi~$sudoraspi-config
- Select the Enable Camera option, click Enter. Select Enable with the arrows and Click Enter. If you don't see the option, you might need to update your software by typing in:
pi@raspberrypi~$sudo apt-get update
pi@raspberrypi~$sudo apt-get upgrade
Then Enable your camera.
- You might want to reboot your Pi just to make sure that all the configuration settings are saved.
Step 3: Setting Up Streaming
There are many different ways to set up a stream from the Raspi Cam, but the one that requires the least amount of worry about devices and browsers from which people will watch your stream is the Mjpg-Streamer set-up.
Before you do anything. Make sure your wireless dongle is connected to your wifi. Now we need to make sure you are properly connected to the wifi.
Type the following to start GUI (Graphic User Interface):
Now you will have to launch the WifiConfig from your Desktop.
You want to make sure that your wifi connection is stable. If your connection is unstable your Wifi Config application will show you continually connecting and disconnecting. Streaming requires you being connected at all times so make sure you are using the best network (I used the hotspot on my phone and it worked great)
The application should also show you your IP address. Take note of it. You will need it later. It should look like this: 192.168.1.116
We used the Instructions written up by Miguel Grinberg to get this portion working. They will lead you step by step.
It will be useful for you to know that you can play around with options for the raspistill command (taking still shots), and you can do the same for raspivid command.
Simply type the following into your terminal:
Step 4: Creating a Local Host Tunnel
Now you have your camera streaming to your local network. This is great if you just want to use your RaspiCam as a local security network, but it will not allow you to view the footage if you are at work or out for a walk with your dog. The quickest and easiest way to change that is to create a tunnel from the internet to your local network, it will also not cost you a dime.
To accomplish this we used ngrok.
- First type the following into your Pi terminal to start the GUI (the graphic interface on the Pi)
- Once your interface loads, open up a webpage and go to ngrok.com, then click on downloads.
- From the list, select the fourth option. Linux/ARM
- Now open up your Terminal on the Pi (you should easily find it on your desktop) and type in
pi@raspberrypi~$ unzip /path/to/ngrok.zip
Here the /path/to/ stand for the location to which you downloaded your file. I downloaded it to /home/pi/, which allows me to just type
- You are almost done. Do you recall the address you used to look at your stream in the local network? It should have been something like: 192.168.1.116:8080
We will use this address to tell ngrok which local network it should be running the tunnel to. Type:
Make sure you use your local IP.
- If you can't remember your local IP you can check it really easily through the terminal. Type:
- The ngrok software will display a website address from which you can now watch your stream. It should look something like this: http://78a76497.ngrok.com
- You can now send this address to whomever you want to see the stream you created.
Step 5: Putting It All Together
So now you have a working Solar panel and a working RaspiCam. You need to make sure that all of your parts are safely protected from the weather. For that we used Insta Morph. It's is a plastic that melts in hot water and is very moldable, but when it cools down it becomes hard.
We had a case for the Raspberry Pi from the Cana Kit, but if you don't have one, Insta Morph is a great little tool to make one.
- Make a case for the RaspiCam. It is very gentle so make sure you use some felt of packing materials to protect the back of it in the case. It also helps in holding it tightly in it's case.
- The ribbon strip that connects the RaspiCam to the Raspberry is very gentle. Make sure you build a sturdy case for it as well. We wrapped the ribbon connector around the Raspberry Pi's case and build an Insta Morph Shell around it to protect it. Make sure you don't kink the ribbon. It can cut the connection between the camera and the Raspberry.
- It is a good idea to make a case for the PowerBoost and battery pack. We just used a simple small box and secured all the cables in place (that is especially important for a dog camera since they will be moving around, rolling in the grass and shaking their backpack).
- Saw the Solar panel onto the top of the backpack to make sure it is getting plenty of sun.
- If you chose to skip the Solar Panel, make sure to secure the Portable Charger. You want to make a pocket for it to, since you don't want it to fly around inside the pack and disconnect.
Now you are ready for some field testing.
Step 6: Field Testing
When it comes to working with dogs (and many humans too), make sure you field test before you publish. In my case, we run into a few kinks with how the parts were secured in the backpack and the solar panel not getting enough sun. So take it out a few times and see how it goes.
In the process of field testing, it might be helpful for you to create a command for your raspberry pi with all of the steps rather than having to type all of them into the terminal over and over again. If you want to learn how to do that, send me a message.
A quick and simple solution for all the typing... use the uparrow on your keyboard. It brings up the most recent commands you wrote out.
Hope you have fun with this one!