Introduction: Line Follower Robot
Step 1: First Step
Step 2: Things You Need
- Some copper board
- Printed circuits
- Circuit board acid
- 1mm drill
- Soldering oil
- Soldering wire
- Soldering iron
- Wire cutter
- Some wire
- 2x Plastic wheels
- 1x Spherical front wheel
- A 4 AA battery holder
- U1 = PIC16F84A Microcontroller + Socket
- U2 = 7805 = 5V Voltage Regulator
- U3 = LM324 Comparator
- U4 = L298 Motor Driver + Aluminum Radiator
- XT = 4MHz Crystal
- C1 = C2 = 22pF Ceramic Capacitors
- C3 = 100uF Electrolyte Capacitor
- C4 = C5 = 100nF Ceramic Capacitors (104)
- D = 8 x 1N4148 Diodes
- R1 = 4.7K Resistor
- R2 = R3 = 10K Resistors
- R4 = R5 = R6 = R7 = 1K Resistors
- R8 = 10K Resistor
- R9 = 1K Resistor
- R10 = R11 = 47K Resistors
- R12 = R13 = R14 = R15 = 100ohm Resistors
- R16 = R17 = R18 = R19 = 10K Resistors
- RP = LP = MP = FP = 10K Potentiometers
- L Motor = R Motor = 60rpm MiniMotors with Gearbox (6V)
- R Sensor = L Sensor = M Sensor = F Sensor = TCRT5000 Infrared Sensors
- ModeLED = LBLED = RBLED = Small Red LEDs
- LFLED = RFLED = Small Green LEDs
- Mode = Left = Right = Small Buttons
- SW = Toggle Switch = On/Off Switch
- J = Jumper = A piece of wire
Step 3: Making the Circuit Boards
Print the circuits on a glossy paper with a laser printer. Cut copper boards, clear them with sandpaper and put the printed circuits on them. After pressing the hot iron on the boards remove the papers and soak boards in acid, wait till visible copper disappears. Wash the boards, drill the holes and clear them with sandpaper.
* I have only a symbolic diagram of the robot that you can see here.
Step 4: Soldering Components
Solder all parts on the boards.
Be careful of the correct direction of components.
Use a socket for PIC16F84A IC.
Solder motors and battery holder on the back side of the Bottom board and put some pieces of paper around motors to avoid unexpected contacts in the circuit.
Solder C4 and C5 right on the motors.
Put a piece of paper among potentiometers legs to avoid contacts.
Step 5: Soldering All Together
Connect terminals with same name on the boards together by some piece of wires (You can use the extra legs of the other components).
Solder the Back board to the Top board.
Solder the Front board to the Top board.
Bend the wires and put three boards on the battery holder and solder Front board and Back board to the Bottom board (Use some long flexible wires to contact terminals of the Back and Bottom boards).
Connect + terminal on the Top board to the battery holders + pole.
Step 6: Wheels
Connect 2 plastic wheels to the motors and cover them with a rubber band.
Attach a wheel to the Back board in front of the robot with some glue, I used a dead LED as front wheel but it makes the robot move slow and I recommend to use a spherical wheel.
Cover the gearboxes with sheets of thin plastic.
Step 7: Programming the Robot
Download the robot program (Code.hex) and program the PIC16F84A IC. Set the configuration word to 0x3FF2.
Step 8: RUN
Put 4 AA batteries into the battery holder, make a path, and turn on the robot.
If the robot does not work check soldering carefully.
Now you must adjust potentiometers to robot be able to detect black and white areas. Turn all potentiometers to leftmost position then turn back about 90 degrees to the right. Hold the robot on the line, move it over a turning if the motors state does not changed change the potentiometers value.
Now put the robot on the path to follow it.
Step 9: Custom Movement
When the Mode LED is off the robot is on its default state.
After pressing the Mode button the Mode LED turns on, now you can hold the robot in different states and change the state of the motors depend on their default state by Left and Right buttons.
After pressing the Mode button again the Mode LED starts blinking, now you can hold the robot in different states and change the state of the motors depend on values of the sensors by the Left and Right buttons.
To switch to default state, press Mode button again.
There are four states for the motors:
- Default state
- Forward (Green LED is on)
- Backward (Red LED is on)
- Stop (Both Green and Red LEDs are on)
Step 10: How It Works?
This robot has 4 IR sensors that scan the path.
If the Right and Left sensors has same values and the values of them are different from the Middle or Front sensors the robot is on the line and motors running forward. Else the robot is out of line so the robot keeps moving till one of the side sensors value changes then it turns to the direction that its sensor value changed.
You can read the program source code (Code.bas) to understand it better.