The purpose of the SparkFun RedBot is to follow any path by using 3 IR sensors placed at the front of the robot. It traverses the course with 2 individual motor-driven wheels connected to a SparkFun board. Additionally, two bumper sensors indicate when there are obstacles in the robot's way. Using C++ in ArduinoIDE, the robot was programmed to follow a path and detect obstacles. The left, right, and center sensors scan the ground as the robot moves and send a signal that determines the right way to move, in this case, whenever there is a black line. The bumper sensors are coded to sense if obstacles are on the left or right side of the robot. If there is an obstacle in the way, the robot will then turn in the opposite direction to move away from the obstacle. Variables were declared for the state of the left, right, and center IR sensor and the left and right bumper that were set equal to the values the scanners were reading. If a bumper signal read low, the bumper was triggered and the robot would turn away from the obstacle. If the IR sensor was greater than the black line integer number of 1000, then the robot would adjust to follow that path and continue scanning the black line. Overall, our group was able to finish coding the commands for the RedBot LineTracker to properly follow ay course with a black line and detect obstacles to move away from.
RedBot LineTracker Code
Top POV of the LineTracker Bot following a course (Iphone battery pack mounted on the top near the front as a weight)
Robot POV as it traverses through the course (IPhone mounted on robot)