Instructables

Arduino Laser Show with Full XY Control

FeaturedContest WinnerContest Winner
Picture of Arduino Laser Show with Full XY Control
Update! See Step 32 to find out how to use this project with a green laser!

Also - checkout the LaserTweet Instructable to make this project display data from Twitter:
http://www.instructables.com/id/LaserTweet-Twitter-Projecting-Laser-Show/

This project uses an Arduino and some cheap audio speakers to create a real laser show with full X and Y axis control.

The included source code lets you easily draw text and even simple pictures!

View the demo video to get an idea of what this project can do.


You should be able to get most components locally (besides the Arduino).

Assuming you already have an Arduino - expect to spend roughly $35 on this project.

If you can upload a program to an Arduino and solder - you can probably build this project in an afternoon.

Users who have built this project:
mattbeowulf - http://www.youtube.com/watch?v=AnIoWZpEWk8
minhenes (using "real" galvos) - http://www.youtube.com/watch?v=BmYg3O4hlMg
hydronics - http://www.youtube.com/watch?v=5Q3nJLA2t18
                   http://www.instructables.com/id/Guerilla-Laser/
benhgd - http://www.youtube.com/watch?v=K23-ThlCZEc
(Post a comment with your link - and I'll add yours to this list)
 
Remove these adsRemove these ads by Signing Up

Step 1: A Bit About Laser Shows

Picture of A Bit About Laser Shows
Most laser shows use galvonometers (the little boxes in the picture) or "galvos"  to aim their mirrors.

Galvonometers are electromechanical devices that rotate to different angles based on how much voltage they are provided.

A minimum of two galvos are used - one for "X" (horizontal) control and one for "Y" (vertical control).

The laser show's controlling electronics quickly adjusts galvo voltages, and turns the laser on and off - moving it around so quickly that it appears to create a persistent image.

Commercially available galvos can move to up to 50,000 different points each second.

Galvos tend to be expensive - so we'll be making our own out of audio speakers!

Step 2: Stuff You'll Need - Electronics

Picture of Stuff You'll Need - Electronics
Arduino Board
This project has been tested on an Arduino Duemilanove (Atmega 328).  Other 16MHZ Arduino boards with an Atmega 328 (such as the Uno) should work fine.

An Arduino with an Atmega 168 should work - but be aware the project barely fits into its memory - so you may hit issues adding your own functionality.

It's assumed you have a programming cable, a computer with the Arduino environment installed, etc.

Red Pocket Laser Pointer
Look for one powered by three 1.5v coin cell batteries.
If you're having trouble finding one at your favorite super store - check the pet toys section.

12v 3 Amp Power Supply
Voltage can be a bit higher or lower but needs to provide at least 3 amps of current.
You might find an old laptop power adapter at a thrift store with these specs.
Alternately - you can modify a PC ATX power supply.
Radio Shack Catalog # 22-507 would work fine - but is too expensive for what it is.
If you can't find a usable power supply locally - you can get one on eBay for about $15.

2 x 8-Ohm, 20-watt Non-Inductive Resistors
Available at Radio Shack - Catalog # 271-120
(alternatively - 2 x 6A, 50V Rectifier Diodes Radio Shack #276-1661 - see step 17 for details)

2 x 100-Ohm Resistors
Doesn't need to be exact value / wattage doesn't matter.
Available at Radio Shack - Catalog # 271-1311

2 x TIP120 Darlington Transistors
Available at Radio Shack - Catalog #: 276-2068

2 x TO-220 Heat Sinks (for Transistors)
These are required!  Without them the transistors will quickly overheat!
Available at Radio Shack - Catalog #: 276-1363

2 x 470uF 35V Radial-lead Electrolytic Capacitor
Available at Radio Shack - Catalog #: 272-1030

2 x Alligator Clips
These make connecting to the laser pointer's battery leads easier.
Variety of options available at Radio Shack.

22 Gauge Solid Core Hookup Wire
This wire easily fits into Arduino headers. Not needed if you have a better solution.
Available at Radio Shack - Catalog # 278-1221

20 Gauge or Thicker Hookup Wire
For power connections - "speaker wire" should work fine.

Green Laser Parts (Optional)
If you plan on using a green laser - check out step 32 - there are few extra parts you'll need.

Step 3: Stuff You'll Need - Speakers

Picture of Stuff You'll Need - Speakers
Two 4 to 6 inch "woofer" speakers

Speaker quality does make a difference in performance.

I've found speakers with large magnets and power ratings of 80 watts or more tend to work best.

Look for something that might be capable of producing some bass.  You should be able to easily push the speaker cone in by about a 1/4" if you press on it.

Using a speaker larger than 6" will not necessarily help (and might hurt) performance.

The speakers do not have to match.

I extracted the pictured speakers from a set of 120 watt bookshelf-sized speakers I bought for $8 at a local thrift store.

They measure approximately 5 1/2" across and are rated at 6ohm.


Advanced Technical Stuff Below (Optional Reading)

There are at least two technical variables that effect how well a speaker driver will work for the laser show.

Resonant Frequency: The frequency the speaker will vibrate at most easily on its own.

Qts or Q: This number describes how the speaker's frequency response varies around the resonant frequency.

The pictured speakers had a resonant frequency of 63hz and a Qts of .55.  They worked quite well.

I also had good luck with speakers having a resonant frequency of 81hz and a Qts of .96.

I have also tested a set of speakers with a resonant frequency of 120hz and Qts of 1.4 - which resulted in poor results.

My suggestion would be to look for a driver with a Qts between .5 and 1 with a resonant frequency between 50hz and 85hz.

Other speaker parameters (like Vas) may or may not effect project performance.

If purchasing speakers from a website like http://www.parts-express.com/ - you'll be able to select from a wide variety of speakers that provide these specifications.  

Look for close-outs / deals.  As of last check, these drivers: http://www.parts-express.com/pe/showdetl.cfm?Partnumber=299-065 looked quite promising for only $5 each.

If you want to try testing your own speakers - take a look at this site: http://www.bcae1.com/spboxad3.htm

Step 4: Stuff You'll Need - Mounting Hardware

Picture of Stuff You'll Need - Mounting Hardware
This project requires positioning the laser and both "galvos" (speakers) so the laser bounces off the first galvo, onto the second galvo, then onto the wall.

While this isn't a high-precision operation - it can be a little tricky.

The right tools for the job will depend on the exact size and shape of your speakers.

If you don't already have the items below - look in your toolbox and junk drawer and improvise!  

A Variety of C-clamps
4 clamps sized 2 1/2 to 4 inches should work for most speakers.

Spring Clamp
Used to point the laser.  

Optional: 18" x 24" Plywood Project Board
This project has a fair number of pieces to it.  Keeping everything on a project board can help keep it from getting out of control.
After you get everything working - you may want to replace the C-clamps with some kind of mounting solution that can be more permanently attached to the board (like brackets).

Step 5: Stuff You'll Need - Tools and Misc.

Picture of Stuff You'll Need - Tools and Misc.
Coleman Acrylic Camping Mirror
About $2.50 at your local sporting goods store.

2 x #6 Bolts and Nuts
For mounting heat sinks to transistors / length doesn't matter.

2 x Wood Skewers
Like for cooking Shish Kabobs.

Scotch Tape
Or any kind of tape.

4 x 2x4 Lego Blocks
These are just used as spacers. You can substitute anything of similar shape / size.

Soldering Iron
And solder - gauge doesn't matter.

Hot Glue Gun
And hot glue - attempt other adhesive techniques at your own risk.

Bandsaw or Hacksaw
Used to cut the acrylic mirror. A rotary tool with a cutoff wheel should also work.

Step 6: Cutting the Mirrors

Picture of Cutting the Mirrors
Mark two 1.5 inch squares on the back of the acrylic camping mirror.

Cut out the mirror squares using a band saw, hacksaw or rotary tool.

If using a band saw - cut face-down with a paper towel between the saw table and mirror to prevent scratching.

Be careful not to peel off the mirror's shiny backing.

Step 7: Install the Pivot Mounts

Picture of Install the Pivot Mounts
Use the hot glue gun to mount Lego blocks on opposite sides of one of the speakers as pictured.

The top of the Legos should be about 1/4" above the foam surround of the speakers.  If they are not - hot glue another object of appropriate thickness on top to achieve the needed height.

Step 8: Install the Mirror Pivot

Picture of Install the Mirror Pivot
Hot glue a wood skewer on top of the Legos - across the middle of the speaker.

The skewer will act as a pivot for the mirror.

After the glue cools, trim off the protruding end of the skewer with your cutting instrument of choice.

Step 9: Hot Glue the Mirror

Picture of Hot Glue the Mirror
Set one of the mirror squares on the speaker so it's supported by the pivot on the left edge, and the speaker surface on its right edge.

Attach the mirror to the pivot and speaker using a small drop of hot glue at each of its corners.

Step 10: Make the Y Galvo and Label

Picture of Make the Y Galvo and Label
Congratulations - you've finished the X galvo!

Now it's time to make the Y galvo.

The Y galvo is exactly identical to the X galvo.

Repeat steps 7 through 9 to make it.

Label one galvo X and the other galvo Y using the method of your choice.

Step 11: Schematic

Picture of Schematic
This schematic shows the electrical connections we'll be making over the next several steps.

No need to memorize this - we'll be going over every connection in detail!

(step 17 describes a minor variation on these plans - replacing the resistors with diodes for slightly improved efficiency)

Step 12: Tape Laser Pointer Into On Position

Picture of Tape Laser Pointer Into On Position
Wrap Scotch tape around the laser pointer's button to force it into the on position.

Wrap it around tightly several times to assure it stays in place.

Step 13: Remove Laser Pointer End Cap

Picture of Remove Laser Pointer End Cap
Remove the laser pointer's end cap and batteries.

Examine inside - most laser pointers will have a spring that is the negative battery terminal.


 

Step 14: Connect Power Leads to Laser

Picture of Connect Power Leads to Laser
Connect one alligator clip to the spring terminal (negative).

Connect the other alligator clip to the threading at the end of the case (positive).

Assure the clips don't short each other.

Note: Some laser pointers may be constructed slightly differently - so adjust / improvise as needed.


Step 15: Connect Laser Power Leads to Arduino

Picture of Connect Laser Power Leads to Arduino
The laser only draws about 25 milliamps at 5v - so it can be attached directly to the Arduino (good for 50ma)!

Connect the positive laser power lead to Pin 12 on your Arduino.

Cut a short piece of 22 gauge solid core wire and strip both ends.

Insert one end into Pin 12 on your Arduino board.  Clip the alligator clip from the positive lead to the other.

Connect the negative laser power lead to a Ground Pin on your Arduino using the same method.




Step 16: Mount Heatsinks to Transistors and Label

Picture of Mount Heatsinks to Transistors and Label
Use the #6 bolts and nuts to attach the heat sinks to the transistors.

Attach them tightly - it should be difficult to move the transistors.

The heat sinks must be installed .  The transistors will quickly overheat otherwise.

Label one transistor X and the other transistor Y.

The transistors will act as switches - turning the small electrical signal the Arduino produces into a large electrical signal that can move the galvos.

Note: This part will get hot in normal use.  Do not touch it when powered.

Step 17: Connect Resistors to Galvos

Picture of Connect Resistors to Galvos
Connect the 8 ohm resistors across the positive and negative speaker leads of the X galvo using 20 gauge hookup wire and your soldering iron.

Use several inches of wire for these connections - so they won't limit your ability to position the galvos later.

Repeat this step for the Y galvo.

Note: This part will get hot in normal use. Do not touch it when powered.

Note on Purpose of Resistors (optional reading)

As several users have noted - the purpose of the resistors seems to be to (inefficiently) eliminate back EMF generated by the speakers.

The resistors can alternately be replaced by diodes (such as http://www.radioshack.com/product/index.jsp?productId=2062591).  This will result in somewhat decreased power consumption

The diodes should be connected so that the cathode (the side with the bar) is on the side of the speaker connecting to +12v.

This alteration may require tweaking the Arduino code to get good results (try increasing the x_min_value and y_min_value variables to about 20).

Step 18: Connect Galvos to Positive Power

Picture of Connect Galvos to Positive Power
Note: At this point your 12v power supply should be off / unplugged.

Connect the negative speaker terminal (indicated with a "-") of the X galvo to the positive lead on your 12v power supply using 20 gauge hookup wire and your soldering iron.

Yes - to confirm -- we're connecting +12v to the negative speaker terminal .

Use ample wire for this connection (12 inches or more) - to assure you can position the galvos as needed later.

Repeat this step for the Y galvo.

Run a separate lead from each galvo back to the 12v power supply. Do not "chain" the connection between the two galvos.

Step 19: Connect Galvos to Transistor Collectors

Picture of Connect Galvos to Transistor Collectors
Connect the positive speaker terminal (indicated with a "+") of the X galvo to the "collector" lead of the X transistor using 20 gauge hookup wire and your soldering iron.

The collector is the middle lead on the transistor.

Again - use a fairly long length of wire.

Tip: Applying a thin coat of solder to the tips of the connecting wires can help prevent them from unraveling and causing shorts.

Repeat this step for the Y transistor and Y galvo.

Step 20: Connect Transistor Emitters to Ground

Picture of Connect Transistor Emitters to Ground
Connect the "emitter" lead of the X transistor to the ground terminal of your 12v power supply using 20 gauge hookup wire and your soldering iron.

The emitter is the right most lead on the transistor as pictured.

Again - use a fairly long length of wire to accommodate moving things around later.

Repeat this step for the Y transistor.

Run a separate lead from each transistor back to ground. Do not "chain" the connection between the two transistors.


Step 21: Connect Power Filtering Caps

Picture of Connect Power Filtering Caps
The capacitors help filter out power fluctuations - improving the laser show's image quality.

Connect the negative lead of a 470uF 35V electrolytic capacitor to the  "emitter" lead of the X transistor as pictured.

The negative lead of the capacitor is on the side with the black stripe and  "-" symbols.

Don't get this connection backwards - or you'll see smoke!

Connect the other end of the capacitor to the positive terminal of your 12v power supply using 20 gauge wire.

Repeat this step using the second capacitor and the Y transistor.


Step 22: Create Arduino to Transistor Leads

Picture of Create Arduino to Transistor Leads
Cut two pieces of 22 gauge wire about 14 inches long and strip them on both ends.

Solder a 100 ohm resistor to the end of each wire.

These resistors help keep the amount of current that flows between the transistors and Arduino to a safe level.

Step 23: Solder Leads to Transistor Bases

Picture of Solder Leads to Transistor Bases
Solder the resistor end of one of the Arduino to transistor leads to the base lead of transistor X.

The base lead is the one furthest to the left.

Repeat this step for the Y transistor.

Step 24: Connect Leads to Arduino

Picture of Connect Leads to Arduino
Insert the bare end of the X transistor lead into Arduino Pin 5.

Insert the bare end of the Y transistor lead into Arduino Pin 6.

Step 25: Connect Arduino to Ground

Picture of Connect Arduino to Ground
Connect one of the ground pins on the Arduino back to ground (negative) on your 12v power supply using a piece of 22 gauge solid core wire.

Step 26: Download Code and Upload it to Arduino

Picture of Download Code and Upload it to Arduino
Note: The 12v power supply should still be off / unplugged.

Plug the programming cable into the Arduino.

Download lasershow.zip (attached to this step) - and upload it to your Arduino.


Once the program is loaded - you should see the laser pulsing!

If you don't see the laser pulsing - skip ahead to the step titled "Troubleshooting".

Note: This code was updated on 4/10/11 to address a problem where it might not fit on an Arduino using an Atmega 168.

Step 27: Aim Laser and Galvos

Picture of Aim Laser and Galvos
Use your various clamps to aim the laser and galvos as shown in the picture.

This is one of those cases where a picture really is worth a thousand words - especially when taken using a fog machine.

The rundown:

The Y galvo should be positioned with its mirror pivot running horizontally, and the mirror oriented down.

The X galvo should be positioned with its mirror pivot running vertically, and the mirror oriented towards your left.

The laser should be pointed at the mirror of the Y galvo.

The Y galvo should be angled so the laser bounces of its mirror onto the X galvo's mirror.

The X galvo's mirror should be pointed toward where you want the laser show to project.

Step 28: Fire it up!

Picture of Fire it up!
Finally - it's time to turn on your 12v power supply and see if this thing works!

Leave your USB programming cable connected - as it's needed to power the Arduino (more on this later).

You should be presented with a cacophonous symphony of sound from the speakers - along with an actual working laser show.

You may find you need to slightly re-aim the laser once the speakers move a little.

If things aren't working right - unplug your power supply and proceed to the next step.

Step 29: Troubleshooting / Tweaks

Picture of Troubleshooting / Tweaks
Image isn't stable / text is hard to read

The transistors getting too warm are a common cause of image quality issues.  Even if things are generally working - you may be able to further improve quality with better cooling.

Make sure the transistor heat sinks are well installed.  Using larger heat sinks, thermal paste, or even adding fan(s) may help.

Check all your wiring.  An intermittent connection may be the culprit.

Towards the top of the code  - look for the line:

     float exp_move = (some number)

The larger this value is - the slower the laser will draw (improving accuracy).  Try increasing it to 4.5 or higher.

There are also other variables you can adjust to help quality - see the code comments for details.  Experiment!
 
Speaker quality seems to be the biggest factor in determining how well the laser show works. If you're getting results that look a lot worse than the demo video - you may want to try using another pair of speakers.

Laser isn't on
Check the alligator clip connections going to the laser power lead and case.
Make sure the tape is really holding the laser's power button down.

Laser is dim
I have encountered a few laser pointers that are just dim or don't focus.  Try buying another one.

One or both galvos aren't moving / making noise
Disconnect power and check your wiring.

Image is rotated 90 degrees
Try swapping the connections to Pin 5 and Pin 6 on your Arduino.

Image is mirrored horizontally or vertically
This can be fixed either of  two ways:
   Swap the wires going to the positive and negative connections of the galvo with the inverted axis.
   Physically rotate the galvo of the inverted axis by 180 degrees (this may not be practical for the Y galvo).

Image is skewed at an angle
Try rotating either galvo slightly to correct this.
This can also be caused by aiming the laser at a surface that it's not perpendicular to.
  
Image size
The farther away you aim the laser - the larger the image will be. Typical projection area is about 2 feet by 2 feet at a distance of 25 feet.

The higher voltage power supply you use - the larger the image will be (until of course, something burns up - then you get no image at all...). This project has been tested extensively at 12v - but can probably go a bit higher.

Problems using an Arduino with an Atmega 168
This project -barely- fits in an Atmega 168's ROM and RAM.  If you see odd results - it may be that code you've added has "pushed things over the edge."  There might be cases where this does not generate a compiler error - making it hard to troubleshoot.  Removing the "demo()" function may help free up resources.

Step 30: Change the Code!

Picture of Change the Code!
You didn't do all that work to just display the demo - it's time to make your own laser show!

Note: If you made it to this step without downloading the source code - it's in a zip file attached to Step 26.

Here's a few of the included routines:

laser_on()
Turns laser on.

laser_off()
Turns laser off.

sendto (X,Y)
Sends laser to X and Y coordinates.  The coordinate system is 256 x 256 - but the real resolution is lower (maybe half) that.

draw_string("STRING", X, Y, COUNT)
Draws a text string at X,Y for COUNT times.  Uppercase characters, numbers and some punctuation is supported (see code).

move_scale = X
Sets scaling (font size) used by draw_string.  Setting it to 2.8 provides enough room for 5 characters.
 
marquee("HELLO WORLD", CHARACTERS)
Draws a scrolling marquee CHARACTERS long - text is autoscaled to fit (4 to 7 characters long works best).

Now for a little tutorial - look for this code at around line 90:

//put your laser control code here!

void loop()
{

    //run the default laser show demo
    demo();

}


The Arduino runs any code in this section over and over again.  Try changing it to:

void loop() 
{

     move_scale = 2.8;        //sets text size

    draw_string("LASER", 1, 1, 10);
    draw_string("TEST", 1, 1, 10);

    marquee("LET'S DRAW A STAR!!!", 5) ;

   //draw a star 15 times
    for (int loop = 0; loop < 15; loop ++)
    {
       laser_off();
       sendto (85,10);
       laser_on();
       sendto (150,130);
       sendto (0,40);
       sendto (170,40);
       sendto (20,130);
       sendto (85,10);
    }

}


There are a bunch of variables you can tweak and a few more routines documented in the code.

Dig in and have fun!  If you mess things up - you can always re-download the code and start over.


Step 31: Some Technical Notes

Picture of Some Technical Notes
Running 12v to the Arduino
You might wonder why I didn't include a step to connect the 12v power supply directly to the Arduino board - so the laser show can be used without USB power from the computer.

Most Arduino boards have a maximum recommended input voltage of 12v.

Some "12v" power supplies actually put out 13.8v - and perhaps even higher when not under load.  You may want to test your power supply with a multimeter to make sure it's not significantly over 12v before connecting it to the Arduino.

To power your Arduino using your 12v power supply - connect its positive voltage terminal to the Arduino's Vin Pin.

An alternative is to use an external voltage regulator or separate power supply for the Arduino of appropriate voltage.

About the TIP120 Transistors
This project uses TIP120 "Darlington" transistors.  These transistors are actually two transistors chained together into one.  This gives them much higher "gain" - meaning they can use a very small current  to switch a much larger current.  They are a cheap and easy way to interface microcontrollers to things like speakers and motors.

PWM not Analog
This project generates a digital PWM (pulse width modulation) signal to control the speakers.  You might expect the quickly switching 1's and 0's to get converted to analog before going to the speakers - but they don't!

The signal is switched so fast - that the speakers respond as if they are getting an analog signal.

The picture shows an oscilloscope reading taken right off the speaker leads - still digital!

By default the Arduino does PWM at about 500hz - way to slow for this project.  If you look through the code you'll find some tweaks that boost that up to 64,000hz.

Step 32: Green Laser Upgrade!

Picture of Green Laser Upgrade!
Green lasers appear much brighter than red ones of the same power - and are still "safe" at 5mw.

Green lasers with power ratings over 5mw can blind you instantly!  Don't mess with them.

A 5mw green laser takes a lot more current to drive (a few hundred milliamps) than a red laser (maybe 20ma) - so we'll need to add some electronics to support it.

Note:
This setup worked for the 5mw green laser I had kicking around (unfortunately I don't have an exact model number).
Some green lasers may have more complicated driving electronics that may make them difficult to turn on / off quickly enough.  If one model doesn't work - you may need to try another.

Additional Stuff You'll Need

A 5mw green laser pointer
Look for one that runs off 2 x AAA batteries.
http://www.amazon.com/American-Science-Surplus-Green-Pointer/dp/B0040YL87Q
(This model will likely work - but has not specifically been tested)

220 ohm resistor
Any wattage

100 ohm resistor
Any wattage

LM317T Adjustable Voltage Regulator
Available at Radio Shack - Catalog #: 276-1778

1 x TIP120 Darlington Transistor
Available at Radio Shack - Catalog #: 276-2068

1 x TO-220 Heat Sink (for voltage regulator)
Available at Radio Shack - Catalog #: 276-1363

#6 Bolt and Nut

Instructions

1. Build the the laser show as described in the previous steps.
2. Attach heat sink to the voltage regulator using the bolt and nut.
3. Wire in additional parts as shown in the schematic above.
4. That's it!

How it Works

The resistors "configure" the voltage regulator to provide about 3.75v (a bit more than 2xAAA batteries).
The heatsink is required since the regulator is dissipating a large amount of voltage with moderate current consumption.

While the red laser could be driven directly from the Arduino - the green laser consumes way too much power for that.

The TIP120 Darlington transistor uses the small signal from the Arduino to switch on and off the current going to the laser.  It's not perfectly efficient - so the 3.75v from the voltage regulator ends up closer to 3v (the same as 2 x AAA batteries).  Unlike the TIP120's powering the speakers - the load on this one is low enough so that it doesn't need a heatsink.

All other details of the project are the same.  If anything isn't obvious - consult the previous steps.

Step 33: Hack this Project!

Picture of Hack this Project!
Since this project is built on an Arduino - adding your own code / sensors / etc. is easy - here's some ideas:

Make a 2-player laser pong game using potentiometers as controllers.

Make some kind of interactive art installation.

Make a laser clock / countdown timer.

Connect it to the internet - and have it display your favorite RSS feed.

Drive your cat crazy.

Do something no one has even thought of yet!
1-40 of 177Next »
hydronics2 years ago
Hey, I basically copied your instructable but put it in a portable container to make a strategic gerilla propaganda 'box'

http://www.instructables.com/id/Guerilla-Laser/

Going forward I would recommend using a stronger laser... This would allow you to hit a building or billboard at a mysterious distance... I tried to buy a stronger, $14 green laser from China but the china laser circuit did not allow cycling ON/OFF at quick rate like the cheap laser is used...(this is called blanking in the laser light show industry) You could rewrite the code to be more cursive in nature and less ON/OFF dependent... It would be fun to play with the programming in such a way and easy for a beginner... its all cartesian coordinates... that means easy!

thanks again for all the hours of dinking around....



nothinglabs (author)  hydronics2 years ago
that's awesome!!!

had similar problems trying to use a green laser too.

suspect it's possible to get it a green laser working with some tweaking - the driver circuits are a bit more involved than is intuitive... (think they tend to involve temperature feedback and such).

jlocke8 made it!1 month ago

I used your instructable and made this in 2011. I used it to project a laser show against a building to propose to my wife! Thank you so much for your project and instructions!

Like hydronics, I put it into a self contained box, and added a battery and inverter so I can truck it around. I modified the code to draw some other images and say my personal message.

Thank you nothinglabs!

2106683_orig.jpg9897632_orig.jpg
nothinglabs (author)  jlocke81 month ago
that's awesome!
pulse_wid2 months ago

I have some small galvos that I wanted to run with this code. I ran the galvos from pin 5 and 6. The x-axis mirror was bottoming out within it's range so I put in a 5.6Ω resistor to reduce the current. The diodes I put in because I thought they would protect the arduino?

The x-axis works fine but I cannot get the y-axis to move the mirror much, it barely moves and not very often. The peak volts the x-axis put out was 1.2 volts, y-axis was only .24 volts, this was over a period of over a minute. I reset the Arduino many times and got the same results. I tried reassigning the pins and switching out the galvos but the y-axis seems to prefer putting out very little power, and will not move the laser. I'm stuck with a laser show on a single axis : (

The laser seems to pulse just fine.

Any thoughts anyone?

Thanks!

laser_galvo.jpg
nothinglabs (author)  pulse_wid2 months ago

I'd try swapping the X and Y axis pins in code to see what happens.

The way the show typically renders - the Y axis tends to move a lot faster than the X axis. If your using a multimeter to measure - it may not be fast enough to see the signal.

Also - no idea if the arduino can source enough current to effectively drive the galvos (wouldn't shock me if the Y axis got toasted) Might try slowing things way down to see what happens...

ketansodhi2 months ago

Would it be possible to power it with a 19.7V, 4.7A sony laptop charger?

nothinglabs (author)  ketansodhi2 months ago

I think that should work. I'd keep an eye on how hot the TIP120's get. You can dial back the power levels in the code a bit if needed. might try to get 8ohm speakers as opposed to 4ohm.

good luck!

spewlocks3 months ago

amazing

cheshirecorn3 months ago

Wonderful

mr79195 months ago

what are x_level and y_level in the code

nothinglabs (author)  mr79195 months ago
x_level and y_level contain the current X / Y position of the laser.

hope this helps!

-Rich

TCCR2B = TCCR2B & 0b11111000 | mode; This line is giving me the error in the code and i also want to ask whether the exp_move is used to change the orientation of the speakers???

regaltaxlaw7 months ago
hi , very nice project, i have one question , can you use , and how, instead of speakers, Hard Disk motors :) for X,Y control
sharkyenergy7 months ago
hello! could you please put a description online of what the program does and how it works? i dotn work with arduino so i would like to write it on my own for pic MC, but figuring out th elogic might be lots of unnecessary extrawork.. thanks!
nothinglabs (author)  sharkyenergy7 months ago
I'd suggest fully reviewing / digesting the source code / comments. there's a lot of documentation already there and in the instructable

if you have specific questions - let me know and i"ll try to answer.

good luck!

-Rich
koruptx28 months ago
hi , very nice project, i have one question , can you use , and how, instead of speakers, Hard Disk motors :) for X,Y control
nothinglabs (author)  koruptx28 months ago
I played around with HD motors - never had any luck. I think they need some kind of feedback electronics to position accurately.

You should try it - let me know if you make any discoveries...

Have fun,

-Rich
My Diet Area11 months ago
Thats magnificent...
DanNixon1 year ago
Just noticed a little error in the setPwmFrequency method, you have "case 1024: mode = 0x7; break;" where is should be "case 1024: mode = 0x07; break;".
nothinglabs (author)  DanNixon1 year ago
yup - that's an error!

if you google it - you can see it's propagated via some commonly copy / pasted code.

good news is that particular line isn't ever called - so has no effect on the project (so I'm gonna leave it be).

-Rich
SteveNosko1 year ago
OOPS. That is TC = L/R... Time Constant = L/R.
SteveNosko1 year ago
Signed up just to comment. First, I think you have done a stellar job with this. Many guys think of speakers, try something and give up for poor performance. I got interested because of high frequency Piezo tweeters... but moved to less expensive, slower galvos (no longer available)
Many good comments and speculations. I don't know if you or others are still playing with this, but FWIW. Actually, you don't want to damp the back EMF of the speaker. Seems counter intuitive, but I explain. I use real galvos in my laser graphics and the way is to use a current drive (high impedance) instead of voltage drive (very low output impedance, like Sound amps). If you recall, the series LR circuit time constant is L divided by R = L/R. This says that a small R makes the time constant large. The current is slower to build, magnetic field slower to build and cone slower to move. Your transistors are current sources, but as said by another poster, a source/sink drive is better - in essence a "Power OpAmp". Unfortunately, driving 8 ohm speakers requires lots of current. A current drive (Google OpAmp current source) is accomplished by pitting a small resistor in series, to ground, with the coil and feeding the voltage at the top of it back into the OpAmp - yielding a voltage to current converter.
Then you sample the back EMF and use it as feedback, through a pot, so U can adjust it to get the best response. This, however, means that your power supplies (yes you'd need a + and a - supply) have to be high enough voltage to allow this back EMF to go as high as it wants to, so-to speak. The high supply voltage isn't needed to get the high current to flow, just to allow the back EMF to have the room it needs to simply exist. This is called compliance in current source Jargon. The analogy is when a voltage power supply can supply higher current spikes due to requirements of the load. For driving inductance like this (like TV Tube deflection), it turns out that the power supply voltages you choose now becomes one of the limiting factor on the speed you can get out of the 'galvos". Speed being the holy grail of laser graphics. If the back EMF is allowed to hit the power supply rails (thus clipping it), this is equivalent to 'damping' and the response actually starts to slow down and distort the image.

I also would have (I do this for another application) cut away a considerable portion of the speaker cone to allow as fast a movement as possible and reduce damping due to air movement. Don't know if this helps anyone, but FWIW. I am starting the process of putting info on my laser graphics on my web site and will be uploading a schematic for such a drive.

In addition, you should low pass filter (RC low pass) the PWM out before the audio amp.
Yes, an amp down to DC is required (which, internally, many audio amps are already), so it would be possible to turn an audio amp into a DC power OpAmp current source to do this.
Too many plates spinning to go into detail here. Motivated folks can try contacting me on my web site for more...
Cheers, Steve
DBender1 year ago
hello friend, sorry my bad english, I'm from Brazil, I have a problem in my setup, the speakers are Galvos with 12v and some are moving sluggish, what could be? thank you
nothinglabs (author)  DBender1 year ago
are you using he code as provided?

If so - thing should be moving pretty quick. I would try reverting to the code as provided if you've changed anything.

Besides that- easiest way to increase speed is to change "float exp_move =" to a smaller number.

Look at step 29 for more tweaks.
Hi guys from Nothing labs.
This is a really great project... im exited to get it going.

I am new with all this laser stuff and getting more involved every day.

I just did a spirograph and works nice but now i want to have some kind of scanner controled with an arduino.

Your project seems very easy to do and looks realy nice, but my question is if this setup would work with hard disk drives as galvos instead of speakers?

I would really apreciate your response.
Best regards,

Alejandro C. from Colombia
nothinglabs (author)  alejocorrear1 year ago
Hard drive galvos depend on having a feedback mechanism - that this project doesn't really have a method to deal with. Might be possible to make work - but would take a bunch of re-working...

Have fun!

-Rich

JensonBut1 year ago
Probably a lot easier thatn all the other ones....
I want to make a laser show, too. I'm mostly interested in beam shows, not graphics shows. My considerations:
I was planning to use very small speakers, such as some 50mm 3W speakers available for as low as $3. Even though their excursion is tiny, my idea is to glue a lever to the speaker and then glue it VERY close to the mirror rotation axis, so the mirror would tilt a lot. This would also allow to have really small mirrors (reduced inertia of moving parts = great) and have the added benefit of allowing better operation on higher frequencies (small speakers respond better to higher frequencies), and I guess its performance wouldn't be bad on low frequencies since SPL is irrelevant, we only need excursion to tilt the mirror.
Also, I don't want to use an Arduino, I want to use full-fledged computer software to control the output. Eventually, I would record the audio output from the PC and play directly from a tiny mp3 player. It all would make for a very portable solution, maybe even pocketable.
Any tips on great laser animation software which works nicely with an audio DAC (I mean, with the computer's sound output)? Preferably free software with lots of beamshows available! :P
nothinglabs (author)  elias.alberto1 year ago
Don't have any specific advise on controlling from PC.

Sounds like a great project / please post details here as you make progress.
Couldn't I just use a set of PC speakers, with their amplifiers? Isn't that what you have built here? I have made one before the days of Arduino magic... worked then. Gotta try this :)
Commercial amplifiers have DC blocking inputs, which is bad for this purpose.
someone should do the same instructables but use a laptop instead of arduino
What kind of laser did you use. Or how did you make it so visible?
nothinglabs (author)  hthnc-student1 year ago
standard red laser pointer.

if you want brighter - look at the notes for using the green laser pointer.
Mine works!! What a hoot! I will tweak and try to get the quality to match your vid. It works great as it is, just not quite as clear. Thanks for the instructions, a fun project.
BTW, I have not found the revisions about using diodes instead of the resistors across the speakers, have you posted this? I am interested to see if it uses less power and heats up less. I am using 10 Ohm resistors, the machine works, maybe I shouldn't mess with success? ;) How do you guys figure all this stuff out?
nothinglabs (author)  stringstretcher1 year ago
congrats on getting stuff working!

see step 17 for info on the diodes (I just added a few other references to it in the project). It will improve performance a little - in that it uses maybe 25% less power - reducing the load on the transistors (which can help drawing accuracy).

figured this out through a little theory - and lots of trial / error...

-Rich

Will do.. Thanks!
Jim
The only commercial laser show I looked inside of had spherical mirrors, like a rather large ball bearing mounted on a rod and driven by a galvo. the curved surface gave a larger throw to the motion of the galvo, allowing for faster motion due to the shorter travel. Might this work; highly polished ball bearings on the speakers instead of rear surface mirrors? BTW, there is an instructable on converting acrylic mirrors into front surface mirrors, and believe me, that makes a huge difference in resolution.
1-40 of 177Next »
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!