Go Down

Topic: Laser spirograph arduino powered (Read 10712 times) previous topic - next topic

frostin

[media]http://www.youtube.com/watch?v=fMpfoT2BVh8&feature=youtube_gdata[/media]
got it done! Thanks all for the help! Btw the color is off because I'm using a blue Ray laser diode.

keeper63@cox.net

Great work! Nice to see you got it going! What's the RPMs on those motors, anyhow? I once built such a device (hack job in an hour), but only using potentiometers (no uC involved), but my motors didn't spin fast enough and I didn't get near the number of patterns you got.

For version 2, you should add a controllable chopper motor! BTW, where did you get the laser?

:)

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

frostin

No idea on speed on motors they are 5v computer fans that I got from the guy who made "poor man laser spirograph," which he mounted the mirrors onto the motors. The laser I harvested out of a phr803t sled. It's fitted inside an aixiz module with a rckstr laser driver I set at about 50 ma or so. Made my own pcb, added 2 heatsinks for each lm7805. It effectively runs off a 9v 1000ma wal wart or you could use batteries to make it portable. Next version I'll redesign the board, and be using a red, green, and blue laser to combine the beams and get different effects. For now I can show this off at work and to friends ;). Think I'm going to be making a smoke machine for some cooler effects.

frostin

Code: [Select]

const int switchPin = 2; // switch connected to digital pin 2
int pot1 = 0; // pot1 connected to analog 0
int pot2 = 1; // pot2 connected to analog 1
int pot3 = 2; // pot3 connected to analog 2
int val1 = 0;
int val2 = 0;
int val3 = 0;
int motor1Pin = 5; // h bridge pin connected digital 5
int motor2Pin = 6; // h bridge pin connected to digital 6
int motor3Pin = 10; // hbridge pin connected to digital 10
int enablePin = 9; //h bridge enable pin connected to digital 9
int enablePin1 = 12; // hbridge enable pin connected to digital 12


void setup()
{
Serial.begin(9600);
 pinMode(switchPin, INPUT);
 pinMode(motor1Pin, OUTPUT);
 pinMode(motor2Pin, OUTPUT);
 pinMode(enablePin, OUTPUT);
 digitalWrite(enablePin, HIGH);
 digitalWrite(enablePin1, HIGH);



 


}
void loop()
{
if (digitalRead(switchPin) == HIGH) {
 val1 = analogRead(pot1);
 val1 = map(val1, 0, 1023, 0, 255);
 analogWrite(motor1Pin, val1);
 Serial.print(val1);
 Serial.print(" Motor 1: ");

 val2 = analogRead(pot2);
 val2 = map(val2, 0, 1023, 0, 255);
 analogWrite(motor2Pin, val2);
 Serial.print(val2);
 Serial.print(" Motor 2: ");
 
 val3 = analogRead(pot3);
 val3 = map(val3, 0, 1023, 0, 255);
 analogWrite(motor3Pin, val3);
 Serial.println(val3);
 Serial.print(" Motor 3: ");
}
else {
delay(1000);
 analogWrite(motor1Pin, 100);
 delay(2000);
 analogWrite(motor1Pin, 124);
 delay(2000);
 analogWrite(motor2Pin, 100);
 analogWrite(motor2Pin, 200);
 analogWrite(motor3Pin, 155);
 delay(2000);
 analogWrite(motor1Pin, 200);
 analogWrite(motor3Pin, 0);
 analogWrite(motor2Pin, 167);
 delay(2000);
analogWrite(motor3Pin, 0);
analogWrite(motor2Pin, 130);
analogWrite(motor1Pin, 180);
delay (2000);
analogWrite(motor3Pin, 109);
analogWrite(motor1Pin, 190);
analogWrite(motor2Pin, 205);
delay (2000);
analogWrite(motor1Pin, 115);
delay (100);
analogWrite(motor3Pin, 160);
analogWrite(motor1Pin, 0);
analogWrite(motor3Pin, 135);
delay (2000);
analogWrite(motor3Pin, 140);
analogWrite(motor2Pin, 200);
analogWrite(motor1Pin, 190);
delay (2000);
analogWrite(motor1Pin, 100);
analogWrite(motor2Pin, 0);
analogWrite(motor3Pin, 0);
delay(100);
analogWrite(motor2Pin, 152);
analogWrite(motor1Pin, 0);
analogWrite(motor3Pin, 115);
delay(100);
analogWrite(motor1Pin, 199);
analogWrite(motor2Pin, 140);
analogWrite(motor3Pin, 178);
delay(2000);
analogWrite(motor3Pin, 100);
analogWrite(motor1Pin, 0);
analogWrite(motor2Pin, 0);
delay(100);
analogWrite(motor1Pin, 240);
analogWrite(motor2Pin, 200);
analogWrite(motor3Pin, 120);
delay(2000);
analogWrite(motor1Pin, 170);
delay(100);
analogWrite(motor2Pin, 200);
analogWrite(motor3Pin, 130);
delay(2000);
analogWrite(motor1Pin, 0);
analogWrite(motor2Pin, 0);
analogWrite(motor3Pin, 0);
delay(100);
analogWrite(motor3Pin, 105);
analogWrite(motor2Pin, 105);
analogWrite(motor1Pin, 235);
delay(2000);

}
}

Now, say I get a cool effect using the pots, I can see what pwm they r from 0-255, read that in the serial window and make that change to what I have in the else {.

keeper63@cox.net

I just did a quick browse on the terms you used; not a bad deal on all of those parts to build a blue-violet laser module (by my estimates, probably around $50.00?) - and something that could be "tuned up" for burning power if that was what you wanted.

How hard was it to put together the module (ie, extract the diode from the sled, hook up and tune the rckstr driver, fit it all in the module, etc)? It seems like something you would need the patience of a saint and the dexterity of a ninja to put together (maybe that's an exaggeration, but it seems like something fiddly, nonetheless!)...

It seems like everywhere I look, I see yet another project that I just don't have the time for!

:'(

;D
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

mowcius

Any chance of some pictures of the inside?

I am interested in how you mounted the mirrors (and motors) inside that box...

Mowcius

frostin

#6
Feb 21, 2010, 04:57 pm Last Edit: Feb 21, 2010, 05:14 pm by frostin Reason: 1
I'll post some pics when I can. It took a while to get a position I liked for the mirrors. For the laser I disected it very easily. I have a tool that presses the diode inside the aixiz module.
The laser diode was 13 bucks, laser driver was around 15, box nd motors around 50. All the other parts prob 30 bucks or so. Alot of it I had.
The mirrors I had the guy mount on them. He has an instructable how. They have some sticky double sided tape I believe with a piece of paper to get an angle to offset the mirrors.  
The laser driver was a tight fit but it fits inside the module. Yes if I turned up the ma on driver it can burn holes etc


keeper63@cox.net

First off: What is that, putty and hot glue? LOL  ;D

Second: I am having trouble figuring out the light path; you have three fans and mirrors, but what is the path for the light (it seems like only two can be hit based on the angles of the fans and the laser - maybe it is the angles the pics were taken from)?

Now I am thinking of revamping my laser "show"...too many projects...

:)

Thanks for sharing!
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

frostin

na its hotglue. i used double sided tape to hold motors in positition. each motor is slightly angled to beam through the cut out (top piece)

frostin

#10
Feb 22, 2010, 05:59 am Last Edit: Feb 22, 2010, 06:01 am by frostin Reason: 1
from the top picture:
laser hits the left mirror, then the middle, then the right, then exits there ;)
edit:
whenevrr i press my button to run the else { itll run through the "automatic mode" but when I press it again to be HIGH it has to run through that whole program before I can manually adjust...this simple to fix in the code?

mowcius

That gives me a great thing to do with all my spare red lasers. I bet I could get some cool patterns with a load of lasers in slightly different places but directed on the same mirrors :)

Maybe I will use my green laser too - I wish I could get green and blue ones with trailing leads...

Mowcius

frostin

Quote
That gives me a great thing to do with all my spare red lasers. I bet I could get some cool patterns with a load of lasers in slightly different places but directed on the same mirrors

You could just harvest some optics out of a blue-ray drive to combine the beams ;P.... Check this out:
http://laserpointerforums.com/f64/fs-white-fusion-laser-mixing-kit-42013.html

mowcius

Quote
You could just harvest some optics out of a blue-ray drive to combine the beams ;P.... Check this out:

Yeah or almost any CD player...

I may have a play but with loads of red lasers I want to have loads of cool multiple beam effects...

frostin

What I'd do is get some single sided mirrors, some motors, and sone kind of flat surface. What'd you do is mount the flat surface on the motor shaft, then with a wedge in between it and the mirror to give the mirror an angle I think tge one I got are angled 20 degrees. And the faster the rpms of motors the better. Then u could beam each laser into a mirror but makin sure that beam does hit the others... I might build a tunnel effect who knows. I'm going to play with a fog machine with this thing see what I can get

Go Up