LOGIN
মোহাম্মদ ওমর ফারুক প্রিতুল
student of CSE at Rajshahi University
 · RajshahiBangladesh
Edit
Delete
Share
Report
QUESTION
  ·  Mark as Answered

how can I create a line following robot? please give me instructions!!

0 like 
Like
Share
Rick Stone
Community Helper, Finance Guy, Ex-Lawyer
 · New YorkU.S.
Edit
Delete
Share
Report

You should direct your question to the project leaders who started Room Cleaning Robot, and other robotic project leaders.

0 like 
Rishabh Raut
Student
 · NashikIndia
Edit
Delete
Share
Report

Case 1 is when the robot has to move front as only the center sensor is low. Similarly Case 2 is right, Case 3 is left and case 4 is stop as all the sensors read high. This is how your code should look like (the terms, LEFT_SENSOR, RIGHT_SENSOR, CENTER_SENSOR, GO_FRONT, TURN_RIGHT, TURN_LEFT, STOP are all code macros for the corresponding pin in the microcontroller).

while (1)
{
    if((LEFT_SENSOR==1)&&(CENTER_SENSOR==0)&&
(RIGHT_SENSOR==1))
        LATB |= GO_FRONT; // Case 1
    if ((LEFT_SENSOR==0)&&(CENTER_SENSOR==1)&&(RIGHT_SENSOR==1))
        LATB |= TURN_RIGHT // Case 2
    if ((LEFT_SENSOR==1)&&(CENTER_SENSOR==1)&&(RIGHT_SENSOR==0))
        LATB |= TURN_LEFT // Case 3
    if ((LEFT_SENSOR==1)&&(CENTER_SENSOR==1)&&(RIGHT_SENSOR==1))
        LATB |= STOP; // case 4
}// End of while(1)
2 likes 
Narendran Ashok
Engineer
 · ChennaiIndia
Edit
Delete
Share
Report

Follow my blog to make a PID line follower. www.storyheros.com

0 like 
Marcelo Rovai
Electronics Engineer
 · Chile
Edit
Delete
Share
Report

Please take a look on my tutorial. Please let me know if I can help you on a more specific doubt.
https://www.hackster.io/mjrovai/line-follower-robot-pid-control-android-setup-e5113a?ref=user&ref_id=124266&offset=3
Thanks

0 like 
Sudeshna Kundu
under graduate ,Engineer,student
 · BhubaneswarIndia
Edit
Delete
Share
Report

You can make use of two IR sensors placed at the front of the chassis on the left and right side .
If any sensors of the detect WHITE SURFACE output is high.

while(1)
{
if(LEFT SENSOR==LOW && RIGHT SENSOR==HIGH)
take left turn;
if(LEFT SENSOR==HIGH && RIGHT SENSOR==LOW)
take right turn;
if(LEFT SENSOR==HIGH && RIGHT SENSOR==HIGH)
take GO FRONT;
}

0 like 
Jithin Cv
Engineer
 · KannurIndia
Edit
Delete
Share
Report

For making a line follower you need a sensor to identify the lines. There are some IR s3nsors available in the market, u can make use of those sensors. It’s better to buy an array of sensors. The values of sensors will depend on the hight and surrounding lights. Try to buy a polum sensor which is good from my experience…

0 like 
Leave a reply...
DISCOVER
CHAT
ALERTS
-2
DISCUSSIONS
-1
FEED