This project uses a Freeduino (Arduino clone) microcontroller
Objective
The basic idea here is to create some laser patterns that are in sync with music (or any audio) input.
Pattern Generation
The patterns, called Lissajous Figures, are generated using a laser and 2 motors with mirrors attached to them. (The laser source can be a cheap laser pointer.) The laser bounces off one mirror, then on to the the next before being projected on a flat surface. The Arduino board controls the speed and direction of rotation of the motors, and by varying these, various patterns can be created.
Motor Control
To control the speed and direction of the motors with the Arduino, we use an H-Bridge. You can read more about this in this tutorial at bildr.org. I am using the exact same configuration here.
Syncing with Audio
To make the lasers dance with the music, the rotation of the motors needs to match the music somehow. Here it is done by analyzing the frequency content of the audio stream and converting that into motor speed/direction information. To split the audio into frequency components, we use the Discrete Fourier Transform. We use Python to do this job, and send the motor speed/direction information via the serial interface to the Arduino, which updates the motors.
Please note that to run the Python code, you need to have scipy, numpy, pyserial, and pyaudio installed.
Source Code
The source for both the Arduino and the Python code can be found here.
Steps
Step #1:
Next



- Attach mirrors to the motor shafts. Do this by putting a drop of hot glue at the center of the backside of the mirror, and holding the motor so that the shaft is slighly off the perpendicular.
- Solder wires to the motor, and attach the motors to the wooden blocks using the hot glue gun. The wooden blocks are used only to prevent the mirrors from hitting the ground while rotating. You can use any alternate mechanism that achieves this objective.
Conclusion
Hope you have fun building this project.
There are different variations you could try on the above project. For instance, you could try a different method for converting the frequency information to the motor direction/speeds. Another idea is that you could modify the Python code to play an MP3 file, instead of reading from the built-in mic.



























