Today’s example continues to expand on the previous robot examples. In this example we are having the robot follow a black line that is printed onto a white surface. In this example we are using LED photodiodes to sense the line below the robot and then control the motors to keep the robot on track. The following hardware is used in this example:
Forum Post Attachments:
At the bottom of this post we are including the following items:
- Example Project Zip File
- Zip File of Images
- Project Schematic
- Component Configurations
The user can download the example project at the bottom of this post. The project uses the following list of Creator Components:
The components are configured by right clicking on the component in your Top Design schematic view and selecting Configure. Please enable the following selections in the Configuration windows for the listed components above.
The main.c firmware is included in the example project. Please review the commented sections for more details.
In this code example we are expanding on the obstacle avoider and adding two source files to our example. These two files are LineFollower.h/c. These two source files are used to detect the line position and control the motors. The code looks to detect the line using three sensors. The robot uses the sensors in the following configuration (Right, Center, Left). Detection from any of the three sensors will direct the robot in a defined direction or course correction.
Connect your Pioneer kit to the ArduMoto shield. Then connect your motor shield to the photodiode board.
The following hardware components are used: Red LEDs 3no.s, 220Ω resistor 3no.s for LED current limiting. Photodiodes 3no.s, 10kΩ resistors 3no.s for Photodiode biasing,IC LM339 and 10kΩ potentiometer, connectors to take out signals on prototype area of ArduMoto Shield.
Test Your Project:
Place your robot on a printed obstacle course. Start the robot and watch it go around the track.
We put together a couple of videos for an internal contest here at Cypress. The goal was to create a similar robot that raced around a track. Enjoy!
I hope this example can help you in your design.