Need help setting up my ultrasonic distance sensor


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    Nov 2009
    Location
    London
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Hi,

    Everything works as written ...

    W1 = 500 is a distance of 1 meter ...

    ...

    try 2500 instead ...

    and note no measure will send back ... 5000 Pulsin units ( 50 000 µs )

    Alain
    Hi, it works fine with 2500. Can you please explain how you calculated 2500? Thanks

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    500 multiply by 5 meters...
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Megahertz View Post
    Hi, it works fine with 2500. Can you please explain how you calculated 2500? Thanks
    Being Honest ...

    1) read Datasheet Page 3 ...
    4: PWM - PWM Output 025000USEvery 50US represent 1cm
    2) read PbP Manual page 133 ...

    The resolution of
    PULSIN is dependent upon the oscillator frequency. If
    a 4MHz oscillator is used, the pulse width is returned in 10us increments.

    3) The distance is 5 meters = 500 cm

    from 1) and 3) ...

    4) Pulse will be 500cm * 50µs/cm = 25 000 µs

    from 4) and 2) ...

    @4 Mhz Pulsin will return 25 000 / 10 = 2 500 units

    This is the mathematical explanation of zeu thing

    Alain

    PS@ Dave

    Don't you think I should add " Need Help " in my signature validity conditions ???
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    PS@ Dave

    Don't you think I should add " Need Help " in my signature validity conditions ???
    Yup, need help understanding data sheet.

    I think Megahertz is doing fine, sometimes know where to look is a bit different than knowing what to look for.

    I just spent parts of two days trouble-shooting a machine. Tried this and that, read the manual, tried other stuff, back to the manual.....
    Then the great thought hit me... I wonder if that cable on the floor should be plugged into something
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Yup, need help understanding data sheet.

    I think Megahertz is doing fine, sometimes know where to look is a bit different than knowing what to look for.

    I just spent parts of two days trouble-shooting a machine. Tried this and that, read the manual, tried other stuff, back to the manual.....
    Then the great thought hit me... I wonder if that cable on the floor should be plugged into something
    Hi, Dave

    This episode of our tremendous adventures lits a little light in my head ...

    Would be a nice thing to get the Holy manual opened at the convenient page just clicking for "Help" in our IDEs ... ( say " mouseover " + a keystroke on KB )

    Always useful to have a look to function parameters ...

    Hope IDE Creators read that post ... ( thoughts to my overseas friends ...)

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    At one time Jeremy and I was working on a code editor with some automated fill functions but we did not get very far before other things put it on the back burner. We was using a flavor of Basic.

    Then I sorta started a cross platform editor in Python but the same thing happened, got to busy to work on it.

    Normet has the "fineline" editor he working on.

    I wonder how many around here would be interested in an open source, cross platform, community project?
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    I wonder how many around here would be interested in an open source, cross platform, community project?
    I saw one nice working " IDE " ...

    Called PICabc ... limited to 16F84 and assembler ...

    http://www.abc-micro.co.rs/

    ftp://ftp.chatnfiles.com/Microforum/...ABC/PICABC.EXE ( demo ...)

    but the concept is rather interesting ...

    to be honest, I must say the MiKroElektronika IDE is really handy here ...

    I know one other IDE " on the rail " but was asked not to talk about it ...

    Alain
    Last edited by Acetronics2; - 26th June 2010 at 14:22.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts