Contact:
B. Dean Pershall
(505) 346-7737
ST247



ATE Home | Engineering Program | Electronics Technology | Natural Resources | Geospatial Information Technologies


Lesson 1.2: Getting Started

Testing sensors and analog ports

The RoadRunner comes equipped with 3 analog infrared ranging sensors. These sensors plug into three of the Robot 16 analog input ports. How the sensors, and the analog ports work is described in detail in later lessons. For now we will just test to see if they work.

1. Turn OFF the RoadRunner, and remove power.

2. Identify the VSS (ground) sockets. The VSS sockets are where the black wires on the sensors will go. VSS is the ground for the robot. It has a zero voltage. The VSS sockets are on the upper edge of the board.

3. Identify the VDD (positive) sockets. The VDD sockets are where the red sensor wires will go. VDD is a +5 volt terminal on the robot. The VDD sockets are just below the VSS sockets.

BE SURE NOT TO CONFUSE VSS WITH VDD!!!

4. Identify the Analog sensor inputs. These are below the VDD sockets. There are 16 analog sockets. In the tradition of computer programming they are labeled from 0 to 15, from left to right.

5. Identify the Front, Right, and Left analog sensors. In order to attach these IR sensors to the base of the RoadRunner, you will need twelve ¼” screws. Furthermore, six plastic mounts will be needed; one on each side of each sensor. Six of the screws will attach the sensors, connecting them to the plastic mounts. The other six will be used for attaching the mounts onto the base of the RoadRunner.

6. Now it is time to begin plugging in the sensors. Start with the right sensor. Take the yellow wire on the right sensor and place it into analog sensor port zero. This is the leftmost analog sensor port. Then take the red wire and plug it into the VDD socket just above analog port zero. Also, plug the black wire into the corresponding VSS socket. The black wire should be on the upper edge of the board, the red wire should be between the black and yellow wires, and the yellow wire should be closest to the board. Take care not to get VDD and VSS confused as this may harm the robot, and the sensor. See the picture below.

7. Repeat step 6 but this time connect the front sensor to Analog port 1, just to the right of where you plugged in the right analog sensor.

8. Finally, plug in the left analog sensor into analog port 2 and the corresponding VSS and VDD sockets.

9. Double-check your wiring to ensure that it is correct.

10. Now it is time to test the analog sensors. Open the Javelin Stamp IDE program.

11.Now open up the analog sensor test program. To do so, select file and then open. Then go to the folder C:\Program Files\Parallax Inc\Javelin Stamp IDE\Projects\ (NOTE: THIS SHOULD BE THE DEFAULT FOLDER). Now open up the program AnalogInTest.java

12. Turn on the RoadRunner To do so, place the switch into the NC position, after applying power to the robot. The light should go on. (UNPLUG THE MOTORS FROM THE MOTOR OUTPUTS. REMEMBER THAT SOMEBODY MAY HAVE PROGRAMMED THE ROADRUNNER BEFORE YOU AND THAT THE PROGRAM MIGHT TELL THE ROADRUNNER TO MOVE. THEREFORE, BE READY TO STOP THE ROADRUNNER IF IT STARTS TO MOVE. THE SAFEST THING TO DO IS TO SIMPLY UNPLUG THE MOTORS FROM THE MOTOR OUTPUTS)

13. Now run the program. To do so, select project and then program on the task bar.

14. After the program loads you should see a screen similar to the one below.

This program will display the sensor readings on each of the 16 analog ports. Since by default the RoadRunner only has 3 sensors, only Port 0, Port 1, and Port 2 will give accurate readings. For each sensor the program will display a number between 0 and 255 representing how close an object is to that sensor. If an object is really close to the bumper of the robot, and is in front of the sensor being used the program the number will be really high, around 255. If there is nothing in front of the sensor then the reading will be low. If you place an object near the sensor, and that is closer to the sensor than the bumper is, then you will not get accurate readings. This is explained in detail in other lessons, but in short the sensors cannot see very well for the first three inches in front of them. This is why the sensors are near the center of the robot, and not directly against the bumper. If everything goes well you should be able to move objects closer and farther from sensors 0, 1, and 2, and be able to see the corresponding sensor readings in real time. When you are done testing the sensors, turn off the robot, and move on to the next part of this lesson.

Once you have completed this step, proceed on to the next part of the lesson.