Well, if you are a beginner, here you will find the easiest way to build your own black line following robot!We will use a mini rover robot chassis with four small dc motors to build it easier.
For one more time we choose to use the famous Arduino UNO board.
Our small robot will start to follow the black line when we press ones the button in front of it. If we press it again it will stop. The sensor board that we are using has 5 ir sensors. We will use only 3 of them, the center one for tracking the black line and the left/right of it to make the corrections to the robot's route. Our robot will stop when all sensors detect a black line. Watch the "Robot in Action" video below..
Are you ready? Let's get started!
Step 1: What You Will Need - Hardware
Step 2: Assembly the Mini Round Robot Chassis Kit
Follow the images below !
A picture is worth a thousand words!
Step 3: The Circuit
The connections are pretty easy, take your time and follow the "colors".
About "Line Follower Detector 5-Channels" pcb
- Connect the 5V pin to Arduino 5V pin, GND to Arduino GND
- Sensor "2" to Arduino A1 pin
- Sensor "3" to Arduino A2 pin
- Sensor "4" to Arduino A3 pin
- Button SW to Arduino A5 pin
Power - Battery holder
Connect the battery holder cables with a dc jack to the Arduino uno (or to Vin and gnd pin). If you want you can add an ON/OFF SW on the red cable of your battery holder pack.
Step 4: The Code
Make it alive by program it with the following code!We will use the front button to start our program (or to stop it if you press it twice) If your robot doesn't move forward, go to lines 26 and 27 and change the PWM values until your robot moves straight.
Download the code from here and open it with Arduino IDE.
Step 5: Well Done!
Make a black line track and test your new robot! The black line must have width: 30mm.
Or you can download and print our sketch (open it with Corel Draw)
I hope you liked this, let me know in the comments!
Post me some photos of your Arduino robot!