Laser Pointer Ultrasonic Distance Finder

by TechMartian in Circuits > Arduino

6158 Views, 74 Favorites, 0 Comments

Laser Pointer Ultrasonic Distance Finder

UNADJUSTEDNONRAW_thumb_b66.jpg
Screen Shot 2017-08-30 at 7.27.09 AM.png

This is a ultrasonic distance measuring tool with a laser pointer to find the exact range for that particular point in space. It's also a nice touch if you want to have 'spidey' senses at a comic-con.

This is instructables is made with the request of fellow author @watchmeflyy as well as other members of the community.

Circuit

Screen Shot 2017-08-30 at 7.27.01 AM.png
Screen Shot 2017-08-30 at 7.26.34 AM.png
Screen Shot 2017-08-30 at 7.26.46 AM.png
Screen Shot 2017-08-30 at 7.26.28 AM.png
Screen Shot 2017-08-30 at 7.26.40 AM.png
Screen Shot 2017-08-30 at 7.26.21 AM.png

Mount Laser

UNADJUSTEDNONRAW_thumb_b65.jpg
UNADJUSTEDNONRAW_thumb_b64.jpg

Glue the laser on top of the Ultrasonic sensor. The closer it is to the centroid of the sensor the more accurate the readings will be as the offset source of error will be very limited.

Code

Screen Shot 2017-08-30 at 8.11.18 AM.png
#include  <LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
const int trigPin = 9;
const int echoPin = 10;
long duration;
int distanceCm, distanceInch;
void setup() {
  
lcd.begin(16,2); 
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
}
void loop() {
  
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distanceCm= duration*0.034/2;
distanceInch = duration*0.0133/2;
// cm distance
// column 0 row 0
lcd.setCursor(0,0); 
lcd.print("Distance: "); 
lcd.print(distanceCm); 
lcd.print("  cm");
delay(10);
//imperial distance
// coloumn 0, row 1
lcd.setCursor(0,1);
lcd.print("Distance: ");
lcd.print(distanceInch);
lcd.print("inch");
delay(100);
}

Enjoy!

Screen Shot 2017-08-30 at 7.27.09 AM.png

Wear it as a wrist watch for your spidey senses or just hold it on your hand like a normal person. Aim and measure!

Enjoy!