Shop OBEX P1 Docs P2 Docs Learn Events
How to Measure Ping Signals with Optascope? — Parallax Forums

How to Measure Ping Signals with Optascope?

dechief micheldechief michel Posts: 75
edited 2005-08-11 19:47 in General Discussion
Could you please inform me how i can measure the signal off a ping ultrasonic sensor with a optascope( maybe i need a external trigger?)
Thanks by advance
Michel Dechief
Belgium jumpin.gif

Post Edited By Moderator (Jon Williams (Parallax)) : 8/7/2005 2:29:03 PM GMT

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-08-07 14:27
    It's not really very hard -- the key is to widen the trigger pulse so that you can see it along with the echo return pulse on the scope.

    Here's what I did: I setup a very simple test program like this:

    Main:
    · LOW 0············ ' initialiaze Ping trigger pin
    · PULSOUT 0, 250··· ' long trigger pulse
    · INPUT 0·········· ' allow echo to be seen
    · END

    Since PULSOUT inverts the pin state we need to start with the pin low.· Then we do a wider-than-normal trigger·PULSOUT so that it can be seen on the scope.· In normal applications the next line would be PULSIN which makes the pin an input -- for this test we'll just simplify with the INPUT instruction so that we can see the echo pulse (if we didn't do this, the Stamp would hold the pin low and we wouldn't see the echo).

    Setup your scope to trigger at 2 volts or so, rising edge, single acquisition.· When the scope is armed (click Run/Stop) you can reset your Stamp circuit and you should capture two pulses like in the image I've attached.· In my case the echo pulse is 8720 uS wide.· Remember that this is the time for the pulse to go to and return from the target (ceiling in my case), so we have to divide this value by two.

    8720 / 2 = 4360······················ -- actual distance in uS
    4360 / 73.746 = 59.1 inches
    4360 / 29.034 = 150 cm

    PS: Don't forget to add a subject line to your new posts -- I fixed this one for you.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    798 x 597 - 128K
  • dechief micheldechief michel Posts: 75
    edited 2005-08-11 19:47
    Many thanks for your answer.
    It working without problem.
    But i stay with problem when i would to test voltage above 20 volts(i'm working in to earth moving material and voltage are 24 volt + charging of alternator.
    How can i do a voltage divider or a normal transfo to take my measerements.
    Thanks by advances
    Michel Dechief
    Belgium
Sign In or Register to comment.