Laser Effect Machine

This is a PIC 18F1320 based Laser projector based on the pixel RGB led driver circuit .Instead of connecting the RGB led 2 motors and a laser is driven using the same circuit. It uses a 70mW red laser from dealextreme. A software based PWM controls two motors and a laser. The PWM varies motor rotation speed and pulses the laser.

Serial Protocol: The PIC USART is configured at 19,200bps. it listens to the serial port and accepts commands in the following format: XX YY$

for more videos visit my youtube page http://www.youtube.com/user/spiralbrain

setup

Hardware Setup:

The main hardware setup consists of a Laser and two motors. A mirror is attached to each motor in a way that the mirror is slightly tilted to the axis of the motor. when the motor rotates the mirror the plane of the mirror is not flat and projects the laser in the form of circles. each motor creates a circle from the light falling on it. this combines to create circles within circles thus creating the effect. to add to the effect the laser light is pulsed using PWM which breaks the circle into lines further enhancing it.

Application

 

PIC Code description:

The main program loop waits for a serial data received flag to be set. if a valid command terminating with a $ is received the string is processed and values for RGB are set. Timer two generates an interrupt every 128us. The interrupt code consists of a counter that counts from 0-50. All the outputs are switched on initially. if the number set matches the counter the individual output is switched off. This is done for all the 3 outputs. 128 * 50 = 6400us or 6.4ms for the cycle to complete. or 156.25Hz

if Motor 1 =10, Motor 2 = 30, and laser = 5, the waveform will look like:

Motor 1 = |¯¯¯¯¯¯¯¯¯¯|________________________________________|

Motor 2 = |¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|____________________|

laser = |¯¯¯¯¯|_____________________________________________|

 

 

 

The PIC source code is the same as the RGB Led driver and the VB application can be downloaded here.

14 Oct 2009