Shop OBEX P1 Docs P2 Docs Learn Events
Help Needed about Ping Ultrasonic — Parallax Forums

Help Needed about Ping Ultrasonic

LionRobotLionRobot Posts: 1
edited 2009-05-15 15:56 in Accessories
Hello everyone,

I have already search thie forum and google it but I do not find the answer.

I am using Ping Ultrasonic sensor(three Pins)

I try to use 7 ultrasonics at the same time. Is it possible?

I am using PIC 16F877 microcontroller and 2840 development board from Basic Micro.

I can use one Ping Ultrasonic. It is work perfectly but how to use 7 Pings at the same time or one by one?

I mean that I use timer1 to count the time (how long the echo come back)and to caculate the distance by echo.

Since same pin is used to transmit and recieve a signal, I need to keep firing and receiving.

There are 7 Ping Ultrasonics but I do not have 7 timers so how should I do ?

Or, how can I change a pin one by one?



Your help will be appreciated.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-05-08 18:28
    1) Unless the 7 Pings are in completely different spaces (rooms, boxes, etc.), you should not use them at the same time. The sound pulses from one will be received by the others and will confuse them. You can use them one at a time allowing the sound echos to die out before going on to the next one.

    2) Each Ping is attached to a different I/O pin. You will need a subroutine for each one that sets the I/O pin to output, generates the trigger pulse, sets the I/O pin to input, initializes the timer to count down (or up), waits for the leading edge of the pulse from the Ping, starts the timer, waits for the trailing edge of the pulse, reads the timer value, and disables the timer.

    This is not a PIC support forum, so you are unlikely to get much help in specifically writing the PIC code, but the same general principles apply whether you use a PIC or a Propeller or an SX to control a bunch of Pings.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-05-08 18:56
    Your duplicate post in the Robotics Forum was removed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-05-15 14:12
    Mike Green said...
    1) Unless the 7 Pings are in completely different spaces (rooms, boxes, etc.), you should not use them at the same time. The sound pulses from one will be received by the others and will confuse them. You can use them one at a time allowing the sound echos to die out before going on to the next one.

    I had honestly considered using multiple PING units for a musical
    instrument before reading this. I've noticed in my travels to Parallax
    they have a robot which is using three pings. (granted pointed
    about 20-30 degrees in different directions)

    The signal that comes from the PING is audio/ultrasonic?
    Is there another way to use multiple PINGS next to each other or
    should I be looking into another sensor.

    I was originally envisioning PING sensors about 3 inches apart,
    each facing upward. Sounds like this won't work.

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-05-15 15:14
    Sound travels at about 1/3m in 1ms. At the maximum range of the PING, that's 9ms one way or 18ms round trip. If you allow for 2 or 3 round trip times for echos to die down, that's 50-60ms. You could easily cycle through 3 PINGs 3 times a second. You could probably cycle through 7 PINGs twice a second.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-05-15 15:56
    Ah, That's more than fast enough for my PING air-piano project!

    You've put that project back on the immediate list! Thank you!

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
Sign In or Register to comment.