

you can hear a buzz or humming sound from the servo.
#Line follower arduino while loop driver
Rotate the potentiometer with a very light hand using a screw driver if : There is a potentiometer at the back of the servo motor. Once you copy the code, upload it to your Arduino board. ServoRight.attach(6) // attach right servo to pin 6 ServoLeft.attach(5) // attach left servo to pin 5 Servo servoLeft, servoRight //declaring the two servos
#Line follower arduino while loop code
Copy the below code into a new sketch on the Arduino IDE. You can use the code below to center the servos. Now the first part is to build the circuit to test out the circuit. That is why it is important to center the servos and set your own parameter to use the servos. Different servos can respond to different ranges between 700 to 2300. However, all the manufacturers do not follow the same standards sometimes. The standard servo parameters are set from 1000 microseconds to 2000 microseconds where 1500 microseconds is the center of the servo and brings it to a stand still. We first make sure that the servos are centered. Now, once all the assembly is completed it is essential to make sure that all the components work perfectly individually.

Once the robot has been assembled, you can attach the Ping Sensor in front of the breadboard. I attach each servo motor as a wheel on either sides, and attach the Arduino board.Īlso I attach the battery pack at the bottom of the Boe Bot and the breadboard on top. Since, I have the Boe-Bot Kit I am just going to be using that for my line follower.įirst this I first assemble my chassis.

Based on that estimation, they give respective signals to the motors to turn left or right so as to maintain a steady center with respect to the line. They estimate whether the line underneath them is shifting toward their left or right as they move over them. These robots have the capability to detect a black or dark line on a lighter surface depending on the contrast.

The workings of a line follower robot are pretty straightforward.
