Laser cat toy on servos

What just do not do in the New Year holidays? This year, he presented his cat with an electronic toy based on a laser pointer, two servos and a controller based on Mega16. It can compare the use of Mega in this scheme with shooting at sparrows from a cannon, but at that time only she was at home. It is not difficult for a person with experience in programming AVR microcontrollers to transfer it to another microcircuit, up to the Tiny series microcontrollers.

Electronic and mechanical parts.

Device diagram.

(Fig. 1)

A laser diode with optics from a laser pointer was used as an emitter. A current limiting resistor of 100 Ohms is also taken from it.

(fig. 2)

The mechanical part consists of two Corona CS-928BB servo drives purchased from a radio-controlled model store. They can be replaced by any others. Servo drives are interconnected as follows.

(Fig. 3)

For greater rigidity, the joints are made of an aluminum corner 1.5 mm thick.
The control transistor can be any reverse conductivity. I found at home only KT805BM, I successfully applied it.
The circuit is powered by a network rectifier through a stabilizer 7805 (5 Volts, current consumption no more than 300 mA).

Software part

Servos rotate randomly in a small range (not more than 60 degrees from the total stroke) to limit the position of the laser bunny on the floor, or slightly higher. A programmed shutdown of the emitter for a short time is also implemented (to give excitement to the cat).
The code is taken from a training course on programming AVR microcontrollers - Link .
Project files on Codevision AVR, PCB layout, circuit diagram in Proteus and ready firmware can be downloaded here:Project in one archive.

In the main cycle of the program, the code for receiving UART commands is left, which makes it possible to easily remake the firmware to control the device from the computer.

Device operation video -

Well, actually the video with the cat

The cat is delighted!

Also popular now: