What just do not do in the New Year holidays? This year, I presented my cat an electronic toy based on a laser pointer, two servo drives and a controller based on Mega16. It can compare Mega's use in this scheme with the shooting of sparrows from a cannon, but she was the only one at home at that moment. A person with programming experience AVR microcontrollers will not be difficult to transfer it to another chip, up to the Tiny series microcontrollers. Electronic and mechanical parts.
Scheme of the device.
(pic. 1) ')
A laser diode with optics from a laser pointer was used as a radiator. The current limiting resistor of 100 Ohms is also taken from it.
(fig.2)
The mechanical part consists of two Corona CS-928BB servos, purchased from a radio-controlled model shop. They can be replaced by any other. The servos are interconnected as follows.
(pic.3)
For greater rigidity, the joints are made of 1.5 mm thick aluminum angle. The control transistor can be any inverse of conductivity. I found only KT805BM at home, I successfully applied it. The circuit is powered from the mains rectifier via the stabilizer 7805 (5 Volt, current consumption is not more than 300 mA).
Software part
Servos rotate randomly in a small range (no more than 60 degrees from the total stroke) to limit the position of the laser spot on the floor, or slightly higher. Also implemented a software off the emitter for a short time (to give the cat excitement). The code is taken from the AVR Microcontroller Programming Training Course Reference . The project files on Codevision AVR, PCB layout, the circuit in Proteus and the finished firmware can be downloaded from the link - The project is one archive.
In the main program loop, a code is left for receiving commands via UART, which makes it possible to easily remake the firmware for controlling the device from a computer.