Shop OBEX P1 Docs P2 Docs Learn Events
Question about Timing Sonar Pulse — Parallax Forums

Question about Timing Sonar Pulse

bobledouxbobledoux Posts: 187
edited 2005-01-24 10:46 in BASIC Stamp
I'm working on a sonar application. The Stamp issues a Pulsout command that turns on a 555 timer to emit 12 ultrasonic pulses at 24khz. I then want to determine the length of time it takes to get a return.

How can I measure the return time? I need to resolve a range of 3 to 5 milliseconds. I don't see how the Pulsin command can work. The pulsout command actually represents the start of the time pulse. So a complete pulse switch, as required by Pulsin (like high to low to high) can't take place. The return I actually get is only low to high.

Any ideas out there?

I could program a PIC to send the pulsout, then drop a line, which returns to high with the sonic return. The Pic could could count time for the sound travel. But I was hoping to avoid a second processor in the project.

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-01-03 02:25
    Have a look at project 12 in this document: http://www.parallax.com/dl/appnt/stamps/bs1Appnotes.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • bobledouxbobledoux Posts: 187
    edited 2005-01-03 14:05
    My problem is that the transmitting and receiving transducers are separated by the distance, across which I want to measure the pulse. Project 12 uses the presence of the transmitted pulse to start the Pulsin time period, and then waits for the echo return to end the Pulsin period.

    My application is this: A beacon contains sonar receiver and radio transmitter. Robot holds sonar transmitter and radio receiver. The distance between robot and beacon is measured by time of flight of sonar from robot to beacon plus radio return from beacon to robot.

    Using a Pulsout command to generate the sonar transmission results in no way, I can tell, to initiate the Pulsin command, as the leading pulsin edge change has occurred before the pulsin command takes place.

    One possibility is to program a PIC to pull a line low when it sends the 12 pulses for the sonar transmitter. Let the Pic monitor the radio receiver and pull the line high when the echo is heard. The Stamp could time this period using the Pulsin command.

    Thanks for your input, Jon.
  • TinkererTinkerer Posts: 1
    edited 2005-01-24 03:28
    About the sonar.bas program- is see it's counting time in 10 microsecond ticks. Is there any way to change that? I want to adapt the project to use audible sound and longer distances. I don't need time increments that small.
  • JavalinJavalin Posts: 892
    edited 2005-01-24 10:46
    You could also look at http://www.robot-electronics.co.uk/, they make and sell a number of Ultra-sonic rangers - the popular SRF04 and SRF08
Sign In or Register to comment.