This project will show you how to create a laser toy for your cat which is controlled over the web with a Raspberry Pi. The project demonstrates using a web application to control servos with the Raspberry Pi and
an excellent way to keep your cat exercising when you're umm busy playing minecraft.
You can see an early version of the project on the September 7th adafruit Show and Tell show (~12 minutes into the show)
To build this project you will need the following:
- Raspberry Pi (either model A or B will work).
- Two servos, like these micro servos.
- Laser diode. You can buy one or scavenge one out of a laser pointer (what I've chosen to do in this project).
PWM/servo controller based on the PCA9685 chip.
- Network camera that can output a MJPEG video stream. I use this Wansview camera, but check for support from other brands such as Axis, Foscam, etc. See the note on video streaming below to understand why a network camera is used instead of a webcam or other video source.
You will also need basic tools and supplies such as a hot glue gun (or other means of fastening servos and laser diode), a power supply for your laser diode and servos (your Pi's 5V output is not powerful enough alone--use a battery pack, wall wart, or bench supply), and wires to connect the Raspberry Pi GPIO to the servo controller board. A breadboard and Pi Cobbler breakout
are perfect for this project.
This project assumes your Raspberry Pi is running the Raspbian operating system, is connected to your network, and is setup to enable I2C communication. If you use a distribution such as Occidentalis
much of this setup is done for you already. However if you need to setup your Raspberry Pi, follow these guides:
Finally, the web application that is used in this project will only work on Chrome, Safari, or Firefox web browsers. Unfortunately Internet Explorer does not support MJPEG video streams in image tags, which is a required part of using the application.