3D Printed Laser XY Scanner - Draw, Cut, Engrave, or Scan

61K30742

Intro: 3D Printed Laser XY Scanner - Draw, Cut, Engrave, or Scan

Laser XY Scanner is an open source stepper motor based scanner. The components used are low cost and very accessible. This type of laser scanner is not extremely fast and has a fairly low resolution, especially with this driver, but it can still be used in a variety of applications. Draw, cut and or point with laser X and Y control.

There are many types but the traditional laser scanner is made with mirror galvanometers. These are very expensive and require even more expensive and complex controllers. You can think of them as high-speed servos. This XY Scanset in the photo above is currently $300+ and that does NOT include the controller.

This laser scanner is much simpler and slower but depending on your application it can still be very suitable. The simple 3D printed mount brings all these low-cost part together into something you can experiment with.

Happy lasering!

STEP 1: Gather Your Components

Laser XY Scanner - BOM

I usually like to source my parts from DigiKey, but the low-cost options on Amazon are hard to beat sometimes. This list is just one of many sources for each component in the BOM. There are of course higher quality parts to choose from, but I am aiming for the lowest cost providing the required function here.

Other Supplies:

  • Paint Stripper, the stronger and faster the better.
  • Glue or Contact Cement for the glass to metal & plastic to metal bonds.
  • A 12 volt DC power supply.
  • A small screwdriver to adjust potentiometers.
  • Soldering iron and small hand tools if your Arduino does not have its headers pre-soldered.
  • ---SAFETY--- If you are using a high power laser, then you will need REAL laser goggles. If they are less than $20, they probably aren’t real. Don't fry your eyes. You only get two of them.

STEP 2: Print the Scanner Base

You can find the .STL file for the base on the Thingiverse project page here: https://www.thingiverse.com/thing:2710048

The Sketchup file is also there in case you want to modify it.

I printed mine at 0.3mm layer height with PLA. It was sturdy and worked great for experimenting.

STEP 3: Assembly the Laser and Heatsink

  • Slide the laser module into the heatsink.
  • Make sure the set screw is good and snug, this ensure good thermal contact between the laser and heatsink bodies.

You could go a step further and add some heatsink compound if you plan on running your laser for long periods at high power levels.

STEP 4: Mount Laser Assembly

Using two small hex head screws and nuts attach the laser assembly to the scanner base facing the direction shown. The laser power wires will exit out the back.

STEP 5: Mount Stepper Motors

Using four small hex head screws and nuts attach each stepper motor to the scanner base facing the direction shown. Pay close attention to the position of the stepper motor shaft. The X stepper shaft should be closest to the laser and the Y stepper shaft should be on the top.

STEP 6: Mount Home/Minimum Switches

Using the glue of your choice attache the X and Y home/minimum lever switches to the locations shown. Note that you want the face of the lever to be nearly parallel with the mirror when the mirror is near that position. There is no right or wrong position, but this location sets a good out of bounds minimum or home location.

Install jumper wires on the switches normally open contacts. One on each switch will connect to ground and one to the Arduino input pin.

These switches are necessary because when our code starts up, we need to establish a reference point for all future movement of the stepper motors. Since stepper motors do not have positioning feedback, we will use dead reckoning based on this home location. This method is how your 3D printer "knows" where it's print head is.

STEP 7: Prep the Mirrors

The mirrors will work as is but they will work better if we use the back side. But wait the backside is grey and umm, not a mirror. The back side is indeed a mirror. It is just painted grey to protect the delicate metallic coating on the glass. Place the mirrors grey/paint side up in a dish and pour paint thinner on them, enough to cover them completely. Let them sit for long enough that the paint can be washed off with hot water. If you rub them, you will scratch the delicate metal film.

When you shine a laser at an ordinary mirror, it passes through the glass, then reflects off the back surface, then back through the glass again. Each time it passes through the laser is degraded by partial reflection, refraction, and impurities in the glass to name a few. By bouncing the laser off the back surface of the mirror, we get a near perfect reflection with no loss in power or beam divergence.

Once you have a couple of nice looking mirrors glue them to the flat side of the stepper motor shaft.

Update:

Instructables user e.ma.niak pointed out this excellent source for front surface mirrors: https://www.surplusshed.com/pages/item/L10754.html This is a great option, and I would say even preferred if you don't want to mess with paint stripper.

STEP 8: Wire the Laser Driver

  • Hook your laser module up to the terminals marked for laser output.
  • Install two jumper wires for the 12 input so we can send power to the driver later.
  • The TTL control is optional and can be used for turning the laser on and off without interrupting the driver's power limiting features. This allows for very fast on/off switching, useful for scan type engraving or drawing graphics.

STEP 9: Wire the Stepper Motor Drivers

  • Plug each stepper motor into a driver board to the corresponding jack.
  • Install power wire jumpers on each driver board
  • Install four jumpers on each board to IN1, IN2, IN3, & IN4. These are the ULN2003 control inputs that will go to the Arduino output pins.

STEP 10: Wiring It All Together

  • Install the Arduino on the breadboard (if you are using that type).
  • Connect the 5V and GND pins on the Arduino to the breadboard + and - bus.
  • Connect the home switch commons to the breadboard ground/negative bus.
  • Connect the X stepper motor home switch to the Arduino digital pin 10.
  • Connect the Y stepper motor home switch to the Arduino digital pin 11.
  • Connect the stepper motor driver board power jumpers to the breadboard bus.
  • Connect the stepper motor driver board control jumpers to the Arduino like this:
    • X Driver Board
      • IN1 > D2
      • IN2 > D3
      • IN3 > D4
      • IN4 > D5
    • Y Driver Board
      • IN1 > D6
      • IN2 > D7
      • IN3 > D8
      • IN4 > D9

STEP 11: Prep the Laser Driver

Lasers diodes are very sensitive. I won't go into the specifics here. There are plenty of resources on that topic that you can google. But I will show you how to correctly setup your laser driver.

Our M140 laser diode has a forward voltage around 5 volts which means the output voltage of our driver needs to be at a minimum, slightly above this. It also has an absolute maximum current draw of about 1.8 amps.

To set up the driver I used a dummy load made from a Darlington transistor mounted on a heatsink, a resistor, and an LED as seen in the photo. If you can do this, I recommend it to ensure you do not blow your laser diode before it emits a single photon.

  • Turn the blue potentiometer counter-clockwise until it clicks.
  • Set the low profile potentiometer to the position shown in the image.
  • Connect the dummy load to the laser driver output.
  • Connect a voltmeter to the laser driver output.
  • Connect a variable power supply with current readout or use an inline amp meter.
  • Set the power supply to 12 volts with a maximum of around 1 amp.
  • Slowly turn the blue potentiometer clockwise until the current begins to rise.
  • Watch the voltage and be sure it stays between 5-6 volts as you sweep the current up near an amp.
  • If your voltage holds as the current raises you can go ahead and lower it to around 0.05-0.1 amp, this is plenty bright enough for testing.
  • You may now connect your laser diode to the driver and test it out.

TLDR;

If you do not have access to the materials to make a dummy load, the meters set it up properly, or just don't wanna...

  • Turn the blue potentiometer counter-clockwise until it clicks.
  • Set the low profile potentiometer to the position shown in the image.
  • Connect the laser diode to the driver board output.
  • When you power the laser driver on, slowly turn the blue potentiometer clockwise to increase the power output level to the diode.
  • Be very careful because if you allow the laser diode to draw too much current or let it get too hot, it will burn out!

STEP 12: Program the Arduino

Download the Arduino sketch from the GitHub project repository.

https://github.com/ThingEngineer/Laser-XY-Scanner

Download and install the stepper motor library. Details are in the sketch.

Double check that your port assignments are correct as they are shown in the sketch.

STEP 13: Laser Scanner in Action - Video!


P.S. No sharks were harmed in the making of this Instructable.

STEP 14: Trouble Shooting

Stepper Motors

  • One or both of stepper motors are having trouble moving.
    • The 5 volt USB supply may not be supplying enough current. Try powering the stepper motor drivers from an external source.
  • One or both of the stepper motors homes in the wrong direction
    • Try flipping the jumpers from the Arduino to the stepper motor driver board IN1<>IN4 & IN2<>IN3
  • One or both of the stepper motors knocks the home switch off during calibration.
    • Make sure the mirror is pushing the lever in a way that triggers the switch.
    • Make sure the common is hooked to ground/negative, and the normally open contact is connected to the Arduino input pin (D10 & D11).

Laser

  • No matter how high I turn up the power the laser only outputs a very dim beam.
    • You probably blew the laser diode. It either got too hot, drew too much current, or both.

  • It was working then just stopped working.
    • You probably blew the laser diode. It either got too hot, drew too much current, or both.

STEP 15: Expanding Capabilities (Imaginationz!)

  1. Couple the laser scanner with a camera or other sensor to measure the speed of reflected light. Do some maths and make a stationary 3D scanner.
  2. Similar to the above make a simple lidar implementation for robot obstacle avoidance or environment mapping.
  3. Add a NodeMCU (the entire thing could run off this instead of the Nano) and control your laser scanner remotely.
  4. Add a camera to track objects, say a small indoor drone with a light sensor that shut it down when hit. Once the camera locks onto the drone, it aligns its laser mirrors, aims, and fires at the drone shutting it down.
  5. You can experiment with changing the speed of each axis, the range each axis moves and the looping to create some cool looking effects.
  6. Use a stepper motor with a higher resolution and a micro-stepping driver to increase the overall resolution of the laser scan trace. This, of course, would raise the cost, complexity, and size of the design which was contrary to its original intent.

37 Comments

Does anyone know how to control this project with arduino?
Hello, will this work with benbox and will it engrave well with the angle system ?
Im looking to engrave wood and this is a good looking alternative to large cnc
If you are asking for the Arduino code it's on GitHub as listed above here: https://github.com/ThingEngineer/Laser-XY-Scanner

If you're asking for controller software to similar to a CAM package for a CNC/laser cutter, that hasn't been done yet. I have a back log of projects but modifying a GRBL firmware to work on this simple setup is on my list.
Thank you very much. I did all the parts but to the control part "controller software to similar to a CAM package for a CNC / laser cutter", I don't know how.
Hello this is an awesome project can I make this with two Nema 17 stepper motors and two A4988 Stepper motor driver if yes than How thanks in advance......!
PLEASE everybody that builds this design Please be very careful and pay close attention to where the beam will exit this device...THIS IS VERY DANGEROUS This needs a shield completley around it BEFORE you turn it on
someone out there please rework the code to use laserGRBL and this will be a very good project but now all you can do is draw a square....and how do you calibrate the number of steps per mm or inch if the target can move...so fix the target at 12 to18 inches and then this will be great as you will be able to use any bitmap to burn or cut

I want this to use grbl1.1 and laser grbl to drive it howeverI have one question I must put in a Xand Y number of steps per mm, now I want to mount this unit 12 inches above the cut table is there a formula for determining number of steps per mm or do I enter what I beleve to be accurate numbers or just mount the device and experimatally determine the correct number of steps for a given line length at a given distance from work table?

Nice instructable. Using stepper motors has it downs tho, they are slow and the resolition is small. Have you considerred using galvos?

not slow if you know how to set up GRBL1.1 pay strict attention to the configuration and you can make it go real fast not to fast as you do not want to skip steps.
Thank you! Yes, they are slow and this stepper motor with this driver, in particular, has a low resolution. I talk about that fact in the instructable. I also open up talking about the high cost of traditional galvanometers. It's true that stepper motor laser XY scanners have been done before and they aren't that great, but they can serve a purpose depending on your application. I just wanted to put together something that was a bit more step by step and included everything you needed to make it happen.

I am looking at building a low-cost encoder or resolver of some type and controller for this and writing an instructable about how to make your own "real" galvanometer. I have a few of these, and they work great, but they are bare bones, no feedback sensors at all and no controller.

I also wanted to post this link, which was referenced off my earlier link on DIY galvos:

http://elm-chan.org/works/vlp/report_e.html

It's pretty much the best work I've seen - approaching that of pro-level manufactured galvos. Whether something like that can be simplified or somehow distilled into an instructable is debatable, as the level of fabrication expertise needed is pretty high.

Thank you for sharing those impressive project examples! They have been at the top of my galvo bookmark list for some years now. I do indeed believe that much of this process can now be simplified. Many things help make this a possibility. Such as the availability of better processing platforms, continued improvement of sensing hardware and techniques, and as open source projects like openlase. I have another project I'm working on that takes precedence at the moment, but I will continue work on realizing precisely this. There are many parts of the galvo/sensor/amplifier schema can be handled in software or firmware to significantly reducing external component count and complexity. So this isn't an if, it's a when!

Stuffing another laser into a module I'm 3D printing a small water-cooled jacket for. This is the one I'll be using for testing at low power, then eventually higher power with the water cooling in the above "part 2" project. Although I don't think it will actually be a part 2 since it is its own thing.

Alternative could be the use of steppers with pololu drivers. You could get a better resolution with microstepping and it's cheper than those galvos. For my projects i use pololus capable of 1/16 step, and i think the make now 1/32.

This is one of the better write-ups on DIY'ing a laser galvo:

http://people.ece.cornell.edu/land/courses/ece4760...

Google "DIY laser galvo" and similar, and you can find more out there. In short, it isn't easy to build one, at least to gain the high-speeds needed for animation and graphics reproduction. The difficult part is the high-speed servoing and sensing of position.

The two main ways this is accomplished in a "homebrew" manner tend to be capacitive sensing using a capacitive quadrant encoder, or optically, using a gradient optical disc (which can be made via printing a radial grey scale on overhead transparency plastic in a printer), plus a photo-transistor or similar.

To gain the high speeds, your galvo needs to have as little mass as possible; a coreless winding is best. You'll also need dampening, similar to the galvos in analog meters which use small springs. Plus low friction bearings. Then the driver circuitry, of course...

It gets difficult really quickly, which you'll notice as you read about similar serious DIY efforts like the write-up link above.

Use grbl1.1 in laser mode to control the motors and the laser...using the laserGRBL app it should do fantanstic things..years ago I put together a galvo show for Halloween using hi speed motors and a printer laser.

What is this? Very interesting, thanks.

Hmm I think it's a camera reflection

Ha, that is pretty funky looking. It's just a lens flare and/or ghosting from the very bright laser spot. You can see the same thing if you point your phone camera at the sun but not directly, just slightly off angle/focal point. If I would have had the focal point centered and at a camera plane parallel to the plane the laser spot was on they would have lined up and you wouldn't see this.

It probably raises the questions like, is that stray laser light sneaking around?! Well it's not, it's just the lens artifact. Good eye though! ;)

More Comments