DIY Puppy Cam and Feeder
Ever wish you could video chat with your dog during the day, and remotely feed them treats? Probably not, but now you can with just an old laptop, an arduino and entirely too much time on your hands!
Basically, my wife and have an unhealthy love for our dog, Copper. We play with him, take him on long walks and runs, and he may sleep in the bed more often than I am comfortable admitting. However, during the day, he is mostly by himself. I had joked many times that I should build a puppy cam and treat machine to feed him, but when a friend jokingly shared a puppy cam with us on facebook, I knew I had to act.
The easy part is the video chat. Take an old laptop and turn off all screen locks and hibernation (you can leave a screensaver or screen dim on). Install skype, create a new account for your dog and set it to automatically answer with video and automatically answer calls from friends. Then, add yourself to the friend list. Call in anytime to check in on a video of your pooch.
The next part is to use a servo and arduino to dispense the food. I am not a mechanical engineer, and most of my solution was thrown together in a few minutes using duct tape, old cardboard boxes and an upside down cd container to hold food above his crate. The CD container has a hole about the size of a half dollar in it that is covered by a cardboard piece connected to an arm on a small servo motor. The arduino has code so that when it receives a 0xff byte from the serial port, it moves the arm (connecting to pin 9 of the arduino) 60 degrees and then back into place to let some kibble fall out and then cover the hole again.
The only part left is to control the arduino from the internet outside of our home. I found a lot of tutorials controlling an arduino using processing, but that seemed clunky to me. I found the serial library in python lets me write directly to the serial port. Being familiar with the Pyramid web framework, I was able to create a simple website that would send the 0xff byte to the serial port from the web (use any web framework you are familiar with). After that, set up port forwarding on your home router to send the webpage being served from your old laptop to your IP address from your ISP. You can use other services to connect this to a domain name if you wish, but I just left it connecting to the IP address knowing it may change periodically. This is a basic overview of my approach, as a step-by-step of each part would be pretty long if you are unfamiliar with the technology included. Post any questions in the comments and I'll do my best to answer them.