Ultrasonic Rangefinder Timing

dj_trippn

New Member
Hey, I have been experimenting with making my own ultrasonic rangefinder. Im outputing from picaxe to 555 to produce the 38kHz transmit signal. And I can recieve the echo receive as a digital signal by putting it through a comparator.
What I am wanting to do is measure the time from transmitting to when I receive the receive signal. I tried using a counter and just incrementing it in a loop until I receive the signal but this is to slow. I though about using count to count a input pulse of known frequency, but this only counts for a certain time, not until a pin goes high or low.
Can anyone help me with this timing problem?
Thanks, Glenn G
 

mattrich

New Member
Hi dj_trppn (your off BrightSparks aren't you - its matt!)

Yeah pulsin is the way to go. Perhaps you could consider also PWMOut on an 08M/2X instead of the 555 timer - would be a lot simpler and outputting a 40KHz is as easy as doing:

PWMOut x, 24, 50 ' 40.0 kHz

(x is the output pin)

Cheers

Matt
________
CHARLIE SHEEN WINNING
 
Last edited:
Top