Project Report for Microcontroller 8051: Line Tracking Rebot
UNIVERSITY OF ENGINEERING AND TECHNOLOGY TAXILA, SubCampus Chakwal
Zohaib Jahan
10-ECT-96
facebook.com/zohaibjahan
Project Report for Microcontroller 8051: Line Tracking Rebot
Line
Tracking
Rebot
Zohaib Jahan
10-ECT-96
facebook.com/zohaibjahan
Project Report for Microcontroller 8051: Line Tracking Rebot
Group Members
Zohaib Jahan M. Sarwar Shahzad Hussain
10-ECT-96 10-ECT-93 10-ECT-67
Zohaib Jahan
10-ECT-96
facebook.com/zohaibjahan
Project Report for Microcontroller 8051: Line Tracking Rebot
Components List
8051 , Micro-Controllter Crystal, 11.095 MHz Capacitors, 33pF Variable Resistors, 10k Resistances, 1k, 390 ohms Two DC Motors, 3V Three IR sensors (Receiver+Transmitter) L293D, Motor Driver LM324, Comparator 74LS245, Buffer
Zohaib Jahan
10-ECT-96
facebook.com/zohaibjahan
Project Report for Microcontroller 8051: Line Tracking Rebot
What is A Line Follower???
A line follower is an autonomous bot that can follow a specific colored line painted on a surface of different contrast, such as white on black. To start with first of all I will be discussing a small concept of light. The Light that strikes any platform is reflected. The reflection and absorption coefficient of light depend upon material, color of platform and other factors. In simple words the black surface absorbs the light and the white surface reflects it, this is the basic concept behind making a line follower.
So the line follower has an emitter and a reflector. The reflector receives the light and generates a voltage proportional to the intensity of the light, if this voltage is above a threshold it means SIGNAL=1 (logic one) else SIGNAL= 0 (logic zero).
Zohaib Jahan
10-ECT-96
facebook.com/zohaibjahan
Project Report for Microcontroller 8051: Line Tracking Rebot
Working :Below is a flow chart that explains the working of the Rebot :-
Zohaib Jahan
10-ECT-96
facebook.com/zohaibjahan
Project Report for Microcontroller 8051: Line Tracking Rebot
Microcontroller ( AT80C51) :The microcontroller receives the signal and responds accordingly. It takes the decision based on input signal received by both the receiver LEDs. It will give command to motors through H-bridge to move forward, or take a left turn or a right turn.
Zohaib Jahan
10-ECT-96
facebook.com/zohaibjahan
Project Report for Microcontroller 8051: Line Tracking Rebot
IR Sensors :The Infra Red sensors are used to interact with the environment. The emitter sends a ray which is received by detector in the form of voltage and it then amplified by amplifier since the signals are weak (more on this later). Below are the circuit diagrams of Infra-red LED emitter and receiver.
Zohaib Jahan
10-ECT-96
facebook.com/zohaibjahan
Project Report for Microcontroller 8051: Line Tracking Rebot
Op-Amplifier ( LM324 ) :If the rays received by the IR- LED receiver are above a particular threshold then an amplified signal is generated by the amplifier (LM324). Note that the sensors cannot directly send a signal to the microcontroller as the signal voltage generated by them is too low and even when sensors are on white surface signal generated by them will interpreted low by the microcontroller.
Buffer ( 74LS245 ) :It energizes the signal without changing it. It takes input from Microcontroller 8051 & gives logic value, i.e. 5V / 0V to Motor Controller L293D. It also takes input from LM324 & gives output to Microcontroller 8051.
Zohaib Jahan
10-ECT-96
facebook.com/zohaibjahan
Project Report for Microcontroller 8051: Line Tracking Rebot
H-bridge ( L293D ) :The microcontroller sends a signal to the H-bride that acts as a switch. If the signal received by the H-bridge is high it will rotate the motor or else it wont do so. Note that microcontroller only sends a signal to a switch which gives the voltage required by the motor to rotate. Here we are using L293D which can be used to control two motors. Pin connections for H-bridge: En1 & En2 are given logic 1 from microcontroller or give 5V from outside and are used to activate/deactivate one half of the H-bridge. V is the voltage that you want to supply to the motor(s) : 9 or 12V Vcc is the logic 1 or 5V
Zohaib Jahan
10-ECT-96
facebook.com/zohaibjahan
Project Report for Microcontroller 8051: Line Tracking Rebot
DC Motors :Dc motors are the mechanical components of the project. They have sepecafic parameters torque, speed & voltage. We used two DC Motors of the rating according to our requirement.g Rating : Voltage : 3V Current : 600 mA Torque : 1kg / cm Speed : 100 rpm
This rating of these DC Motors meets our requirements to drive the Car.
Zohaib Jahan
10-ECT-96
facebook.com/zohaibjahan
Project Report for Microcontroller 8051: Line Tracking Rebot
Circuit Diagram :
The complete circuit diagram with all the integrated circuits required for making a line follower is shown below:-
Zohaib Jahan
10-ECT-96
facebook.com/zohaibjahan
Project Report for Microcontroller 8051: Line Tracking Rebot Code :Programming ,,, Below is the code in C for the line follower.
#include <AT89X52.h> /* P2_0 & P2_1 P2_2 & P2_3 ------>> inputs of Left Motor ( from uC to L293D ) ------>> inputs of Right Motor ( from uC to L293D ) P1_0------>> Output of Left Sensor ( from LM324 to uC ) P1_2------>> Output of Right Sensor ( from LM324 to uC )
working ::
0/Ps of Sensor 0 0 1 1 */ void Forward() { P2_0=1; P2_1=0; P2_2=1; P2_3=0; } 0 1 0 1 to stop Rebot to turn Left the Rebot to turn Right the Rebot to Forward the Rebot
Zohaib Jahan
10-ECT-96
facebook.com/zohaibjahan
Project Report for Microcontroller 8051: Line Tracking Rebot void TurnLeft() { P2_0=0; P2_1=0; P2_2=1; P2_3=0; } void TurnRight() { P2_0=1; P2_1=0; P2_2=0; P2_3=0; } void stop() { P2_0=0; P2_1=0; P2_2=0; P2_3=0; } void main() { char x='a'; while ( x='a' )
Zohaib Jahan
10-ECT-96
facebook.com/zohaibjahan
Project Report for Microcontroller 8051: Line Tracking Rebot { If (( P1_0==0 ) && ( P1_2==1 )) TurnLeft(); else if (( P1_0==1 ) && ( P1_2==0 )) TurnRight(); else if (( P1_0==1 ) && ( P1_2==1 )) Forward(); else stop(); } }
// End of While Loop // End of Main Function
THE END
UNIVERSITY OF ENGINEERING AND TECHNOLOGY TAXILA, Sub-Campus Chakwal
(Report made by Zohaib Jahan: BSc Electronic Engineering ) www.facebook.com/zohaibjahan ::: [email protected]
Zohaib Jahan
10-ECT-96
facebook.com/zohaibjahan