Self-Leveling Rotary Laser

by Z3_R0 in Workshop > Tools

105 Views, 2 Favorites, 0 Comments

Self-Leveling Rotary Laser

Screenshot 2025-12-03 203250.png
PXL_20251128_181633130.PORTRAIT.jpg

I am a mechanical engineering student and DIY enthusiast. I think most engineers (and others) can agree that lasers are pretty cool. That's why when I came across a nice laser diode module, I wanted to build something both cool and useful: a self-leveling rotary laser.


Laser levels can come in quite handy for many DIY projects, including mounting and layout. For example, they can make hanging pictures, installing shelves, and other home improvement tasks easy by projecting a perfectly level line of light on the wall. Most commercial off-the shelf laser levels are expensive, so I wanted to build one for cheap. While my device may not have all the bells and whistles or the same accuracy as a commercial level, it will most likely do the trick for around-the-house DIY projects.


Due to the limited power of my laser module, the beam will be dimmer than an off-the-shelf laser level, some of which have range on the order of 1000 ft. For me, it is likely that the accuracy of my laser will diminish before the beam dims too much. I aimed for a working diameter of 20 feet, which should be able to plot a level line in a typical interior room.

Supplies

Here is a rough, mostly comprehensive list of supplies:

Equipment

  1. 3D printer and filament
  2. Soldering iron
  3. PCB router
  4. Various hand tools
  5. Arduino
  6. Multimeter
  7. Lathe

Electrical parts

  1. (1) sheet single sided FR4 (1oz cu), 50 x 75 mm
  2. (1) ATtiny85 DIP-8 and IC socket
  3. (3) TIP120 transistor, TO-220 package and heat sinks
  4. (3) 1n4004 rectifier diodes
  5. (4) 1k resistors (1/4W)
  6. (1) 10k resistor (1/4W)
  7. (1) 2.2k resistor (1/4W)
  8. (1) LM317 Voltage regulator, TO-220 package
  9. (1) 5k panel mount potentiometer (1k-10k would also be OK)
  10. (1) 100uF electrolytic capacitor
  11. (1) 0.1uF capacitor
  12. (1) 1uF capacitor
  13. (1) panel mount SPST switch
  14. (1) laser diode module
  15. (1) 1x2 terminal block
  16. (1) 5V wall wart, cut off barrel jack
  17. Various pin headers, Dupont pins, wire, etc.

Mechanical Parts

  1. (1) brushless DC motor from old computer hard drive (four terminals)
  2. (1) small mirror (roughly 15 x 15mm)
  3. (4) 2-inch standoffs, 8-32 threads
  4. (8) 8-32 x 3/8" screws
  5. (4) 8-32 split washers
  6. (5) 1/4-20 hex nuts
  7. (4) 1/4-20 x 3/4" countersink screws
  8. (1) 1/4-20 x 3/8" countersink screw
  9. (4) adhesive bumper feet
  10. (1) 2" diameter 1.5" long slug of steel (or other mass)
  11. (1) 3mm x 20mm pin
  12. (1) spring, >9mm ID, <15 mm OD
  13. Various other small hardware and washers

Theory of Design

Screenshot 2025-10-20 115237.png

Most professional rotary lasers have expensive accelerometers that can sense small tilts and then use small motors to adjust the angle of the spinning beam. This setup was a little fancy for me and definitely above my pay grade as far as complexity. To achieve similar (good enough) behavior, I simply exploited earth's gravitational field for a vertical reference. Unfortunately, my laser will not work in space (thus it cannot be a "giant space laser").


I used a gimbal (2D pendulum) to ensure that my beam stays level. I used a mass to provide inertia to the system. The laser was mounted on the gimbal pointing downwards onto a mirror. The mirror was mounted to the motor at a 45-degree angle, which will project the laser beam outwards horizontally.


My design also featured a lever that can be used to lock the pendulum from swinging. This is useful for storage, so the pendulum does not bang around inside the laser when not in use. A potentiometer was incorporated in the circuitry for the user to control the speed of the motor. A slower speed provides a brighter, less persistent laser line, while faster speeds result in a dimmer, more persistent line. It also has adjustable feet, so the unit does not wobble. It has a standard 1/4-20 thread tripod mount too.

Mechanical Design

Screenshot 2025-10-20 132705.png
Screenshot 2025-10-20 132721.png
Screenshot 2025-10-20 132247.png
Screenshot 2025-10-20 132933.png
Screenshot 2025-10-20 133043.png
Screenshot 2025-10-20 133122.png

I designed the 3D models of the 3D printed parts using Inventor. I have attached the STL files for 3D printing. Here is an overview of the parts in the above images:

Image 1: Two plain side panels

Image 2: Side panel with holes for power switch and potentiometer and side panel with holes for cord and lever

Image 3: Four corner frame extrusions

Image 4: Top frame, top cap, and bottom frame

Image 5: gimbal mechanism parts and motor/mirror parts

Image 6: Pot knob, lock lever, lock handle

3D Printing

Screenshot 2025-10-20 134125.png

All the above parts were 3-D printed on a Prusa MK4 in PLA with default settings for 0.15mm structural.

On the bottom frame, five 1/4-20 hex nuts were added to serve as threaded inserts. The four in the corners are for the adjustable feet, while the nut in the center is for the tripod mount. To add the nuts in the 3D-print, add a pause in the gcode so that you can drop the five 1/4-20 hex nuts into their spaces. The image above shows what the print should look like when the print pauses. For me, this was between layers 53 and 54, but may vary based on your printer and settings.

Also be sure to add supports where it is appropriate.

PCB Design

Screenshot 2025-10-20 112112.png
Screenshot 2025-10-20 112212.png

The brushless motor requires a little bit of external circuitry to run. I am by no means an experienced circuit designer, so there may be flaws in my design. But it seems to work, not blow up, and not start fires, so that's good enough for me!


I am using an ATtiny85 to control the brushless motor. Signals from the pins of the microcontroller control the transistors to energize the three phases of the motor in sequence. The potentiometer allows the user to control the speed of the motor by adjusting the frequency of voltage pulses to each transistor. The voltage regulator provides 4 volts for the laser diode.


I built the schematic and board in KiCad, a free ECAD software.

PCB Manufacturing

I used a small benchtop CNC router to manufacture the circuit board. I would recommend following along with this Instructable if you plan to make your own PCB. The board could also easily be ordered online for a fairly low cost. I have included the gerber files for the board. Alternatively, you could make the circuit yourself on perf board based on the schematic.

Programming

PXL_20251021_002430522.jpg

A small program needs to be downloaded onto the ATtiny 85 to control the motor. The program reads the position of the potentiometer which controls the speed of pulses sent to the transistors. I used an Arduino to program the ATtiny85 over ISP. There are a many fabulous tutorials on Instructables about how to do this, so I will not go into great detail here. The code is attached here.

Downloads

PCB Assembly

IMG_20241120_135546796.jpg
IMG_20241120_122502198_HDR.jpg

Everything could easily be soldered on the circuit board. Just be sure to pay attention to the orientation of the components, as there is no silkscreen as a guide.

In addition, leads had to be soldered onto the laser, potentiometer, power switch, and motor.

The motor has four pins. Three are for the phases and one is for common. If they are not labeled (as was the case on mine), simply use a multimeter to probe the resistance between every pair of terminals. The resistance between any two phases should be the same. The resistance between any phase and common should be about half as much as was measured between phases. For me, phase to phase was 1.9 Ohms and phase to common was about 0.9 Ohms. Be sure to know which pin is common. The other three are interchangeable.

Preparing the Mass

Screenshot 2025-10-20 140801.png

I used a small lathe to turn a chunk of steel to the dimensions shown. The exact size is not critical as long as it fits in the overall design. The thread on top is to attach it to the pendulum. The hole and chamfer on the bottom is for the lock lever to engage and prevent the pendulum from swinging. Shown is a dimensioned drawing. Most of the dimensions are not critical, rather just what I found to work with my design.

Assembly

Screenshot 2025-10-20 211656.png
Screenshot 2025-10-20 212922.png
Screenshot 2025-10-20 213122.png
Screenshot 2025-10-20 213408.png
Screenshot 2025-10-20 213653.png
Screenshot 2025-10-20 213948.png
Screenshot 2025-10-20 214350.png
Screenshot 2025-10-20 214737.png
Screenshot 2025-10-20 215512.png
Screenshot 2025-10-20 215610.png
Screenshot 2025-10-20 215716.png
Screenshot 2025-10-20 215918.png
Screenshot 2025-10-20 220103.png
Screenshot 2025-12-03 210327.png
Screenshot 2025-12-03 210446.png
Screenshot 2025-12-03 210544.png

Listed below are the steps for assembly of the laser. The rendered CAD images above show the process as well.

  1. Begin by assembling the pendulum. Screw the steel weight to the bottom pendulum frame with the shorter countersink screw.
  2. Fasten the motor to the bottom pendulum frame with some small screws. I used number 6 screws.
  3. Attach the motor mount to the motor rotor. I had to find some very small screws to fit the threads in the motor. I'm not sure what the thread size was but check your motor.
  4. Slide the mirror into the mirror holder and attach it to the assembly. I used two number 6 screws at the hinge and one spring-loaded number 6 screw at the top.
  5. Add the 4 two-inch standoffs. I used number 8 threaded screws with this.
  6. Screw the pendulum top to the assembly with the split washers between the standoff and the pendulum top.
  7. Place the laser in the top portion aiming down towards the mirror. Use some #4 screws at set screws to hold it in place.
  8. Now is a good time to calibrate the mirror angle. Skip to the next section to calibrate it (part 1). Then come back.
  9. With the mirror angle calibrated, add the gimbal swivel with #4 screws. Do not overtighten.
  10. Add the top cap to the gimbal with two more screws. Do not overtighten. At this point, the pendulum should swing freely.
  11. At this point, make sure the motor rotor assembly is relatively balanced. Power the motor and observe the vibrations you feel while holding the assembly by the top cap. Ideally, there would be no vibrations. You can play with the balancing by adding screws and washers to the radial holes on the motor mount part. Fiddle with this until you are satisfied with the vibration.
  12. Temporarily remove the top cap and insert the top frame below it. Fix the two together with some plastic thread-cutting screws. Re-attach the pendulum.
  13. Add the corner posts with more thread-cutting screws
  14. For now, do not slide the side panels into the slots. This will be done after the second calibration.
  15. Add the bottom frame. Screw up from the bottom into the corners.
  16. Add four 1/4-20 countersink screws as adjustable feet in the corners. Add rubber feet if you wish.
  17. The PCB can be mounted in the base with some #4 screws. A couple washers are nice to elevate it off the bottom of the base.
  18. At this point, you are ready to move on to finish calibration (part 2).
  19. After calibration, carefully remove one of the four corner uprights. This will allow you to slide in two adjacent panels. Use the panel with holes for power switch and potentiometer and the panel with holes for power cord and lever.
  20. Insert the lock handle with the spring inside of it. Slide the pin though hole once it is in the panel. The pin should ride smoothly in the grooves of the profile. Bolt the lock lever to the lock handle and be sure it can completely engage and dis-engage from the bottom of the steel mass.
  21. Add the potentiometer, power cord, and power switch to the other panel and finalize all wiring.
  22. Re-attach the corner post you took out and then remove the opposite corner post.
  23. Place the other two panels.
  24. Re-attach the last corner post.
  25. Assembly complete!

Calibration Part 1

Screenshot 2025-10-20 203636.png

This is the part that can be quite tedious. However, when rushed, this will result in a level that is not accurate and very useless. I calibrated in two different steps. I would have included real images rather than cartoons, but the camera shutter was much faster than the laser persistence, causing the laser to not show up in hardly any pictures.

The first thing I calibrated was the angle of the mirror. It is essential that this is 45 degrees so that the laser exits normal to the pendulum. This can be accomplished by placing the laser right next to a wall. Turn on the laser so it is spinning and plotting the laser beam. Then, look to see if the line on the wall is straight. You may need to crouch down and get right up next to the wall (just don't get shined in the eyes). If the mirror is not at the correct angle, the line will be curved as a "cone" is emitted from the tool. If the line is straight (does NOT need to be level at this point), then the mirror is correctly adjusted, and a "plane" is emitted from the tool. To adjust the angle of the mirror, adjust the spring-loaded screw at the top of the mirror holder piece.


Calibration Part 2

Screenshot 2025-10-20 203646.png

The next thing to adjust is the leveling of the plane. Place the laser on a hard floor about 10-20 feet from an empty wall. Use the screw-leveling feet to make sure the laser does not wobble. It may help to place the laser on a piece of paper so that it can easily be rotated by hand. Label on the paper the four sides of the laser (A,B,C,D or N,S,E,W for example). Spin up the laser. Note where the beam lies on the wall. It may be helpful to hang paper on the wall and mark the height with a pencil. Rotate the tool 90 degrees and repeat. Do this for all four sides. Based on which side is "high" and which side is "low", adjust the spring-washer loaded screws on the pendulum. Tighten a screw to raise the laser on that side and loosen a screw to lower hte laser. Repeat this process until the laser falls in the same spot from every side. At this point, the tool should be planar and level. Very carefully install the side panels. You may wish to re-verify the level.

Now You Have a Level

F5MF3GSMIQJXJA7.jpg

Congratulations! You now have a questionably accurate level! Just joking (unless you skipped the previous step). Anyways, I was able to achieve about 1/8 inch accuracy at ten feet, which I am satisfied with. Is it better than an off-the-shelf laser? No. Is it cheaper? Most certainly.

Good luck and have fun.