This is a real beginner post – if you never played with arduino and laser you might find it fun, but it’s at the ‘hello world’ stage of arduino programing.

So I got myself some laser! I had a nice kaleidoscope green laser but I wanted to temper with it and ended up breaking it… Green and blue laser apart from being quite a nice colore laser, are really expensive. So I decided to buy some red laser to start with.

The Laser have 3 main component. The diode, which emits the light, the lens that focus that light, and the driver or the electronic component that help regulate the electricity to the diod itself, that is quite fragile by the way. My first instinct was to purchase the diode themselves, but realizing that there was some extra work needed to make them work for me, I also bough some more complete laser with the drivers and lens. Long story short I got some diodes, and some complete kit.

My plan is to create a device with arduino to have some sort of laser show. The first step was to connect one laser to the arduino board and see what are the posibility. Using the kaleidoscopic part of my other device I was able to put it on top of the laser.

Now the hard part is to find what can be interesting using only one laser and no motions control. Blinking feel too much like christmas light, strobing could be interesting, but can become annoying after a while, pulsating could be interesting… So the base is the arduino control over analogue port. A loop and analogue write.

Of course the most interesting would be to link the arduino react on the music rhythm, but that is a bit further down the road. I’ll tryout the basic arduino loop to create something interesting. The first thing I try was to simply input digital high and low – that was simply to make the laser blink. Using the digitalWrite to simplify the process. Later I started to play more with the analogue setting. I tried all I could with the blinking but the red blinking light was really resembling christmas light.

void() loop {
digitalWrite(LASER, HIGH); // turn the laser up
delay(120);                             //wait for a moment
digitalWrite(LASER, LOW);// turn the laser down
delay(120);                            // wait for a moment
}

So that wasn’t it. I tried modifying the delay, the pause and the length of the high value. Strobing was also an interesting effect, since the laser is connected to a kaleidoscope, but again not the effect I am looking for.

Adding random to the code made it a little more interesting

void() loop {
digitalWrite(LASER, HIGH); // turn the laser up
delay(int(random(1,100)));                             //wait for a RANDOM moment
digitalWrite(LASER, LOW);// turn the laser down
delay(int(random(1,100)));                            // wait for a RANDOM moment
}

That created an interesting effect. It started to give some sort of rhythm… but there is some sort of beat that is not there. Moving into the analogue realm I only started playing with fade in and fade out, as you can see, I didn’t get very far:


void() loop {

for ( int i =0; i<1000; i++)
{
analogueWrite(LASER,i);
}
delay(20)
}

Nothing very fancy, but I tried to match this with a fade out - creating another for loop. Again the effect is interesting - not too exciting but getting somewhere. And... that is where I got! If you have any idea what can be fun ~ I am giving up for now until I find more to do with arduino programming. I have also ordered some servo or controllable engines to give more flexibility with the project. Also I will be looking into the music integration where there could be some sort of reaction to the music from arduino, but that seems far down the road.

Leave a Reply