For all cat lovers, who remain busy in their daily schedule and work, Tony Di Cola from Adafruit has come up with a fabulous way to keep your cat busy exercising. He has created a laser toy which is controlled over web with a Raspberry Pi.
In order to build this project, tony used a Raspberry Pi of either model A or B as both will work. Two servos, just like micro servos and a Laser diode. Further, PWM/servo controller based on the PCA9685 chip and a network camera is used instead of a webcam or other video source that can output a MJPEG video stream is used as network video cameras, such as those used for security and monitoring, work best for streaming video.
Other basic tools like a hot glue gun, a power supply for laser diode and servos and wires to connect the Raspberry Pi GPIO to the servo controller board is also needed. Moreover, a breadboard and Pi Cobbler breakout are also required for this project.
The project aims to demonstrate, using a web application to control servos with the Raspberry Pi and it is assumed that Raspberry Pi is running the Raspbian operating system. The system is connected to network, and I2C communication is enabled. To setup the Raspberry Pi, prepare a SD Card for Raspberry Pi then configure it for the first time and set up the network and GPIO. You are now done with raspberry set up
Tony has used the web application that can only work on Chrome, Safari, or Firefox web browsers. It means that Internet Explorer does not support MJPEG video streams in image tags, which is a required part of using the application. To expose click and other events to the parent web page, the web browsers enforce a strict cross-domain security model which does not allow a video embedded in a frame or object and hence targeting the laser with clicks on the video is not possible
He tried to use a webcam that streamed video to sites such as Ustream or Livestream, but the latency of those streams was extremely high and further embedded video streams such as from video streaming web services are not easily adapted for the control needs of this project and hence it is not possible to control the laser through the web in real time.
Using a network video camera that outputs an MJPEG video stream solves all the problems as it has a low latency encoding. Further it has the ability to embed directly in an image tag which is not subject to as strict cross-domain security restrictions.
The complete details along with video streaming of this project is available on the website of Adafruit and the project is owned by Tony Di Cola. If you are interested, then follow the website given here
Filed Under: Reviews