Arduino Laser Projector + Control App

10,883

72

39

Posted

Introduction: Arduino Laser Projector + Control App

  • XY - 2 dimensional laser scanning
  • 2x 35mm 0.9° stepper motors - 400 steps/rev
  • Automatic mirror calibration
  • Remote serial control (via bluetooth)
  • Auto mode
  • Remote control app with GUI
  • Open Source

Download:

github.com/stanleyondrus

stanleyprojects.com

Step 1: Theory

Laser projectors can be divided into two main categories. Either they use a diffraction glass/foil to project a pattern or they have a system which moves laser beam in XY axis directions. The second option usually looks much better because it is possible to program the pattern to be projected. While in the first case, the laser beam is being diffracted and projects a static image, in the second one, the laser still consists of just one beam, that moves very fast. If this movement is fast enough, we perceive it as a pattern because of persistence of vision (POV). This is usually done by having two perpendicular mirrors, each capable of moving the laser beam in one axis. By combining them, it is possible to position the laser beam to the exact location.

For professional applications, galvanometer scanners are usually used. Some of these scanners are capable of doing 60kpps (kilo point per second). That means, they can position the laser beam to 60000 different locations during 1 second. This creates a really smooth projection without the stroboscopic effect. However, they can be really expensive. I have used the stepper motors, which is the cheap, not so fast, alternative.

The laser draws the pattern by orbiting the lines over and over at really high speed. Sometimes there are multiple parts of the pattern that are not connected together. In this example, each letter is separated, however when the laser moves from one letter to another one, it creates an unwanted line. This is solved by a technology called blanking. The whole idea behind is, that the laser is switched of when moving from one, to another pattern. This is done by a high-speed controlling unit, which needs to be synchronized with the scanning system.

Step 2: Obtaining Components

In the list bellow you can find the components I used and the links where I bought them.

    And then some material and tools you can find at home. Hopefully ;)

    • Mirror (the best is a metallic mirror like HDD Platter)
    • Aluminium sheet
    • Snips
    • Hot Glue (or Pattex Repair Express )
    • Wires
    • Pliers
    • Drill (or scissors in my case :D)
    • Box (e.g. Junction Box)

    Step 3: Mounting Steppers

    Aluminium sheet needed to be cut and bent into the proper shape. Then holes were drilled and steppers attached.

    Step 4: Laser Blanking + Mirror Calibration

    Motor Shield has a small prototyping area that was used for two small circuits.

    Laser Blanking

    We want to control our laser with an Arduino. However we need to limit current flowing into the laser and also driving it directly from a digital output pin is not a good idea. My laser module already had a current protection. Thus I've built just a simple circuit where transistor is switching the laser on and off. Base current can be regulated by trimmer and controls the brightness of the laser.

    Mirror Calibration

    Photodiode was placed in the hole in the central axis right above the X-axis stepper. Pull-down resistor circuit was necessary to obtain exact measurements. When calibrating, we are reading values from the photodiode and when the value exceeds a specific value (laser directly shines into it), steppers stop and return to the home position.

    pseudo code for calibration
    // 1step = 0.9° / 400steps = 360° = full rotation
    laserOn();
    for (int a=0; a<=400; a++) {
    for (int b=0; b<=400; b++) {
    photodiodeValue = readValue();
    if (photodiodeValue >= photodiodeThreshold) {
    laserOff();
    returnHome();
    }
    stepY(1,1);
    }
    stepX(1,1);
    }
    laserOff();
    unsuccessfull();</p>

    Step 5: Final Assembly

    The whole circuit was put into the plastic junction box and tightened by screws. The whole projector is really portable, just plug the power supply, switch the toggle and we have laser show.

    Step 6: Laser Control App

    The controlling app was made in C# and allows to switch between patterns, adjust the speed and see current actions. It is free to download together with the Arduino code (see Intro).

    Step 7: Video

    2 People Made This Project!

    • Here is a picture of...-SiposD

      SiposD made it!

    • Hy ! I modified code...-SiposD

      SiposD made it!

    Recommendations

    • Epilog Challenge 9

      Epilog Challenge 9
    • Sew Warm Contest 2018

      Sew Warm Contest 2018
    • Gluten Free Challenge

      Gluten Free Challenge
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    36 Comments

    help me please...

    i can't compile to arduino uno..

    i have problem with library

    " AFMotor.h" and

    utility/Adafruit_MS_PWMServoDriver.h.

    i have library at arduino but not work...

    what wrong ???

    Yes it is. Or you can use in-built pull-up resistors inside Arduino and modify the code. By the way, please use the "Reply" button so we won't start a new conversation every time.

    Hello. Can i make laser drawing smaller? Maybe problem is in motors, i have very old motors from 5,25 FDD

    Hello again!

    Where i must write microstepping code and steps per revolution?

    You can find all the information here: https://learn.adafruit.com/adafruit-motor-shield-v2-for-arduino/using-stepper-motors

    More steps per revolution = smaller single step. You can even use microstepping.

    Both of them to the ground through a pull-down resistor. To switch on, apply 5V.
    Even easier way would be to initialize those pins as INPUT_PULLUP and then just short them to ground as you switch the toggle.