Post on 30-Nov-2015
3/9/13 Automated Line Following Robot
www.electronicsforu.com/electronicsforu/circuitarchives/view_article.asp?sno=491&title = Automated+Line+Following+Robot&id=4679&article_type=2&b_type=… 1/6
Tech Discussions Circuits Videos Tech Focus Resources Interviews White Papers Application Notes Offers & Ads
Innovators Microcontrollers Test & Measurement Career Trends Raspberry Pi
ELECTRONICS ZONE Engineer's Corner Business Corner Daily News Yellow Pages Jobs eZines & Publications
Login | Register | Advertise | About Us | Contact Us
M I C R O C O N T R O L L E R S
Automated Line Following Robot
Line-following robots with pick-and-placement capabilities are commonly used in manufacturing plants. These move on a
specified path to pick the components from specified locations and place them on desired locations.
Basically, a line-following robot is a self-operating robot that detects and follows a line drawn on the floor. The path to betaken is indicated by a white line on a black surface. The control system used must sense the line and manoeuvre therobot to stay on course while constantly correcting the wrong moves using feedback mechanism, thus forming a simpleyet effective closed-loop system.
Circuit description
Fig. 1 show the block diagram of the automated line-following robot. It consists of mainly four parts: twosensors, two comparators, one decision-making deviceand two motor drivers. The robot is built usingmicrocontroller AT89C51 (used as the decision-makingdevice), motor driver L293D, operational amplifier LM324(comparator), phototransistor (sensor) and a fewdiscrete components.
In the circuit, the sensors (phototransistors) are usedto detect the white strip on a black background. The sensor output is fed to the microcontroller, which takes the decisionand gives appropriate command to motor driver L293D so as to move the motor accordingly. Sensor. The sensor senses the light reflected from the surface and feeds the output to the comparator. When the sensoris above the white background the light falling on it from the source reflects to the sensor, and when the sensor is abovethe black background the light from the source doesn’t reflect to it. The sensor senses the reflected light to give anoutput, which is fed to the comparator. Comparator. The comparator compares the analogue inputs from sensors with a fixed reference voltage. If this voltage isgreater than the reference voltage the comparator outputs a low voltage, and if it is smaller the comparator generates ahigh voltage that acts as input for the decision-making device (microcontroller).
Microcontroller. The microcontroller is programmed to make the robot move forward, turn right or turn left based on theinput coming from the comparator. The outputs of the microcontroller are fed to the motor driver. Motor driver. The current supplied by the microcontroller to drive the motor is small. Therefore a motor-driver IC is used.It provides sufficient current to drive the motor.
Fig. 2 shows the circuit of the automated line-following robot. When light falls on thephototransistor (say, T1), it goes into saturation and starts conducting. When no lightfalls on the phototransistor, it is cut-off. A white LED (LED2) has been used to
3/9/13 Automated Line Following Robot
www.electronicsforu.com/electronicsforu/circuitarchives/view_article.asp?sno=491&title = Automated+Line+Following+Robot&id=4679&article_type=2&b_type=… 2/6
falls on the phototransistor, it is cut-off. A white LED (LED2) has been used toilluminate the white path on a black background. Phototransistors T1 and T2 are usedfor detecting the white path on the black background. Collectors of phototransistors T1 and T2 are connected to the inverting inputs ofoperational amplifiers A2 and A1. The signal voltage at the inverting input of theoperational amplifier is compared with the fixed reference voltage, which is formed by apotential divider circuit of 5.6-kilo-ohm resistor and 10-kilo-ohm preset. This referencevoltage can be adjusted by changing the value of the 10-kilo-ohm preset. When sensor T2 is above the black surface, it remains cut-off as the black surfaceabsorbs virtually all the light falling from LED2 and no light is reflected back. Thevoltage at the inverting input (pin 2) of operational amplifier A1 is higher than thereference voltage at its non-inverting input (pin 3) and therefore the amplifier outputat pin 1 becomes zero. When sensor T2 is above the white line, the light gets reflected from the white surfaceto fall on phototransistor T2. Phototransistor T2 goes into saturation and conducts.The inverting input (pin 2) of operational amplifier A1 goes below the reference voltageat its non-inverting input (pin 3) of operational amplifier A1 and therefore output pin 1goes high. This way, the comparator outputs logic ‘0’ for black surface and logic ‘1’ forwhite surface. Similarly, comparator A2 compares the input voltage from phototransistor T1 with afixed reference voltage. The outputs of operational amplifiers A1 and A2 are fed to microcontroller AT89C51.The AT89C51 is an 8-bit microcontroller having 4 kB of Flash, 128 bytes of RAM, 32 I/Olines, two 16-bit timers/ counters, a five-vector two-level interrupt architecture, on-
chip oscillator and clock circuitry. A 12MHz crystal is used for providing the basic clock frequency. All I/O pins are reset to‘1’ as soon as RST pin goes high. Holding RST pin high for two machine cycles while the oscillator is running resets thedevice. Power-on reset is derived from resistor R5 and capacitor C1. Switch S2 is used for manual reset. Themicrocontroller, based on the inputs from sensor T1 (say, left) and sensor T2 (say, right), controls the motor to make therobot turn left, turn right or move forward. Port pins P2.0, P2.1, P2.2 and P2.3 are connected to pins 15, 10, 7 and 2 of motor driver L293D. Port pins P2.0 and P2.1are used for controlling the right motor, while port pins P2.2 and P2.3 are used for controlling the left motor. Three wheelscan be used for this robot—one on the front and two at the rear. Front wheel can rotate in any direction as specified bythe rear wheel. To make the robot turn left, the left-side motor should stop and the right-side motor should rotate in theclockwise direction. Similarly, to make the robot turn right, the right-side motor should stop and the left-side motor shouldrotate in clockwise direction. For forward motion, both the motors should rotate in clockwise direction.
Working
An actual-size, single-side PCB for the automated line-following robot isshown in Fig. 3 (View as PDF) and its component layout in Fig. 4 (View asPDF). Fig. 5 shows the path of the line-follower robot, where ‘L’ is the leftsensor and ‘R’ is the right sensor. At the start, when the robot is at point ‘A,’ sensors T1 and T2 are abovethe black surface and port pins P3.0 and P3.1 of the microcontroller receivelogic ‘0.’ As a result, the robot moves forward in straight direction.
At point ‘B,’ a leftturn is encountered,and the left sensorcomes above thewhite surface,whereas the rightsensor remainsabove the blacksurface. Port pinP3.0 of themicrocontrollerreceives logic ‘1’
from the left sensor and port pin P3.1 receives logic ‘0’ from the right sensor. As a result, the left motor stops and theright motor rotates, to make the robot turn left. This process continues until the left sensor comes above the blackbackground. Similarly, at point ‘C,’ where a right turn is encountered, the same procedure for right turn is executed. When both thesensors are at the white surface, the robot should stop. The output of the microcontroller (IC2) depends on the inputsreceived at its port pins P3.0 and P3.1 as shown in table.
3/9/13 Automated Line Following Robot
www.electronicsforu.com/electronicsforu/circuitarchives/view_article.asp?sno=491&title = Automated+Line+Following+Robot&id=4679&article_type=2&b_type=… 3/6
5
61 26 7 Post Comment | 36 Comments
Shree Harsha 304 days ago
Good one.But need more information... Reply 1 Reply
Efy Admin 303 days ago
Software
The source program for the project is written in Assembly languageand assembled using Metalink’s ASM51 assembler, which is freelyavailable on the Internet for download. It is well commented for easyunderstanding and works as per the flow-chart shown in Fig. 6. Thehex file ‘robot.hex’ is to be burnt into the microcontroller.
ROBOT.ASM
$MOD51 ORG 0000H LJMP MAIN ORG 0030HMAIN: SETB P3.0 ;Input for left sensor SETB P3.1 ;Input for right sensorAGAIN: JB P3.0,NEXT JB P3.1,GO CLR P2.0 SETB P2.1 CLR P2.2 SETB P2.3 SJMP AGAINGO: CLR P2.0 SETB P2.1
CLR P2.2 CLR P2.3 SJMP AGAINNEXT: JB P3.1,GO1 CLR P2.0 CLR P2.1 CLR P2.2 SETB P2.3 SJMP AGAINGO1: CLR P2.0 CLR P2.1 CLR P2.2 CLR P2.3 SJMP AGAINHERE: SJMP HERE END
Download actual-size, single-side PCB layout.
Download PCB component layout.
Related Articles
Part 2 of 3 Using AVR Microcontroller for Projects Posting Date: February 19, 2013 | Views: 349
Part 2 of 3 Using AVR Microcontroller for Projects Posting Date: February 19, 2013 | Views: 349
Microcontroller-Based Clock Using DS1307 Posting Date: September 21, 2012 | Views: 34378
Microcontroller-Based Solar Charger Posting Date: February 10, 2012 | Views: 7848
RFID-based Security System Posting Date: February 08, 2012 | Views: 14796
ShareShareShareShareMore
3/9/13 Automated Line Following Robot
www.electronicsforu.com/electronicsforu/circuitarchives/view_article.asp?sno=491&title = Automated+Line+Following+Robot&id=4679&article_type=2&b_type=… 4/6
Efy Admin 303 days ago
What kind of information do you think can be added? Reply 2 Replies
akash 279 days ago
sir i want to make a project over wireless remote controlled switching of lights onoff. please help me out... as soon aspossible..
Reply
EZHIL 253 days ago
sir i need set of vlsi projects Reply
agile 296 days ago
This ckt is not working.is it tested ckt or not?? Reply 2 Replies
Efy Admin 295 days ago
All our circuits are tested before publishing. What is the problem you are facing? Reply 1 Reply
Kart 295 days ago
seems to be awsome can i implement in my companyif possible send me more details to my mail.Thanks Reply
akash 279 days ago
hey ..ece branch or what? Reply
agile 295 days ago
motor is not working..... Reply 1 Reply
RP 225 days ago
MY MOTOR IS WORKING BUDDY Reply 1 Reply
Akash Patel 126 days ago
how many voltage you gave to it.because my motor is not working with 5-6V. Reply
agile 274 days ago
ckt is now workingcan we ust 7805 regulator with controller? Reply 1 Reply
XYZ 259 days ago
OFCOURSE.. U can use but use it along with the transformer Reply
rupam kalita 273 days ago
can give more details about the ckt? Reply
avishek ghosh 267 days ago
how do we burn the code in the microcontroller..???? Reply
abc 260 days ago
Sir I havee to build a line tracer using IR sensors7.Can i get some circuitry related to that? Reply
VrOon 256 days ago
@Admin Im a student of Diploma EXTC last year i need some good and innovative project for my last year.. PLzz mail me assoon as possible..thanking you
Reply
3/9/13 Automated Line Following Robot
www.electronicsforu.com/electronicsforu/circuitarchives/view_article.asp?sno=491&title = Automated+Line+Following+Robot&id=4679&article_type=2&b_type=… 5/6
mahesh 247 days ago
sir can you plz load the c file here for the same project... Reply
akash dhiman 244 days ago
please can any body give the codes for this project.....???? Reply 1 Reply
Shirsha Ghosh 231 days ago
I have build this using AVR ATMega8 uC. This is the code for that#includeavrio.hvoid main DDRC0x00 DDRD0xf0PORTD0x00 while1 switchPINC&0x03 case 0x03 PORTD0x00 break case 0x02 PORTD0x10 break case 0x01 PORTD0x40break case 0x00 PORTD0x50 break
Reply
bhaumik 240 days ago
what is the rpm of motor Reply
cubertron 227 days ago
May I have the hex file ? Reply
RAK 225 days ago
Hi can any one help developing a module which transmits signal to a distance of 3 km range.. plzzz do soo i am in need.. Reply
inertia 216 days ago
the flow diagram is incorrect at 4 level i think because it saysright motor stops and robot turns rightit should be right motorstops and robot turns left.My main question is that the program of this robot can run in avr studio and proteus or not?
Reply
mangesh 216 days ago
i like the info given Reply
vivek 196 days ago
@admin efy ...sir i want to do this project can you send me the componnents.....motors ....ics....pcb layout.....all requiredmaterials for this project???.....what will be the total cost.....and how much time it will take for delllivery....how can i place theorder for this....
Reply
soumya 195 days ago
I need project of socially relevant Reply
richy 195 days ago
hey i need some iit projects ...... is ther anybody to helpmailtatrach127@gmail.com Reply
janardhana 168 days ago
sir i want to do this project can you send me the componnents.....motors ....ics....pcb layout.....all required materials for thisproject???.....what will be the total cost.....and how much time it will take for delllivery....how can i place the order for this....
Reply
karthick 153 days ago
Can u plzzz post the hex coding for black line follower .. Reply
Akash Patel 127 days ago
sir Can we apply 12V to the circuit instead of 6V? because my DC MOTOR50rpm is running very very slowly with 5-6V. Reply
surendar 58 days ago
please write programs in c languge Reply
surendar 58 days ago
3/9/13 Automated Line Following Robot
www.electronicsforu.com/electronicsforu/circuitarchives/view_article.asp?sno=491&title = Automated+Line+Following+Robot&id=4679&article_type=2&b_type=… 6/6
surendar 58 days ago
where do i fix the photo transistor? is both transistors near? or....one in right side and another one is left side?if i fixed theseare seperatelyis both transistor absorb properly?
Reply
Nidhish 56 days ago
Would U tell mewhat ll be the cost of this project. Reply
vikash 46 days ago
@admin efy ...sir i want to do this project can you send me the componnents.....motors ....ics....pcb layout.....all requiredmaterials for this project???.....what will be the total cost.....and how much time it will take for delllivery..is it available at yourokhla branch?pls replly me asap.
Reply
JAIPRAKASH SHARMA 10 days ago
SIR ... I WANT TO MAKE A DISPLAY SYSTEM ON LCD USING MICROPROCESSOR 8085.... PLZ HELP ME.... Reply
Magazines
Electronics for YouLINUX for YouFacts for You
Electronics Bazaar
Portals
electronicsforu.comefytimes.combpotimes.com
linuxforu.com
Directories
Electronics AnnualGuide
Events
EFY EXPOEFY AwardsEduTech Expo
OSIWEEK Expo
News Verticals
ElectronicsInfotechLinux & Open
SourceConsumerElectronicsScience &TechnologyBPO
Educational Institute
EFY TechcenterKitsnspares.com
© Copyright 2012 EFY Enterprises Pvt. Ltd. All rights reserved.Reproduction in whole or in part in any form or medium without written permission is prohibited. Usage of the content from the web site is subjectT etor ms and Conditions