So this Lazy Old Geek purchased a Laser Cross. I created a manual leveling Laser Cross to use for aligning stuff on my drill press:

Well, being a Geek I decided to make an automated platform that adjusts automatically with an Arduino.

Well, the picture may look a little scary but I’ll break it down into little bitty parts.

Step 1: Parts Lists

Parts List Laser Assembly
650nm <5mW Laser Cross Module Diode $4.85 ebay
The laser diode in the module is an HLM1230

I made my laser current source using this:

Parts List Laser Current Source
LM317 regulator $0.24 TaydaElectronics.com
100 Ohm potentiometer $0.21 TaydaElectronics.com
1N4001 diode $0.01 TaydaElectronics.com
10uFd 50V capacitor $0.03 TaydaElectronics.com
47 Ohm resistor $0.01 TaydaElectronics.com
            (used instead of the two 10 Ohm resistors)
PCB I used a hunk of the following:
            5* Breadboard Bread Board Prototype 432 Points 5*7cm
            $1.39 ebay
Did not use a pushbutton

Parts List Tripod Mount
6 x AA battery holder with 2.1mm plug AdaFruit.com $5.00
1 used plastic cutting board
1 discarded music CD player mechanical assembly
1/4 x 20 nut
Miscellaneous 6-32 and 10-32 hardware
2 Mitsumi M35SP9 stepper motors salvaged from old printers. These are unipolar stepper motors. If you have or get different stepper motors, you may have to design your own interfacing and modify the software accordingly.
1” 7/16” vinyl tubing
Hot shoe bubble level $0.99 ebay.com Hot shoe is a camera term.

Parts List Arduino-clone
L.O.G. $10 Arduino (modified)
1 ULN2003 Darlington driver $0.20@ TaydaElectronics.com
2 BS170 FETS $0.26@ TaydaElectronics.com
1 Dip switch 4 position piano $0.34@ TaydaElectronics.com
1 FreeScale MMA7361 Module inclinometer accelerometer. I got my in an ebay auction for $9 but they’re available for $10-$14 from ebay.
PCB I used another hunk of the following:
            5* Breadboard Bread Board Prototype 432 Points 5*7cm
            $1.39 ebay.com
Totally cost is less than $30, most for Arduino-clone and battery box.
I am not going to go into the details of making the Laser drive current source as it is explained in the above website.

The HLM1230 is designed for 25mA or less. This is how I determined the 47 Ohm resistor value. (See picture) I added a 2.1mm power plug from my scrap pile.

Step 2: Laser Safety and Information

Any laser you buy will have a DANGER stick similar to this one. The particular laser that I am using is 5mW. The typical laser pointer is 1mW. Now I’m haven’t researched laser safety that much but as I understand it, even a 1mW can damage the eye if looked at directly. This one is five times more wattage so use carefully. Do not aim it at a person or animal. 

Some readers may wonder how the cross is generated. Search Ebay.com for this: 650nm <5mW Laser Cross Module Diode
Some of the pictures (See picture) show that this module actually projects a red cross. This is created by a special lens used in this module. You can adjust the orientation by rotating the lens mount. 

By the way you can get lenses that generate just lines or multiple lines and other patterns.

Step 3: Tripod Mount

My original design used two music CD cases. They seemed to be fairly sturdy but not too heavy and about the right size. However, the plastic is rather fragile to work with. I ended up with a lot of cracks and it wasn’t very stable. So my next design uses a stiff plastic cutting board, I got from my cousin.

Design: I decided on a three point design with a bottom and top piece of plastic. The bottom piece is attached to the tripod. The top is attached to the bottom with three long bolts. The upper left corner is a fixed pivot point, the upper right and lower left corners have bolts attached to stepper motors so that the top piece can be leveled. After the problems I had with the CD cases, I decided to design this one a little better and started with a drawing for the base. (See picture)

Tripod base:
My CAD program isn’t that good and I’m not very good at using it, so the drawing is not really clear. From the plastic cutting board, I cut a 5 ¾” x 7” piece.
In the center I marked an X for the hole where the tripod nut will go.
Then I drew four lines to locate where the three points for the pivot point and stepper motors go.

Tripod Mount:
In the center, drill a 3/8” hole. This was determined by measuring across a ¼ x 20 nut. All tripods use ¼ x 20 bolt to mount the camera or in this case my fixture. The hole is a little smaller than the nut.
To embed the nut: Thread a ¼ x 20 nut onto a bolt. (The nut gives you more leverage with a wrench to pull the nut into the plastic) Put a washer on the bolt. (See picture) Slip the bolt through the central hole in the bottom piece and put a nut on the bolt. (See picture)
Center the nut over the hole. Use a 3/8” wrench on the top side to pull the bottom nut into the plastic. (See picture)

Measure and draw the four lines on the base. Choose the corner for the pivot. I chose the upper left corner.
The upper right and lower left corners are the stepper motor corners. (Lower left is not used) They are 4.25” from the pivot corner. For these, you also want to mark the locations for the mounting hardware. I found the specifications for the M35SP9 stepper motors. The mounting holes are 42mm apart or 21mm from the center.

I used 10-32 hardware for the standoffs. So drill a 3/16” hole for the pivot. I used 6-32 hardware to mount the stepper motors so I drilled 9/64” holes for the motors.
I left the gears on my stepper motors so I drilled 5/8” holes using a spade bit for the gears and tubing to pass through.

Pivot point: The only long 10-32 bolt I had was 2 7/8” so I put a nut on it, screwed it through the pivot hole and put a nut on top. I put two nuts on the bolt screwed them down about 1/2” for the pivot point and tightened them together.
Near the motor locations, I also drilled a couple of big holes for the wires to pass through. The motors will be mounted underneath but the wiring will go to my custom Arduino on top of the base.

Steppers: I installed the steppers with 6-32 hardware. I cut two short pieces of 7/16” vinyl tubing and stuck it over the gears. Then I stuck two 10-32 x 2” stove bolts into the tubing. If everything goes right, the three bolts will line up with the top assembly.


Step 4: Accelerometer

Theory: So you may ask what is an accelerometer? I asked that myself. Here is the Wikipedia definition: “An accelerometer is a device that measures proper acceleration.” So this doesn’t help very much. You have to go back to your old high school physics class and remember that gravity is also acceleration, so these accelerometers will actually measure tilt due to gravity.
I did some research on accelerometers. Their sensitivities are measured in Gs (Gravity). To put it simply if it’s lying flat, that is 0G (for the X and Y) and it it’s turned 90 degrees then it is 1.0G. It can go higher than 1.0G if it is in motion.
Accelerometers have two or three axis, X,Y and Z. This is like mathematical graphing. I like to think of it as East-West, North-South and Up-Down.

MMA7361: I selected the MMA7361 accelerometer module for the following reasons:
Highest sensitivity is +/- 1.5G. this translates into a theoretical resolution of 0.5 degrees.
Low price ~$11 for a module
Analog output. While many accelerometers have digital outputs, for me analog is easier to work with.
The X,Y and Z orientation is marked on the PCB. (see picture)

Technobabble: The MMA7361 IC has analog outputs. The ‘zero’ output is about 1.65V and the output is 800mV/G. With Arduino Aref set to 3V, that means we can theoretically measure about 1/3 of a degree of movement.
This MMA7361 IC is a 3.3V device but the module has a 5V to 3.3V regulator on it. My schematic says it’s a RT9161 but I looked carefully at my module. The regulator is a 1117/3.3. These are typically rated at 800mA and the MMA7361 IC requires about 500mA. I am going to use this 3.3V source to power my Arduino AREF pin which will add about 0.1mA to the regulator. Not a problem.

 The MMA7361 module has 0.1” header pins on the sides (See picture). So for the accelerometer mount, I used another hunk of the prototype board and added two female headers 0.9” apart. Now as I recall the header pins are greater than 0.9” apart but that’s okay as it just holds the module a little tighter. (See picture) (In hindsight, I probably should have used 1.0” spacing but 0.9” worked fine)
On the other side, I connected GS(elect) to GND so that sensitivity is fixed at +/- 1.5G. I put a 10k resistor from SL(eep) to 3.3V (not to 5V).
Then I connected 30AWG wire wrap wire to 5V(Input power), Gnd 3.3V(Output to Arduino) and X and Y (Analog outputs, Z is not used. Z would be useful if it was dropping or rising, like in an elevator or rocket).
I also drilled two bolt holes to mount the protoboard.


Step 5: Top Plate

I cut another piece of the cutting board 5.25” x 5”.
I marked the same 4.25” square, centered on this top plate.

I drilled a 3/16” hole for the pivot corner and 3/8” holes for the adjustable corners.
Using the same technique, I pulled 10-32 nuts into the adjustable corners. (See picture)
My CD mechanism has three mounting holes with rubber gaskets for cushioning.
I positioned it so that the CD would be centered on the top and drill three holes for mounting.
Next I had to make a cutout for the accelerometer mounting board. With the CD assemble attached, I positioned the board near the pivot point. The way I have the accelerometer oriented, East-West is ‘X’ and North-South is ‘Y’. ‘Z’ is not used but would be up-down.

Theory: I was thinking it would've been better to mount the accelerometer in the opposite corner from the pivot point. Bu I guess, theoretically, it shouldn’t matter where the accelerometer is mounted on the top plate. It’s probably good to align the accelerometer square with the three corners.

I marked and drilled the mounting holes and cut a hole about 1 1/8” x 3/4” for the female headers to clear. Yes, it's ugly.
Then I attached the CD mechanism, the adapter board and the accelerometer module. The accelerometer attaches to the bottom of the adapter board so CDs will move freely on top.
The accelerometer doesn't care if it is upside down or not. 

Step 6: Attaching the Laser Cross Diode

I used an old regular CD and a mini-CD.

Ok, here is my funky laser mount. (See picture) I took a strip of aluminum from an aluminum ‘For Sale’ sign and bent it around my laser housing in a kind of ‘P’ shape. I drilled a 9/64” hole in the bracket so that when a 6-32 screw and nut are used it will clamp down on the laser housing. I drilled a 9/64” hole in the mini-CD so that the laser will be about through the middle of the CD. I also used a rotary tool (Dremel clone) to open up the mounting hole. Then using a short flat head screw through the bottom of the mini-CD, I attached the laser.
Since the screw sticks out, I drilled a corresponding bigger hole in the regular CD to accommodate the head of the screw. For now, I just used some double sticky tape to join the two CDs together. Now the whole assembly can snap onto the CD mechanism on top of the two CD cases.

Step 7: Arduino

Design: The Arduino reads the X and Y voltages from the accelerometer. If they aren’t ‘zero’ then it sends signals to the East-West and North-South steppers motors. The motors turn the screws that position the top platform. So when the platform is level, the accelerometer will read zero and the steppers will stop. When it is level, it will also apply power to the laser diode.
I also added a couple of switches. As the assembly is shuffled around it may loose calibration so a switch will put it into calibration mode.

The stepper motors require more current then the Arduino can supply so I used a ULN2003 Darlington driver. Each motor requires four drivers. The ULN2003 only has seven circuits. So I added a BS170-FET for the eighth circuit. The other BS170 is for sending power to laser.

Power: The laser drive circuit is constant current so voltage is not critical but it is suggested it be over 7Vdc. For convenience I wanted portable power so I used six AA rechargeable batteries in the AdaFruit holder. With fully charged NiMh batteries, it puts out about 8.4Vdc. This supplies the laser and the stepper motors directly. I put a 5Vdc regulator on the PCB for the Arduino.

Assembly:  The Arduino is the basic Arduino with reset as I have in my L.O.G. $10 Arduino. It is positioned on the board so that there is room for the ULN2003. I am not going to go into a point-to-point assembly as I am Lazy. I did include a schematic and pictures of the top and bottom.

Clarifications: Mitsumi M35SP9 stepper motors. I am using Eagle schematic software. I couldn’t find anything close to a stepper motor so I used a center tapped transformer instead. The pins aren’t numbered on the Motor PCB so I made up the numbers according to the picture. These correspond to the schematic numbers. These motors had a connector with wires on them (one yellow and one black) so I just wired these directly to my Arduino PCB.

I soldered some white wire wrap wires to the MMA7361 adapter board, 5Vin, 3.3Vout, Gnd, Xout and Yout. The other ends went to my Arduino PCB.
I had a 2.1mm jack that I wired to my Arduino PCB. The jack plugs into the laser drive.
I only connected two of the four piano-type switches.
What I called the RS232 connector connects to a USB-BUB or my USB adapter:

I also drilled thee holes in the base plate to attach the Arduino PCB. I actually drilled the holes too close to the edge of the PCB so they broke off. But I had enough to put nuts on the bolts. Since my drilling accuracy is bad, I just forced the bolts into the base plate and didn't bother to put nuts on the other side.

Step 8: Assembly

The bottom plate should have the pivot screw and two adjuster screws attached to the stepper motors sticking up. 
Attach the Arduino to the base. The wires from the stepper motors should already be connected.
So should the five wires from the acclelerometer adapter.
Slip the top plate over the pivot hole and manually turn the stepper screws into the top plate until it is about level.
Place a 10-32 nut on the pivot bolt. Do not tighten as this is where it pivots.
Put the laser assembly onto the CD mechanism.
Plug the power plug from the Arduino into the laser current drive.
Put the hot shoe level onto the CD.
Attach the fixture to a tripod.
Place the AA adapter on to the bottom plate.
Plug it into the Arduino.

Step 9: Arduino Software

The Arduino sketch is attached.

Comments: I used the stepper motor library for the stepper motors. I 'borrowed' this interface from another Instructable or off the Internet but can't remember where. There is an abundance of information on driving stepper motors, though.

The accelerometer zero values for North-South(Y) and East-West(X) have to be determined for each fixture. My plan was to store the ‘zero’ values in EEPROM so the fixture could automatically calibrate itself and store the zero values in EEPROM. But I couldn’t get this to work. So I settled for a version that could autocalibrate and find the zero values but it wouldn’t save them if power was lost or reset. The next step explains how to calibrate the zero values.

Step 10: Software Calibration

Set the fixture on a tripod. Manually adjust the stepper motor screws so that the top board is fairly level with the bottom. Stick the bubble level on to the CD. Adjust the tripod so that the bubble is centered.

Plug the Arduino into a computer. Push the calibrate switch down. Open (the Arduino) serial terminal. The display should be displaying the center EW and NS voltages. Find the average values.

Open up Autolevel.pde in a text editor. I use Notepad++.

Change the two following values for the averages you found. They should probably be between 1 and 2.5.
           const float NSCenter=1.577;                                

            const float EWCenter=1.733;

That should complete calibration.

Step 11: Using AutoLevel Fixture & Conclusions

Attach the base to a tripod.

Manually adjust the stepper motor screws so that the top board is fairly level with the base.

Adjust the tripod so that the top looks fairly level.

Make sure the rocker switches are all up.
Plug in the AA batteries into the Arduino.
The program should adjust the steppers until the top board is level.
Then it will turn on the laser.
After runtime (15 seconds), the laser will briefly shutoff to check the calibration.

Conclusions: Well the fixture does what I expected it to do. It’s not too reliable. Sometimes it tries to adjust past where it should and I have to push the reset. It could probably use some work in the sketch and maybe the electronics. But I am Lazy and probably won’t do any more for now. Still it was a good learning experience in utilizing an accelerometer and ‘automated’ feedback.

<p>I love the &quot;over complicated-ness&quot; of this build. Using an Arduino just because you can!.</p><p>A simpler solution to avoid the Autocalibration process from 'over correcting' itself would have been to use a simple gimble with a rod protruding straight and a heavy weight on the end. This would 'Auto-level' automatically due to gravity.</p><p>Love this! </p>
<p>Nice project!</p><p>Hint: you can find the MMA7361 and other sensors for cheap on this website:</p><p></p><p><a href="http://voltatek.com/en/sensors/82-mma7361-angle-sensor-accelerometer-inclination-module.html" rel="nofollow">http://voltatek.com/en/sensors/82-mma7361-angle-se...</a></p><p>They ship from Canada.</p>
<p>Thanks,</p><p>Here's a cheaper one:</p><p><a href="http://www.ebay.com/itm/Arduino-MMA7361-Angle-Sensor-Inclination-3-axis-Accelerometer-Module-/130982828723?pt=LH_DefaultDomain_0&hash=item1e7f2f5ab3" rel="nofollow">http://www.ebay.com/itm/Arduino-MMA7361-Angle-Sens...</a></p><p>But prices are pretty volatile.</p><p>LOG</p>
dude your a genius
Great project, thank you, but how does this apparatus help you aline stuff on your drill press?<br><br>Seems like it needs to be turned 90˚ to aline with a drill press table.<br><br>It looks like you are projecting against a wall.<br><br>Ralph
Yes, for the picture, I am projecting it against a door. It shows up better.<br>Since I built the automated version, I haven't actually used it with my drill press. I did use the manual version to line up some PVC I was drilling.<br><br>LOG
Cool. Lots of technology and and know-how all coming together in a rather complex project. You gave me a good idea on how to make good mechanical use out of stepper motors (rotary motion into linear motion via the screw and nut).<br><br>Hope you can tweak this project to make it reliable and work for you . . . <br><br>Thanks for sharing.
Thanks,<br><br>Actually, I got the concept from a lot of the DIY CNC Instructables. Most of them use steppers with a threaded shaft.<br><br>LOG

About This Instructable




Bio: Lazy Old Geek
More by msuzuki777:Senior Moments Weather Station 5 IP Time Clock Part 2 
Add instructable to: