Shop OBEX P1 Docs P2 Docs Learn Events
ping))) output weak — Parallax Forums

ping))) output weak

k_bramk_bram Posts: 4
edited 2007-04-14 15:54 in Robotics
dear Sir,

I experinced that the output of PING))) is too weak
to drive uC port even if there no pull up resistor.
The ping))) can only drive
port P3.6 or/and P3.7 of AT89S51, the output
more severe when more ping))) added.
None port AT89C51 could be drive by ping)))'s output.

When observed with oscilloscope when the sig pin is connected the uC port,
the echo voltage only around 0.9 volts.

Please send me suggestion, or additional
circuit between ping))) and the uC port.

Thank you very much in advance
Kurnia Brahmana
b_unix@yahoo.com.au
·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-12 02:35
    How are you connecting the PING to your microcontroller? Are you operating the PING from a +5V supply? The PING is not designed for multiple PINGs to be connected to the same control line.

    The PING has a shared half-duplex control line using TTL (not CMOS) levels which defines a low as 0-0.8V and a high as 2-5V. You should see a higher voltage for the echo pulse. There must be something about how the PING is connected to your microcontroller. Perhaps you're not switching the port from output to input mode.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-04-12 16:37
    The PING))) Sensor has an inline 500 ohm resistor as well as an internal pull down. You don’t want to use a pull-up on it or you won’t be reading it. And you definitely don’t want to connect more than one to the same I/O pin. The PING))) works on the concept that your I/O pin becomes and output and provides a start pulse and then becomes an input and measures the return pulse. This is not possible in the manner you are connecting it. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • k_bramk_bram Posts: 4
    edited 2007-04-13 06:19
    Dear Sir,

    Thank you for quick response,

    The Ping))) Sig pin is connected directly to the uC port, and only one ping))) sig to one port
    eg. the first ping)))·sig pin is connected to port P3.7, and the second ping))) sig pin to port P6.7 of the at89s51.

    code like:

    sbit signal = P3^6;

    signal=0;
    while(1)
    {
    ···signal=1;
    ·· _nop_();
    ·· _nop_();
    ·· _nop_();
    ·· _nop_();
    ·· signal=0;
    ·· _nop_();
    ·· _nop_();
    ·· _nop_();
    ·· _nop_();
    · while(!signal):··· // waiting for echo
    · TR1=1
    · while(signal);···· // counting the width of echo
    · TR1=0;
    · waitms(100);··· // take a rest
    }

    The int 3 subroutine will count the length of the echo;

    A 100 ohm to 1 Kohm resistor has been inserted between the signal pin and the uC port but
    the result still the same, the echo only could only be read if one ping))) is connected
    either to P3.6 or P3.7. we need to use 8 ping))) to help our robot to know the position.

    Perhaps my code need to be corrected,
    I'm using Keil C51

    thank you in advance

    Kurnia Brahmana
  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-13 14:18
    The problem is not in your code. It is in the connection. You CANNOT have more than one PING connected to the same I/O pin. If you want to use 8 PING devices, you will need some kind of external hardware like an I/O Expander. This could be done with a 1:8 digital multiplexor and a 1:8 open-drain digital demultiplexor or demultiplexor with an open-drain or open-collector switch on each output.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-04-13 14:52
    Your post says you only have one PING))) connected but then you mention 8. So does the single PING))) work? If so you will need 7 additional I/O lines for the remaining PING))) sensors and the same routine to run on them sequentially.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • allanlane5allanlane5 Posts: 3,815
    edited 2007-04-13 19:02
    If you DO attach 8 different 'ping' sensors to 8 different I/O pins, what's so special about those two I/O pins that work, compared to those that don't?

    It almost sounds like you're having a problem powering the 'ping's, like your power supply can power up to 2 pings, but after that you don't have enough current.
  • k_bramk_bram Posts: 4
    edited 2007-04-14 02:32
    Dear Mr. Green,

    The 8 ping))) are connected to 8 diffrent I/O pin, so I don't think that an I/O expander may necessary,


    Dear allanlane5,
    It has been tested with the Lab. Power Supply "LEADER" product, so the current will be sufficient.

    Dear Parallax Tech Support,

    It has been programmed sequentially,
    when the first ping))) connected to P3.7 it works fine,
    then the second ping)) is added to P3.6 still works fine, // sequential programming
    ·········································································· // the second reads after the first is finished
    after the third ping is added to any port, it works fine for about 10 rounds, then hang,
    when obserbed the the problem is one of the port remain high or remain low
    therefore the while(signal); or the while(!signal); could'nt be passed,
    when another ping))) is added to a diffrent I/O pin, it works only at the first ping))) // P3.7

    Someone says the ping)))s will work with AVR uC such as ATMEGA8535L,
    but it will·take quite a lot of time to learn that device, mean while our robot will need to be ready soon.

    But if no other better solution, we will take Mr. Green advice to use I/O expander

    Any way, thank you very much, all comments have been helpfull.

    Kurnia Brahmana

    ·
  • FranklinFranklin Posts: 4,747
    edited 2007-04-14 14:08
    Could you attach a schematic of the microcontroller and associated ping)))s

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • allanlane5allanlane5 Posts: 3,815
    edited 2007-04-14 15:54
    I've used "Leader" products before, they're quite good. Still, it would be helpful to know if you've got current limiting turned on, or anything like that.
Sign In or Register to comment.