|
Re: How to connect Parallax Ping))) sensor
Your problem may also relate to the way the digital sidecar is hooked up internally. My team's read of the Ultrasound class/VI in WPILib indicates it is written for a "raw" ultrasound sensor, where you send a sound pulse, then count for the echo time. The Ping))) sensor, however, operates on a single line. You send a trigger or "ask" pulse, then wait for a return pulse, and count the duration of the return pulse to get a distance measurement. These are different algorithms.
Electrically, even if you make the Y cable, there are still pull up resistors on the DSC, which you can't change. In order to make a Ping))) work, we've found you need to build some extra buffer circuitry, consisting primarily of a PNP transistor and a NOT gate. That will allow the line to the Ping))) to float instead of being pulled up to 5V by the DSC's internal resistors.
Basically, you use the PNP transistor to pull the line up for the "ask" pulse, then use a NOT gate to detect the return pulse, and time its duration using your code. Not all that simple to do.
If you would consider an alternative, Maxbotix makes an analog ultrasound sensor that is a bit easier to use with FRC hardware.
__________________
2013 Alamo Regional Woodie Flowers Finalist Award Winner
2012 Texas Robot Roundup Volunteer of the Year
Texas Robot Roundup Planning Committee, 2012-present
FRC 6357 Mentor, 2016-
FRC 2789 Mentor, 2009-2016 -- 2 Golds, 2 Silvers, 8 Regional Elimination Appearances
FRC 41 Mentor 2007-2009
FLL Mentor 2006
FRC 619 Mentor 2002
FRC 41 Student 1998-2000
Last edited by jee7s : 12-02-2011 at 00:04.
Reason: Clarification
|