View Single Post
  #11   Spotlight this post!  
Unread 12-07-2005, 16:56
billbo911's Avatar
billbo911 billbo911 is online now
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,353
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Measuring a Pulse Width

Quote:
Originally Posted by MikeDubreuil
I'm almost 99% sure that the signal runs from 0Vdc to 5Vdc. Tomorrow morning, when I am back in my school's lab, I will verify that this is completely true.

For some background, I am attempting to write software for the Parallax Inc. PING))) sonar sensor. The pulse width of it's response corresponds to the distance between itself and an object.

Currently, I am using bench top equipment to operate the PING))). A function generator triggers the PING))) to measure and an oscilliscope measures the returning pulse width. The sensor is accurate wthin an inch. At only $25, this sensor looks very exciting for FIRST applications.

The difficulty in this project is the mini-RC signal pin will be both an output and input. I have been able to trigger the sensor from the RC. Unfortunately, the mini-rc hasn't been capable of reading the response.

By simulating a response from the sonar sensor using the function generator I am hoping to isolate the problem in my code.
Mike,
Wow, that is a cool little sensor, and low cost as well. I like the simplicity of it's design and operation. I can see your difficulty with using the mini-rc I/O as both an I and an O. This is what I might try: Use a second I/O as and output to trigger the PING))). Tie it to the same input pin as the input you are using, then write your code to ignore the triggering 2 to 5 micro second pulse. Only allow it to sample a pulse longer than 100 micro seconds. (It looks as though the minimum pulse width from the PING))) is 115 micro seconds.) Now, if you can figure out how to switch the I/O from out to in and back, then your job gets easier. Let us know how your testing goes and how the project as a whole turns out.