[Lab] range finding
j ross
waterfallclose at gmail.com
Wed Feb 5 14:34:30 EST 2014
Some thoughts:
1) Increase timeout value
The input loop runs at the rate of the DigitalRead() but the timeout is
reached based on the number of iterations of the loop, not a fixed time.
Try increasing the SDM_IO_TIMEOUT to something bigger like 10000.
2) Increase pulse length
The longer the pulse, the more energy you put into the air. Ultrasonic
frequencies get attenuated quickly in air so power is important to range.
Try a pulse length of 50us instead of 10.
Hope that helps!
Jeff
On Wed, Feb 5, 2014 at 2:02 PM, Darcy Whyte <darcy at inventorartist.com>wrote:
> Hi, I have one of these (I think)
> http://ramshackblog.blogspot.ca/2012/02/ultrasonic-range-finder-using-sdm-io.html
>
> It has four pins.
>
> I've got it working using the code at that page. It measures really well
> up to about 30cm then after that it just prints out 999 cm?
>
> I noticed with a piece of paper I can get further (around 70cm).
>
> It's supposed to be good for 150cm.
>
> Any ideas what's going on here?
>
> I have two of them and I tried the other one (in case it was a bu
> component). But same result...
>
>
> --
> Darcy Whyte
>
> Art+ inventorArtist.com <http://inventorartist.com/> | Aviation
> rubber-power.com
> Contact: darcy at inventorArtist.com | 613-563-3634 by appointment (no text)
>
>
> _______________________________________________
> Lab mailing list
> 1. subscribe http://artengine.ca/mailman/listinfo/lab
> 2. then email Lab at artengine.ca to send your message to the list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://artengine.ca/pipermail/lab/attachments/20140205/221e0150/attachment.html>
More information about the Lab
mailing list