Increase PING resolution to 0.5 cm
Bronson
Posts: 44
Hi,
Is it possible for PING))) sensor to detect distance with 0.5 cm precision/resolution?
I did it successfully with 1 cm precision.
Regards,
Bronson
Is it possible for PING))) sensor to detect distance with 0.5 cm precision/resolution?
I did it successfully with 1 cm precision.
Regards,
Bronson
Comments
Thanks for your input. Now I understand why there is no resolution information on the spec sheet for Ping))).
Regards,
Bronson Alex
I imagine the total distance you want to measure is also important. Do you have a distance range where you want this type of accuracy.
I have some example code I use with my Ping connected to a QuickStart board. It displays the Pings readings (in mm) on a little four digit 7-segment display. I'll test its accuracy if you'd like. What range would you like me to test.
-Phil
The purpose of this is I can adjust the Ping to suit the environment.
At this moment, my formula is DISTANCE = (2260 ** TIME).
If I can calibrate, I can re-calculate the constant value (2260) according to environment.
The problem is I don't really understand how to invert ** operation.
Duagne: The distance range is 80 cm only. I really appreciate if you can do some testing with your board. Thanks a million!
Regards,
Bronson Alex
I just did some testing with my Ping and a QuickStart board. Man, those Pings are impressive. I set the Ping on the table and had it measure the distance to the ceiling. The Ping measured the ceiling as 1681mm away (it would sometimes flucuate to 1681mm). I got out my tape measure and sure enough the ceiling was 1680mm from the front of the Ping sensor.
I moved the Ping sensor on top of my battery pack and it then read 1662. You guessed it, my battery pack is 18mm thick.
I measured several other distances (including some about 800mm) with both the Ping and my measuring tape. The two measurements always agreed within 2mm. I'm not sure if the 2mm difference if from the Ping or my ability accurately measure distance with my tape measure.
All these tests were done with nice flat surfaces such as the ceiling and the floor.
I also measured distances to my hand and a soda can. At a little over a meter away the ping didn't always sense the presence of the can (unless the bottom of the can faced the Ping).
My assumption is, if the Ping can sense an object, it can measure its distance precisely.
Blowing across the front of the sensor didn't seem to affect it. I got out my heat gun and blew hot air across the front of it (it fluctuated a couple of mm) (only a few inches of the air in front of the Ping was heated). I haven't tested the Ping in air of different temperature but the affect of heat on the speed of sound is pretty well understood (more on this later).
I just read up about the speed of sound on Wikipedia. The speed of sound in dry air at 25C is 346.45 m/s. The Basic Stamp's 2us resolution in time should translate to 0.69mm resolution in distance. The best precision that can be expected when using a Ping sensor with a Propeller is about 0.004mm. Of course this assumes you've very accurately measured the temperature. A 5C change in temperature would throw off your reading by about 1%. Humidity can influence the reading by up to 0.6%.
My gut feeling is the 0.5 cm resolution shouldn't be too hard to achieve with a Ping. If the temperature and humidity are likely to vary a lot then Phil's suggestion of a quick calibration should help the microcontroller compensate for the difference in the Ping's output. If the Ping is always going to be in the same location, you could use the floor or the ceiling as calibration references.
Edit: I just looked at the Ping object for the Propeller. Its resolution is 1us which gives a distance resolution of about 0.35mm. The Propeller would need a different Ping object to get 0.004mm (12.5ns) resolution. With all the other unknowns, I doubt it would be worth the trouble to increase the Ping object's current resolution.
OMG!!! You have done a lot to help me. Can't thank you enough.
Thanks for your valuable information.
Regards,
Bronson Alex