Shop OBEX P1 Docs P2 Docs Learn Events
DIY Ultrasonic ping possible with SX? — Parallax Forums

DIY Ultrasonic ping possible with SX?

JedJed Posts: 107
edited 2009-01-30 22:03 in General Discussion
If I have 2 ultrasonic sensor/emitters, JUST the little speaker things. Can I create my own ping unit easily? I know it's possible, but not sure how to start going about it. I've used the ping)) unit parallax sells before, but where these are just the sensors, I'm not sure exactly how to use them. Can anyone give me some pointers? I've attached an image of the sensors. If I can get away with it, I'd rather spend $3 on a pair of these and program an sx to control them rather than $30 on a ping)) module.

Post Edited (Jed) : 1/29/2009 5:42:24 PM GMT
250 x 170 - 33K

Comments

  • JedJed Posts: 107
    edited 2009-01-29 17:40
    No takers? [noparse]:)[/noparse]
  • JonnyMacJonnyMac Posts: 9,214
    edited 2009-01-29 17:54
    Patience isn't your long suit, is it? (not mine either, truth be told)

    The obvious answer is that it CAN be done, Parallax uses an SX in their Ping))) sensor. As I recall that took the engineer a month or two of serious work; you're probably not going to get a ready-made answer by making a post here. Google is your friend; perhaps a search will turn up circuit using another micro that you can adapt (I do this all the time).

    I believe there is an old BS1 app note that shows how to build a such a device, but it uses a 555 to modulate the sensor and a 567 to do the demodulation.
  • ZootZoot Posts: 2,227
    edited 2009-01-29 17:55
    Certainly you can; an SX is on-board the Ping))) but the firmware is not public to my knowledge.

    Most ultrasonic modules have the micro generate the appropriate frequency for the tx transducer, but sending out pulses. Then the micro "counts" how many echos it gets back and converts the time for the echos to be received into either a pulsout to the host (like the Ping))) which holds it's signal line high to represent time for the echo) or converts to actual binary data and sends via serial or I2C tx.

    You might want to do a search on the web for folks who may have posted their own firmware for this sort of application (even if the firmware is for a micro you don't use); that might cut down a lot of homework and trial-and-error to get an idea of timing, pulse counts, etc.

    [noparse][[/noparse]edit p.s.] -- heh, JonnyMac musta hit submit moments before I did.... smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • T'SaavikT'Saavik Posts: 60
    edited 2009-01-29 19:02
    I made small attempt at doing this. I don't seem to have a copy of the code anymore [noparse]:([/noparse]

    The first problem i ran into was that after transmitting i needed to pause a significant amount of time (well, in microprocessor world) before attempting to receive, or else I'd see the "ringing" (or whatever you want to call it) from the transmission.

    I was trying to make it work with only 1 transceiver, so you might avoid this issue using 2. One for send and one for receive. This may be the reason the ping has 2?

    If i recall i "sort" of had it working, but i was getting random values from time to time as well.
  • DosManDanDosManDan Posts: 179
    edited 2009-01-30 18:30
    I ran across this article a few years back and it has all of the information you need to design one yourself. Just don't expect it to be easy....

    Dan
  • Mark HubersMark Hubers Posts: 19
    edited 2009-01-30 18:55
    I was going to say... 30 Bucks is very cheap for the many hours you can end up putting into coding it and working out all the bugs. Only reason I would end up doing it if you need a custom sensor which is a rear thing in my book. I going for the 30 bucks route and keeping someone in biz.

    Mark
  • JonathanJonathan Posts: 1,023
    edited 2009-01-30 22:03
    I did this with a PIC a few years ago. It's not all that hard, but you need a 'scope for sure. I used 4049's to driver the transducer, sending 10 cycles at 40kHz. I actually got mine to work a little better than the Ping module, but at four times the size and twice the price. :-0 It was really fun though, I learned a lot. If you would like more details, send me an email and I'll dig up my old PIC code and schemtic if I still have it.

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
Sign In or Register to comment.