Shop OBEX P1 Docs P2 Docs Learn Events
Stock#: 28015 sonar sensor - parallax — Parallax Forums

Stock#: 28015 sonar sensor - parallax

tehmoordartehmoordar Posts: 52
edited 2005-04-26 01:03 in BASIC Stamp
Hi
this sensor is from parallax to me it look new. Previously I have been using SRF08 but I want to use this simple sensor- I need to know few things about it like-- if I connect its signal to O-scope would I be able to see both the frequencies that is pulse out and pulsein. Can i calculate the pulse width on Oscope. remeber I will only be taking out signal from bread board to O scope.
I hope it is not working on the principle of I2c protocal.
Once in the program·on web for this sensor·define
scale $200 for basic stamp 2·· what does that mean--- is it holdind basic stamp form 2 msec before it goes for pulsein command.
once again my purpose is to see the signal on Oscope can I do that. and calculate distance from there ( oscope).
Thankyou

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-04-12 21:34
    Actually studying the documenation code and commands you don't quite understand will be useful, and while you're doing that I'll give you a couple hints to get you started:

    1. Yes, you can watch the signals on a scope.· The line between the BASIC Stamp and Ping will go high for the trigger, will drop, then will go high again for the echo pulse.· Yes, you can derive the distance to the object by measuring the echo (second) pulse.· The pulse will represent 2x the distance to target (out and back, hence 2x).

    2. The BS2 has a resolution of 2 microseconds for the PULSIN function.· So, to get the value in microseconds from PULSIN we must multiply it by 2.0 - this is represented by $200 when using the */ operator.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • tehmoordartehmoordar Posts: 52
    edited 2005-04-12 22:32
    Hi,

    the point that you made about resolution was the one which was disturbing me

    Thanks
  • tehmoordartehmoordar Posts: 52
    edited 2005-04-21 17:34
    Hi,
    I have got this new parallax ping range finder(#28015).
    It is working fine with BS2. If looking at the code where we give pulsein comand
    we get rawdist and then we use */ operator to multiply with basically 2 microsec(2*10^-6). which is the resolution of the BS2.
    so we did rawdist*/$200 this will give us time. Am I right.

    Now I intgrated my sensor with Oscope aswel to see the waves. Intrestingly once the object is closer to sensor where the time should be less that is the width of the pulse should be less it is showing me more pulse width as compared to when the object is farther. See the attachment for wave pattern
    Once I bring the object close the pulse width is msec but once object is away pulse width is microsec.
    So I read the pulse width from Oscope divided by 2 then multiply by 1130*12*2.54 to get my answer in cms.
    My answer is correct like what BS2 is showing me once object is closer but as soon I move like 12 inches from sensor the pulse width time goes to #*10^-6 and my answer shown is wrong in terms of number of decimal places. like if it is suppose to be 160cms it is giving me 0.000160 cms.

    Do I need to cater for 2microsec resolution in my Oscope calculation aswell like do I need to multiply pulse width time with 0.000002 sec if I do that answers are absolutely wrong.

    What Do you suggest and forsee what and where I am doing wrong.
    tHANKYOU
  • Doug PientakDoug Pientak Posts: 16
    edited 2005-04-21 21:09
    Have you tried the code in the documentation?· Here a link:
    http://www.parallax.com/dl/docs/prod/acc/PingDocs.pdf
    This should help you make sure your math is correct.·
    In reference to your scope picture, something is wrong.· Take a look at the picture I attached.· You should see a small trigger pulse and a longer pulse that is proportional to the distance of the target.· I am not sure what you are looking at with your Oscope, but you should see something very similar to the picture I have attached.·
    Doug Pientak
    827 x 639 - 67K
  • tehmoordartehmoordar Posts: 52
    edited 2005-04-25 23:16
    Hi
    you are right once I captured the signal on Oscope my signal was like this- looking at the graph of Oscope it tells first peak is the signal from basic stamp and then 2nd peak is once echo is back- does longer pulse shows the distance of the object or is it the distance between the rising edge of the first peak and the rising edge of the second pulse.
    Thanks
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-04-26 01:03
    Hello,

    ·· The length of the second pulse, that is, the distance between the second rising and falling edges determines the distance.·· The distance between the sent pulse and return pulse is fixed to provide time for even the BS1 to receive the return pulse.




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com


    Post Edited (Chris Savage (Parallax)) : 4/27/2005 7:37:00 PM GMT
Sign In or Register to comment.