Pages: 1 [2]   Go Down
Author Topic: Measuring Distances with Ultrasonic Sensors  (Read 3199 times)
0 Members and 1 Guest are viewing this topic.
Flagstaff, AZ
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Johnny1212,

in retrospect, it would have helped if you had posted a good link to info on the US-100 sensor,
especially where to find the datasheet. All I've found so far are amazon and ebay ads for it,
which indicates it's yet another chinese knockoff, seling for about 1/4 the price of standard
sensors.

Pretty soon, we'll be able to buy EVERYTHING from china at huge discounts, and they'll own
all in sight :-).



Good point. I am actually testing with that and also trying the Ping. I hear you on the China thing. I am trying to find an alternative to my iPhone that is made in the US but it seems like every one is made in China, specifically Foxconn. I just feel guilty knowing the conditions and pay those people endure. If anyone knows good sensors manufactured here I would be happy to pay the extra money;)
Here is the guide for the ping-
http://www.parallax.com/Portals/0/Downloads/docs/prod/acc/28015-PING-v1.6.pdf
More than anything I was referencing this type of sensor. Also, if anyone knows of any cheap laser sensors that would be great. 2D is fine as this will be a single static point being measured;)
Logged

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 158
Posts: 2882
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

We all know where the Ping info can be had. The question is how to find the data
on an offbrand device made in China.

Quote
knows of any cheap laser sensors

I'm not sure 'cheap' belongs in a reference like this. Parallax does sell a laser device you
can check about.
Logged

Flagstaff, AZ
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, I do have a Parallax on order. As far as the US-100 it was more of a question on ultrasonic sensors being capable of measuring in mm;) I will be testing with all of these to see if any fit the bill. I really appreciate everyone's input!
Logged

Flagstaff, AZ
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Alright, I have this setup and working with the Ping sensor and 16x2 serial dispay. Currently I get a reading in mm showing the actual distance to an object and it seems fairly accurate so I want to move on to my next need.

I need to display the difference of an initail value minus the current value. Basically I would turn the unit on and point it at the object. I would like to capture that value and then use it to subtract the real time value from that initial reading. If the value is 200mm I would want to subtract that from all future readings so looking at the same distance it would read 0 (200-200=0 and print 0 to the LCD rather than 200) and as the object comes closer it would read the difference i.e. 200-150=50 and print 50 to the LCD. I figure if I could have a button to capture the intitial value then use it to produce results from there it would do what I am trying to accomplish. I am just not sure how to accomplish this. If anyone has any input on how to do this,code or command examples or a better way of looking at this I would greatly appreciate it;)
Logged

UK
Offline Offline
Shannon Member
****
Karma: 222
Posts: 12534
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

200-150=50

What you're looking for is called 'subtraction'. You need to store your reference value in a variable, and then 'subtract' the reference value from your measured value to get the display value. You need some way to tell the Arduino to store the reference value, for example using a button.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Flagstaff, AZ
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Peter, that makes sense. I did read up on variables and this makes sense! I will try setting this up later in the week. Thanks for your input!
Logged

Pages: 1 [2]   Go Up
Jump to: