Go Down

Topic: Measuring Distances with Ultrasonic Sensors (Read 3 times) previous topic - next topic

Johny1212

I am new to arduino and am interested in using this with an LCD display and a US-100 ultrasonic sensor to measure distance. I would like to set this up to measure distances from 20-800mm in 1mm increments. I know this is within range for the sensor but need to know if it can be setup to display distance in mm not cm. is this possible? The next thing I would like to do is be able to point it at an object, zero it out to read 0mm then measure the distance of the object relative to the original location. I would be moving the object toward the sensor so if it moved 55mm closer I would get a reading of 55mm. This seems reasonable to me but I just started working with the arduino today and have to get up to speed on the code. If anyone has any ideas or feedback on the feasibility of this or has any examples/guidance I would be very grateful!

oric_dan

Check the IDE "Files > Examples > Sensors" directory for Ping sonar code example,
and also the Arduino Playground for other sonar examples. I'm not familiar with US-100,
so it probably works differently.

The way the distance is displayed is determined by how you scale it and print it AFTER
you take the reading. See the Ping example above. 1" = 2.54 cm = 25.4 mm, it's just
a scalefactor.

terryking228

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Johny1212


Check the IDE "Files > Examples > Sensors" directory for Ping sonar code example,
and also the Arduino Playground for other sonar examples. I'm not familiar with US-100,
so it probably works differently.

The way the distance is displayed is determined by how you scale it and print it AFTER
you take the reading. See the Ping example above. 1" = 2.54 cm = 25.4 mm, it's just
a scalefactor.

Thanks! I will check this out!

PeterH


distances from 20-800mm in 1mm increments


Check that your sensor is capable of providing the range and resolution you're asking for before you worry about how to format the results.
I only provide help via the forum - please do not contact me for private consultancy.

Go Up