Shop OBEX P1 Docs P2 Docs Learn Events
2sx & Sonic Rangefinding — Parallax Forums

2sx & Sonic Rangefinding

ArchiverArchiver Posts: 46,084
edited 2002-01-17 18:27 in General Discussion
I was curious to know if anyone has tried to use the sonic
rangefinding circuit found in the Basic Stamp I application notes
with the 2SX module. I seem to be having a problem getting any
accurate results. I have adapted the code from the Stamp I syntax
(Sonar.bas) to the 2SX, but my ultrasonic signal travel time
variable has random, bunk values.

I have hooked up my rangefinding circuit up to an o-scope, and the
circuit seems to be working find. The only thing I can think of
causing problems is that the output pin from the tone decoder (567)
fluctuates a little when the pin transistions from high to low when
it has detected an appropriate signal. Could the switching of the
signal from the tone decoder be the problem? Something a debouncing
switch would fix? Also, if the tone decoder oscillation frequency
is not completely in synch with the ultrasonic transmission signal,
would be a explanation for the incorrect values? The values tend to
stay in certain range and never change despite a change in the
distance from an obstable.

I have o-scope images of various stages of the sonic randfinding
circuit.

Thanks,

Warren

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-01-14 18:42
    Uli,

    Thanks for the input. I kind of already had done some of the things
    that you suggested, and I still seem to be having trouble. My power
    source was on a different board to start off with. The problem that
    you have, do you know if that is an issue with the circuit or the
    interface between your circuit and your microcontroller/processor?
    What stamp are you using, by the way?

    This problem has been plaguing me for quite some time now. Any
    input, suggestions, or resources would be greatly appreciated.

    Thanks,

    Warren

    --- In basicstamps@y..., "ulibasic" <ulibasic@r...> wrote:
    > Hi Warren,
    >
    > just a general advice: when working with sonar / ultrasonic stuff
    you
    > sometimes get the impression that your place is haunted because
    that stuff
    > is so deliberately sensitive to any kind of noise and all..
    > Have been working on a similar problem for two days now, strange
    > measurements, random behaviour and the last thing I did was I cut
    the board
    > in two, seperating the power supply from the rest of the circuit.
    Now if I
    > put it some 5 inch away from each other it works perfect!!! Donot
    really
    > know why but you never do with sonar stuff...
    >
    > Good luck, Uli
    >
    >
    >
    >
    Urspr
  • ArchiverArchiver Posts: 46,084
    edited 2002-01-14 18:42
    Uli,

    Thanks for the input. I kind of already had done some of the things
    that you suggested, and I still seem to be having trouble. My power
    source was on a different board to start off with. The problem that
    you have, do you know if that is an issue with the circuit or the
    interface between your circuit and your microcontroller/processor?
    What stamp are you using, by the way?

    This problem has been plaguing me for quite some time now. Any
    input, suggestions, or resources would be greatly appreciated.

    Thanks,

    Warren

    --- In basicstamps@y..., "ulibasic" <ulibasic@r...> wrote:
    > Hi Warren,
    >
    > just a general advice: when working with sonar / ultrasonic stuff
    you
    > sometimes get the impression that your place is haunted because
    that stuff
    > is so deliberately sensitive to any kind of noise and all..
    > Have been working on a similar problem for two days now, strange
    > measurements, random behaviour and the last thing I did was I cut
    the board
    > in two, seperating the power supply from the rest of the circuit.
    Now if I
    > put it some 5 inch away from each other it works perfect!!! Donot
    really
    > know why but you never do with sonar stuff...
    >
    > Good luck, Uli
    >
    >
    >
    >
    Urspr
  • ArchiverArchiver Posts: 46,084
    edited 2002-01-14 23:54
    Hi Warren,

    Are you *sure* you have got your timing right? I seem to recall a mention in
    the app note about making sure that there is a reasonable timing gap between
    the TX phase and the RX phase otherwise you get all sorts of spurious noise.

    Also, check your power supply - is it man enough for the project?

    Lastly look at your +vdd rail decoupling - it will do no harm to sprinkle a
    few 10nf caramics across any and all rail eletrolytics - on both the TX and
    RX side. Also think about putting a 10nf cap at the point where the PSU
    wires connects to your project box or breadboard.

    Regards,

    Tony Wells

    Original Message
    From: "mauritian37" <mauritian37@h...>
    To: <basicstamps@yahoogroups.com>
    Sent: Monday, January 14, 2002 6:42 PM
    Subject: [noparse][[/noparse]basicstamps] Re: 2sx & Sonic Rangefinding


    Uli,

    Thanks for the input. I kind of already had done some of the things
    that you suggested, and I still seem to be having trouble. My power
    source was on a different board to start off with. The problem that
    you have, do you know if that is an issue with the circuit or the
    interface between your circuit and your microcontroller/processor?
    What stamp are you using, by the way?

    This problem has been plaguing me for quite some time now. Any
    input, suggestions, or resources would be greatly appreciated.

    Thanks,

    Warren

    --- In basicstamps@y..., "ulibasic" <ulibasic@r...> wrote:
    > Hi Warren,
    >
    > just a general advice: when working with sonar / ultrasonic stuff
    you
    > sometimes get the impression that your place is haunted because
    that stuff
    > is so deliberately sensitive to any kind of noise and all..
    > Have been working on a similar problem for two days now, strange
    > measurements, random behaviour and the last thing I did was I cut
    the board
    > in two, seperating the power supply from the rest of the circuit.
    Now if I
    > put it some 5 inch away from each other it works perfect!!! Donot
    really
    > know why but you never do with sonar stuff...
    >
    > Good luck, Uli
    >
    >
    >
    >
    Urspr
  • ArchiverArchiver Posts: 46,084
    edited 2002-01-15 10:41
    Hi Uli,

    Most electrolytics don't have any effect as ripple reducers and transient
    smoothers at frequencies above 40Khz upwards. So an electrolytic across a
    supply rail on something running at 40Khz or above is probably about as much
    use as a cholocate teapot. They still work fine for low-frequency ripples,
    but not the higher frequency smoothing.

    The favorite trick for radio requency designers who see this problem all the
    time, is to use low-value non-electrolytic capacitors across eletrolytics in
    important places. You tend to use a capacitance to suit the frequency
    involved. Memory of similar 40Khz circuits tells me that 10nF worked quite
    well for me. At 40Khz it doesn't matter what the type is, I suppose, just
    use whatever is in your junk box.

    Regards,

    Tony

    Original Message
    From: "ulibasic" <ulibasic@r...>
    To: <basicstamps@yahoogroups.com>
    Sent: Tuesday, January 15, 2002 7:33 AM
    Subject: AW: [noparse][[/noparse]basicstamps] Re: 2sx & Sonic Rangefinding


    Hey Tony,

    good idea to check the power supply for sufficient ampere, sorry Warren I
    forgot this important point.
    Tony, could you describe that part about the decoupling and the caps a
    little more? seems there is something to learn for me there...


    Thanks, Uli



    Urspr
  • ArchiverArchiver Posts: 46,084
    edited 2002-01-15 10:41
    Hi Uli,

    Most electrolytics don't have any effect as ripple reducers and transient
    smoothers at frequencies above 40Khz upwards. So an electrolytic across a
    supply rail on something running at 40Khz or above is probably about as much
    use as a cholocate teapot. They still work fine for low-frequency ripples,
    but not the higher frequency smoothing.

    The favorite trick for radio requency designers who see this problem all the
    time, is to use low-value non-electrolytic capacitors across eletrolytics in
    important places. You tend to use a capacitance to suit the frequency
    involved. Memory of similar 40Khz circuits tells me that 10nF worked quite
    well for me. At 40Khz it doesn't matter what the type is, I suppose, just
    use whatever is in your junk box.

    Regards,

    Tony

    Original Message
    From: "ulibasic" <ulibasic@r...>
    To: <basicstamps@yahoogroups.com>
    Sent: Tuesday, January 15, 2002 7:33 AM
    Subject: AW: [noparse][[/noparse]basicstamps] Re: 2sx & Sonic Rangefinding


    Hey Tony,

    good idea to check the power supply for sufficient ampere, sorry Warren I
    forgot this important point.
    Tony, could you describe that part about the decoupling and the caps a
    little more? seems there is something to learn for me there...


    Thanks, Uli



    Urspr
  • ArchiverArchiver Posts: 46,084
    edited 2002-01-16 14:10
    You might want to go to a nearby thrift store and pick up an old Polaroid
    camera, the kind with ultrasonic autofocus.

    Look for the ones with the 1-1 1/2" dia. circle on the front with the metal
    grid over it--that's the ultrasonic autofocus thingy. They work extremely
    well--fast & accurate, and disassembling one might provide some clues as to
    how Polaroid got it all to work so perfectly. I've thought about just
    taking the asembly from one & integrating it into one of my projects, but
    haven't got around to it yet...

    Good luck.
  • ArchiverArchiver Posts: 46,084
    edited 2002-01-16 14:41
    I got one off ebay for about 10 dollars. It came with the sonar and 2 motors
    lots of wires a nice mirror and some lenses
    Original Message
    From: "Ted Fines" <fines@m...>
    To: <basicstamps@yahoogroups.com>
    Sent: Wednesday, January 16, 2002 9:10 AM
    Subject: [noparse][[/noparse]basicstamps] Re: 2sx & Sonic Rangefinding


    > You might want to go to a nearby thrift store and pick up an old Polaroid
    > camera, the kind with ultrasonic autofocus.
    >
    > Look for the ones with the 1-1 1/2" dia. circle on the front with the
    metal
    > grid over it--that's the ultrasonic autofocus thingy. They work extremely
    > well--fast & accurate, and disassembling one might provide some clues as
    to
    > how Polaroid got it all to work so perfectly. I've thought about just
    > taking the asembly from one & integrating it into one of my projects, but
    > haven't got around to it yet...
    >
    > Good luck.
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
  • ArchiverArchiver Posts: 46,084
    edited 2002-01-17 18:27
    Appreciate the input on this stuff. Currently, I am using a
    3000mAh, 7.2V RC car battery. I figured this should be enough for
    my ultrasonics at least. In the future, I will be running other
    components off the same battery (motors, circuitry), but for now,
    all I am trying to do is power the microcontroller and the
    ultrasonic circuit.

    As far as the timing is concerned, I am following the code provided
    in the application notes. The program calls for a 0.5 ms pulse from
    the stamp to ensure that the decoder picks up the signal. What I am
    thinking now is that there might be "chatter" from my tone decoder,
    because maybe my receiver is not damping fast enough. I'm not sure
    though. I have taken the steps to wrap a rubber band around the
    receiver to account for this, but I don't know the damping
    characteristics of my receiver to know for sure. Any suggestions?

    I have some images from an o-scope that people can look at if they
    are interested. What makes me concerned from the images that I have
    is that there seems to be this "chatter" that I spoke of earlier. I
    am not sure whether this is due to the receiver speaker, or possibly
    an issue with +vdd rail decoupling. Tony, my experience with
    electronics is somewhat limited. If you could go into more detail
    on what you suggested, that would be great.

    Thanks,

    Warren


    --- In basicstamps@y..., "ulibasic" <ulibasic@r...> wrote:
    > Hey Tony,
    >
    > good idea to check the power supply for sufficient ampere, sorry
    Warren I
    > forgot this important point.
    > Tony, could you describe that part about the decoupling and the
    caps a
    > little more? seems there is something to learn for me there...
    >
    >
    > Thanks, Uli
    >
    >
    >
    >
    Urspr
Sign In or Register to comment.