Measuring Distance With Lasers

by HarshadB9 in Circuits > Arduino

3940 Views, 11 Favorites, 0 Comments

Measuring Distance With Lasers

PicsArt_03-25-05.14.44.jpg
Screenshot (2).png
Screenshot (18).png
Screenshot (13).png
Screenshot (19).png

In this project I made a simple device which can measure the distance between itself and any physical object. The device works best at a distance of around 2-4 meters and is fairly accurate.

Watch the YouTube Video

Measuring distance with Lasers

This video contains all he information you may need as well as some manufacturing steps I took for making this project. Off course you need not follow the exact same steps. Be creative and come up with something better. If you do so, don't forget to share it or at least message me .

Make the Physical Structure

IMG_0060.JPG
IMG_0058.JPG
IMG_0059.JPG
Screenshot (3).png
Screenshot (4).png
Screenshot (5).png
Screenshot (6).png

I used a hollow rectangular cross section with the above dimensions. The material I used was aluminum but this does creates some minor problems and if you have access, use some non conductive material. This will save you some trouble as metals can short our power supply and cause problems. With plastic we are completely safe.

I used a length of 12 cm with 10 cm between the two lasers. I also used some fancy instruments to make some near prefect cuts.

Lastly I drilled the holes for the potentiomenter. I was exceptionally pleased with the drill quality.

The Circuitry

Screenshot (17).png
Screenshot (8).png
Screenshot (9).png
Screenshot (10).png
Screenshot (7).png
Screenshot (11).png
Screenshot (12).png

There was nothing great to design in this circuit. Just simple wiring as mentioned in the first image. As mentioned earlier, I had to add a piece of electric tape to prevent any wires touching the metal surface. I then cut female headers of appropriate size for Arduino and the oled display, added some two part glue to it and pasted them on the aluminum.

The only thing that was left to do was add the wiring connections which is peaty much self explanatory.

Just make sure, there are no unwanted shorts at the end.

Calibration

Screenshot (13).png
Screenshot (18).png
Screenshot (14).png
Screenshot (15).png
Screenshot (16).png

Arduino is not going to give the correct values form the very first time. I first programmed the arduino to output the analog values and then I compared the analog values to the actual values.

I then took dozens of readings imported them all in Geogebra and adjusted some tangent function to give more or less accurate values. This process was tedious and time consuming.

At the end I came up with this large function and it worked out just fine.

Upload the Code and Enjoy.

Screenshot (2).png
Screenshot (19).png

As a last step I added the function to my arduino code and this time the device stared displaying the distance.

If you use similar dimentions the code should work for you as well. If not, try re calibrating the nano

HAPPY DOING IT YOURSELF..............