Introduction: Linefollower With Bluetooth
This instructable was made for a school project.
We had to make a linefollower with a few specifications:
- It had to be cheap with a target price of €50.
- As fast as possible: > 0,5m/s.
- Width of line: 1,5cm / radius of a curve: 10cm / intersections possible (the car has to drive straight).
- The linefollower has to work in normal light conditions (TL-lights, sunlight, camera flash, ...).
- Max. dimensions 12mm x 12mm.
- Simple hardware: 1 power supply, cheap DC-motors, H-bridge, ...
- Light sensors array (min. 6).
- Wireless communication (infrared, Bluetooth, ...).
- 1 start/stop button, linefollower starts with last set values (even when power has been cut off).
- All settings can be changed via a simple to use pc program (Kp, Ki, Kd, debug, max. speed, ...).
- The final product has to be a self made PCB (design).
- Use smd components where necessary.
Let's get started.
Step 1: Concepts and Components
You start this project by making a few choices. These are: controller, communication, H-bridge, power supply, sensors and motors. These choices will depend on each other.
My choices were:
Micro controller: atmega32u4 (arduino leonardo chip) needs 5V
Communication: RN-42 (Bluetooth) needs 3,3V
Power: Lio-ion 18650 2 x 4.2V --> 8,4V
Motors: Polulu 50/1 (testing) and 30/1 (speed)
Sensors: SHARP microelectronics GP2S700HCP
Step 2: Making the Schematic
To make the schematics, look in the datasheets and you'll see how everything needs to be connected.
The schematics can be made in several different programs (DipTrace, Eagle, EasyEDA, ...).
If you want to use mine you can download them here.
Step 3: PCB
When you get your PCB you'll need to solder everything to it. Make sure you don't short circuit the components.
Step 4: Program (arduino)
All the calculations are in the arduino and the values can be changed by a different program (see next step).
You can download the full program.
Step 5: Program (Visual Basic)
I quickly wrote a program in Visual Basic that can write values to the linefollower, there are also some extra features in there.
The program and code is downloadable here.
Step 6: Testing Everything on the PCB
Now you will have to test everything.
If there are no problems you can start tweaking it and make it go faster.
(Else you will have to find what may cause the problem, and then solve it.)
Do this by changing the PID, speed and cycletime.
This will change with every linefollower
For me, the values were (for a speed of 0,858 m/s motors of 30:1):
- Kp: 4,00
If your PID values are to high the linefollower will pick up too much distortion.
Step 7: End Result
In the end we made a linefollower with all the specifications they gave us and reached a speed of 0,858 m/s.
That is the fastest speed ever in this school project.
If you want all the documents that are in this instructable and more, use the link below.
(Some of them are in Dutch)
My blog (also in Dutch).
If you have questions feel free to ask.
Participated in the
Question 4 years ago
The message is send to the aurdino through gsm & i want track the position of message sender and robot will reach at that place of message sender by itself.then how it is possible, If yes then how?
Answer 4 years ago
I'm not sure what you mean. Do you want to let your robot find your phone? Or do you want your robot to go to a specific place on your track? If it's one of these than it could be possible although not with this project and I'm not sure how to do it either. The purpose of this project is for a robot to follow a line that is not programmed in the linefollower so that it does not matter how the track goes.
I hope this helped a little bit and good luck with your project.
4 years ago
Nice intro to robotics projects. You should enter this into one of the contests that are currently running on the site.
Reply 4 years ago
Thank you for the tip. I've looked into it.
4 years ago
That work is awesome .