This project is dedicated to make a kind of laser harp with an arduino board, a laser module, a phototransistor, and a speaker.
I'm more and more interested in sound generation using hardware and coding. This is part of my investigations.
&
In this first version, the laser module points toward the phototransistor, allowing to detect any cut of this light "chord". Each time such an event appears, a random frequency sound with a random duration is generated via arduino tone( ) function. I used a 8 Ohm speaker through a LM386 amplification module to play the sound.
The phototransistor outputs a current intensity growing with the amount of received light. Using a resistor, we obtain an output voltage growing with the amount of received light that can be read by an arduino board.
I choosed to capture phototransistor voltage output signal as analog input of my arduino board rather than digital input. There is two reasons for this:
- to anticipate further evolutions where I could take advantage of the voltage level in sound generation
- to ensure that voltage level doesn't exceed 5 V I kept the maximum level around 3-4 V.
&
I dedicated the first 5 seconds of execution to calibration and get the maximum level of input signal, corresponding to phototransistor illuminated by the laser. Then, each time the level of input signal decrease too much, the tone( ) function is called.
&
Next step is to add chords and use more interesting sound pieces.
Comments
Please log in or sign up to comment.