Programming instructions
Inventor’s Guide insert
accessories
sensor accessories
ultrasonic sensor kit • 3
ultrasonic sensor kit, continued
1 Technical overview
The steps your robot’s program will have to follow in order to calculate
the distance to an object are:
1. The Vex microcontroller
sends a “start” signal to the
ultrasonic sensor.
2. The ultrasonic sensor
generates a 250 microsecond
ultrasonic pulse.
3. The ultrasonic sensor
sets its output signal to
+5V, thus sending a
“high” signal to the
microcontroller. In digital
terms, this is a “1”.
4. A timing loop on the
microcontroller begins,
counting the seconds. This
will be the “round trip
delay” in the distance
equation.
5. The ultrasonic
sensor picks up the
echo from the 250
microsecond pulse.
6. The ultrasonic sensor
sets its output signal to
0V, thus sending a “low”
signal to the microcon-
troller. In digital terms,
this is a “0”.
7. The Vex microcontroller
exits the timing loop and
uses the round trip delay to
calculate the distance to the
object.
Go to Reference Links