Shop OBEX P1 Docs P2 Docs Learn Events
PING ))) Sensor TTL Logic? — Parallax Forums

PING ))) Sensor TTL Logic?

underworldmanunderworldman Posts: 22
edited 2010-05-17 17:25 in Accessories
Hello,

I'm using PIC16f84 MCU and the ultrasonic PING ))) sensor from parallax. According to the manual, it produces TTL signal that can be read by any TTL uC. So, the real question is... What is supposed to be the delay between the low-high-low pulse to be output to the sensor, and how long does the sensor take to start up. Because i've noticed that when i power my application, the sensor takes some time before it blinks the activity LED. The other important thing i wanted to know is... when the sensor is active, does the led show status of receiving and sending signals? or does it just signal that the sensor just active?

Thanks in advance.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-05-15 21:59
    Page 3 of the PING))) documentation has a timing diagram that contains the information you want on timing.

    Page 1 describes the activity LED as a burst indicator that comes on when the ultrasonic pulse is transmitted as shown on the timing diagram.
  • underworldmanunderworldman Posts: 22
    edited 2010-05-16 10:44
    Thanks Mike. I'll be very happy when i have it running.
  • underworldmanunderworldman Posts: 22
    edited 2010-05-16 19:00
    I wanted to know if materials such as clothes can absorb the frequency of sound sent by the PING )) sensor. If so, how can it be tested?
  • underworldmanunderworldman Posts: 22
    edited 2010-05-16 19:02
    Another thing i wanted to know was.. If sound can be easily reflected off clothes, then why am i getting a low resolution i.e. only the measurements such as 6 cm, followed by an exact 32 cm, followed by an exact 50 cm, then exactly 100 cm e.t.c. I can't get a reading between these exact values???!?
  • Mike GreenMike Green Posts: 23,101
    edited 2010-05-16 19:20
    It depends on the clothes and the shape of the fabric. Some surfaces reflect sound well. Others do not. If the surface is a narrow cylinder, you may mostly be reflecting the sound elsewhere and detecting those reflections. Start with something simple like a flat surface with a smooth finish. If you're still getting wildly varying values, something else may be wrong.
  • underworldmanunderworldman Posts: 22
    edited 2010-05-16 20:11
    Something else is definitely wrong because i'm getting great gaps between the readings even after using a copper clad for a test. I should be getting 1 cm difference as i move towards the sensor, right?

    I'm using floating point to calculate distance, which is already a precise type in c. I'm running the MCU with the internal 8 MHz clock. Could that be a reason?

    Post Edited (underworldman) : 5/16/2010 8:26:12 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2010-05-16 20:38
    It's impossible to tell what's causing the inaccurate readings without a schematic and a program listing. In addition, these forums can't provide any significant support for non-Parallax microcontrollers. In addition to them being competitors, there are just too many different ones and different support software for each, so you'd at best get very general advice.

    If your values are varying widely, there could be noise on the signal line from the PING. There could be some problem with the process of triggering the PING, then timing the pulse coming back from it. You could have some kind of programming error.
  • underworldmanunderworldman Posts: 22
    edited 2010-05-16 21:01
    I'll look into it. Thanks for your help Mike.
  • underworldmanunderworldman Posts: 22
    edited 2010-05-17 13:50
    I'm getting readings that are exactly multiples of 17. e.g. 17, 34, 68, e.t.c

    Pretty big difference shocked

    Whats the best clock frequencey suitable to run this thing?
  • BeanBean Posts: 8,129
    edited 2010-05-17 13:57
    underworldman,
    If you are using a hardware counter to time the pulse, and your detect loop is 17 cycles that would explain it.
    Other than, that I don't know what would cause that.

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.
    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There are two rules in life:
    · 1) Never divulge all information
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
  • underworldmanunderworldman Posts: 22
    edited 2010-05-17 14:00
    Bean,

    I think you're very right. Because the datasheet of the MCU says that


    "When the internal clock source is selected the
    TMR1H:TMR1L register pair will increment on multiples
    of FOSC as determined by the Timer1 prescaler."

    And the internal clock is 8 MHz. So, probably i'm getting readings as multiples of 8 or close to that. I'm confused a little. I should do a little more reading before i get back to the problem.
  • underworldmanunderworldman Posts: 22
    edited 2010-05-17 17:25
    I successfully run it at 4 MHz with accurate measurements. hop.gif
Sign In or Register to comment.