Arduino Line Follower
Arduino Line Follower
Table of Contents
Step 2: Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Step 6: Chasis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Step 7: Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
http://www.instructables.com/id/Arduino-Line-Follower/
Intro: Arduino line follower with PID and 90 degree turns
This is my line follower with PID and arduino.
Have fun!
http://www.instructables.com/id/Arduino-Line-Follower/
Step 2: Materials
1. 2 Pololu Micro Metal Gearmotor HP 6v
2. 2 Pololu Micro Metal Gearmotor Bracket Pair - Black
3. 2 Pololu Wheel 32×7mm Pair - White
4. 1 SparkFun Motor Driver - Dual TB6612FNG (with Headers)
5. 1 QTR-8RC Reflectance Sensor Array
6. 1 Arduino Nano
7. 2 cells 7.4V 1000Ah Li-Po Battery
8. 1 Of this
9. Acrylic
10. Screws
11. Nuts
12. Foamy
http://www.instructables.com/id/Arduino-Line-Follower/
http://www.instructables.com/id/Arduino-Line-Follower/
Step 3: Connections between arduino nano and line sensor
Between Arduino nano and line sensors (Pololu QRT8-RC)
Now,
Arduino---|---Sensor
D2----------|--------8
D3----------|--------7
D4----------|--------6
D5----------|--------5
D6----------|--------4
D7----------|--------3
D8----------|--------2
D9----------|--------1
5V----------|-------Vcc(+)
Gnd(-) ----|-------Gnd(-)
http://www.instructables.com/id/Arduino-Line-Follower/
Step 4: Connections between arduino nano and motor diver
The conection its similar like its shown in the image.
I varie the original circuit to fit with the arduino nano, so i use ports A's not D's.
Arduino------|-----Motor diver
D10 ----------|-----PWM A
A5------------|------IN2 A
A4 -----------|------IN1 A
A3------------|------STANDBY
A2------------|------IN1 B
A1------------|------IN2 B
D11-----------|-----PWM B
5V------------|------Vcc(+)
Gnd(-)-------|------Gnd(-)
VM its a special case, beacuse it goes to the positive (+) of the battery, like in the first image.
http://www.instructables.com/id/Arduino-Line-Follower/
Step 5: Connections between Motor diver and motors
Its very simple,
http://www.instructables.com/id/Arduino-Line-Follower/
Step 6: Chasis
I made it from a square of acrylic with a motor tool, you may use CNC or other techniques.
The bot have foamy to protect the sensors from the external light.
http://www.instructables.com/id/Arduino-Line-Follower/
Step 7: Code
Here you can download the complete code.
You may ajust the values of Kd, Kp, and maybe the base motor speed.
Those values were found experimentally, so you may try diferent values.
File Downloads
PIDmejor3.ino (3 KB)
[NOTE: When saving, if you see .tmp as the file ext, rename it to 'PIDmejor3.ino']
http://www.instructables.com/id/Arduino-Line-Follower/
Related Instructables
Autonomous
2pi Line High Line Following DIY Sumo Combat Arduino based
Follower by performance Arduino Robot Multipurpose Robot with Desktop Line
markmoran Line follower by boyles35 Robot Follower -
Pneumatic
Robot by (Sumobot, Flipper - How to jolliBot by
newtonis Spybot, jollifactory
Mazebot, by kmmarlow
Bluetooth...) by
treyes4
Advertisements
Comments
http://www.instructables.com/id/Arduino-Line-Follower/