got it done! Thanks all for the help! Btw the color is off because I'm using a blue Ray laser diode.
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?
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.
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 {.
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
Any chance of some pictures of the inside?
I am interested in how you mounted the mirrors (and motors) inside that box...
Mowcius
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
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!
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)
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?
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
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:
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...
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
Chris:
Thanks for the description of the light path - that's what I thought it was, but it looked like it would miss the top or right mirror; must've just been the pic angle!
As far as angling the mirrors is concerned - on my simple laser display project that I noted previously, I used these cassette tape drive motors that had pulleys on the shafts; I ended up just sanding an angle on the pulley, then mounting the pulley with epoxy to the mirror, then putting it on the shaft once the epoxy cured.
This wouldn't work, obviously, for these fan mounted mirrors...
It's the pic angle. I adjusted the mirrors so the beam hit one then the other etc. The faster the rpm the better. What's cool is you can slow down the speed and get a triangle, circle, flower, etc. It's 3 angles so if I had another motor/mirror I could maybe get a square maybe. From what I'm thinking that'd give me 4 points of control...
Yeah - I had only used a couple of motors on mine, and could only get simple lissajoue figures, but it was fun to play with.
At a certain point you're going to start thinking "galvs". Then you'll get frustrated by their price, and even more frustrated when you see what goes into homebrewing them...
But it might be something to try with an Arduino!
Since this is something you seem interested in, I noted before the idea of trying to mount mirrors to piezo elements, then driving them - basically, the same idea as using two speakers (in a double 45 degree arrangement) to do x-y scanning; but with piezos, maybe you could get a faster scan rate?
Then you could simulate more mirrors with waveforms, instead of more motors.
You wouldn't be able to get any more accuracy - you need feedback for that. Maybe use some servo motors in open loop fashion, then add optical encoders for feedback? You wouldn't get high speed, but you would have accuracy...
Galvs are difficult to construct, but I think with the right method of driving them (dual coil galv, with variable voltage on each to alter the angle of the magnetic rotor) and optical feedback (dual detectors space 90 degrees or so apart, in the middle an IR led, and a mirror on the shaft?) - you could get something working...
Wish I had the time to play with this stuff!
Piezos would be cheaper. I'll play with some and mount mirrors see what I can get. Vibration from speaker would distort the beam but i wonder how it'd do....
I saw this on LPF... I had no idea you were an arduino pro too!
Good job!