Since a lot of our followers asked for a tutorial to guide them to make a basic robot, we decided to provide this tutorial that describes the step-by-step making of this Line Follower Robot. So you will find all the necessary software and hardware parts to make your own robot following these steps.
Note: In this project the main part which is the PCB design was made using EasyEDA Platform, so refer to the PCB MAKING section to learn more about this step.
A robot is any machine which is completely automatic: it starts on its own, decides its own way of work, and stops on its own. It is a system that contains sensors, control systems, manipulators, power supplies and software all working together to perform a task automatically with speed and precision. There are as many different types of robots as there are tasks for them to perform.
Any robot has these essential characteristics: Sensing, Movement, Energy and Intelligence.
It is named Line Follower Robot simply because it follows the black track that you design for it. So we need two DC motors to make it move and for sure some sensors like the IR transceiver to detect the line and follow it, without forgetting the processing unit which is an Arduino Nano in our project, but you can use other microcontrollers to be able to drive the wheels depending on the sensors.
We need an L293 motor driver which allows us to control the direction and the speed of DC motors. So if you want to make the robot turn left, you should slow down the left motor and speed up the right motor, the opposed case for turning right, and keep both motors running at the same speed for straight movement.
To make the robot follow the line, IR sensors are employed with the fact that a black surface absorbs light and white surface reflects light. The sensors are mounted on left front end and right front end of the robot, keeping the black line in between them until the sensors get the reflected light. The comparator sends logic 1 to the microcontroller and the microcontroller in turn switches ON the motor associated with the sensor. When any of the sensors come up on the black line, the microcontroller stops the motor associated with that sensor and makes the robot turn in the direction of the black line.
When the robot reaches end point and both the sensors are getting the black surface, the robot stops.
A robot should have a structure to hold the electronic parts, so we did some software design for the robot - I mean the robot mechanism. And to do this, I used SolidWorks software to make the upper base and the lower base for the robot. I provided the (.dxf) files if you want to make some CNC laser cutting and produce your own mechanism.
EasyEDA is a free online electronic design automation community that allows the creation, testing and editing of schematics and PCBs.
Find the link to the EasyEDA platform here.
This online program is supported in all platforms even Android. With EasyEDA you can make a schematic capture for your documents, circuit simulation, and online PCB designs with the ability of importing PCB and schematic files. So from this point, we can understand that we can create the PCB in this online designer or just make it with another software and upload a Gerber file to EasyEDA to place an order.
As usual, we need to run the EasyEDA platform from here, then start a new project and import the necessary components like Arduino Nano, L293 motor driver, the header connectors, etc., and connect them together to make the circuit shown in the picture. After that, just click on convert project to PCB, then you will get your PCB design area. I advise you to click directly the following link for the PCB automatically: Direct link for Line follower robot project
You can also check the PCB before ordering it using the PCB viewer, and I provided a picture that shows the PCB that we designed. After finishing the design, go to fabrication output and set some parameters. For me, I prefer the black color for my PCB. Do the payment and wait for the delivery.
Five days later I’ve got my PCBs and it is really awesome with the black color, the circular shape, the name of our robot - PICTO92, and all the tags that I’ve made. Actually, this is not the first time the EasyEDA impressed me; this high quality making was expected.
In order to make this project you will need the following components:
- The Plexiglas mechanism
- The PCB that we ordered from EasyEDA
All what you need to know is how to solder the components to the PCB and complete the circuit as showed in the picture. We provided some labels on the PCB to guide while soldering the components.
After that, use the screws to attach the DC motors, the IR sensors to the Plexiglas structure, and some jumper wires will help you to connect the sensors and motors to your PCB through header connectors.
As shown in the pictures, the blue LED indicates the power supply presence and two red LEDs placed in both sides to indicate motor power supply presence.
After assembling the robot, the last part is the source code to control the robot and make it follow the tracks the you design for it. In order to make your assignment much more easier, we made the code for you. And as you can see in the image, the code is well-commented and full of guidance to allow you to adapt it to suit your needs, so you can modify it depending on your robot structure and technology. You can download the source code from here.
I made a black track to test the robot. As you can see in the pictures, the robot reached the finish line successfully, so we can say that we made it. Our robot showed great behavior while moving and turns in both direction while following the track with no problem.
That is it for this tutorial. Feel free to thumb it and to ask us anything you want to know about this project through a comment.
No preview (download only).