Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Questions about a line following robot

Not open for further replies.


New Member
My friend and I are getting started in robotics, and for our first project, we want to make a line following robot. He's going to do the physical construction, and I'm to do the electronics. I'd like to do this without a microcontroller if possible.

Would it be easier to follow reflective tape, or a black line? I was thinking of having three light sensors in a row, and a comparator to compare each of the sides to the center sensor. Then, if the side sensor, depending on whether we're following a black or reflective line, has a voltage that indicates the line is underneath it more than the center sensor, the comparator's output would trigger something to slow down one of the side motors until the line was under the center again. I'm not sure how I'd control the motor with that though, any thoughts? And what are some light sensors I should look at? My experience with light sensors begins and ends with lego robot sensors.

How does that strategy sound? Any suggestions would be appreciated.

Things are going to be too complex and difficult without using microcontroller. Have a look at this page for some idea:
**broken link removed**
I'd hoped to avoid microcontrollers for now at least.. oh well. I'll have to learn them eventually anyways :)

Thanks for that link, looks like it's exactly what I want to do.
I agree with kinjalgp. You should use a micro. Everything would be easier!!
All I know is white lines are much more commonly used than black ones.
You do not need a microcontroller for such a simple function. You need a white line in order to reflect light back up into your sensors. Use two sensors side by side.. Take the output from each of these sensors and use a voltage comparator, the reference set with a potentiometer. Then, you will have two digital signals which are triggering at a point set by two potentiometers.

Use these to provide signals into a logic circuit. The simplest I could think of, would be to shut the motor off opposite the side where the light isn't reflecting. This will be very jerky, so, it would be best to reduce the speed of the other motor in order for it to maintain a straight line.

Using a microcontroller gives you a lot more flexibility to make a robust control interface that will give you optimal results. A simple logic circuit can demonstrate the function needed. If you are looking to put this into competition, then I would work a little bit harder and explore different methods.

This isn't going to be in competition, though we may later build one that will. I'll get to work designing it, it'd be a lot easier if we could use a simple comparator like that instead of a microcontroller.
if you want to make a line trcer robot without microcontroller try this schem.
This line tracer robot is guided by white line (shiny line) in the dark field.
This schematics use two light sensor (LDR). It just using comparator. if the left sensor detect white line, left motor on, and right motor off. And if the right sensor detect white line, right motor on, and left motor off.


  • robot.jpg
    21.5 KB · Views: 7,346
The differences between using or not using mc is that

1) You cannot drive your robot smoothly
2) You need many logic ports instead of only one mc
3) Even using logic port or mc, I think you should build a hiden transceiver as references, then use opamp to got logic 1 or 0.
4) You cannot reload rite pose, if your robot lost way, without mc. In a grid map of lines, a mc is required.
5) I don't know, but I got an idea that you may use relays as a very simple model of PLC to try with your robot. And I'm sure responsible time will be longer. << don't care bout this, it's really stupid....

<< I got problems with using PIC, because in my country, they are not familiar with PIC, but 8951.
Why not making the robot follow a wire with a current flowing through it. This would probably be a little harder to achieve but it can be done. Make two coils to put at the bottom of the robot. When the robot is moving straight (strenght of magnetic field is equal in both coils) you can use a flip-flop with transistors to activate the motors to move forward. When more electrocity is induced in one coil than the other, a flip flop can be made to move one motor in the opposite direction, making the robot align itself. When it turns, because the induced electricity becomes higher in the other coil, the robot moves the other way, and so on. This will happen more until the electricity in both coils is equal and the robot will follow the line straight again. The electronics of this sounds quite complicated but is in fact quite simple, even someone new to electronics could do it.
good luck
:?: well i was consulted by my lecturer to use 555 timer in order to obtain a square wave for PWM control of line follower. it was simple according to him, a sensor, comparator, 555 timer, h-bridge..that its!!! the logic circuit that used to replace microcontroller was magnificent! but does the robot move smoothy on the surface... since one of its motor shut down at one time...i would prefer another way of there any other way to control the line follower without microcontroller? thank you.
Why do you not want to use a mc. If its because you dont want to learn how to use it then your heading down the wrong track. Many of the people here seem like they would be of greater help if you used a mc. Im sure the people here would help you get started just like they helped me. Its really not that time consuming to get all the tools to start programming MC's and its not expensive. You can go onto and get free PIC sample and pay absolutlynothing for them, not even shipping. And the P16Pro programmer cost me $23 and that included shipping. I received everything in less than 2 weeks and now im on my way to setting it up and learning how to use it all. Everyone here has been very helpful and understanding while trying to get me started using and programming all this stuff.

So if its because you think its easier to use logic circuits i would have to say you wrong for thinking that. Give MCs a chance it will save you time in the future when you want to build something more complex. you wont have to start from the beginning to build a more complex robot
If you want to get started with robotics, then get started with programming and micros.
can someone tell me how to make a line follower without an mc pl? and my friend hav spent a month on this already and our mc doesnt we want to now make it without a comparator...

is it as simpole as connecting left sensor digital out put to a NOT gate and then to the motors? or is there more to it...

so far we hv made our sensor circuit using an LM324N(volt comparator) and motor circuit using a L293D motor driver...we need to put these two together help...

Howdy, i have built a line following robot before using 1 White LED in the middle of 2 photocells. looks like this ----> o0o o=photosensor or CDS cell 0 is the white LED

THen you use a LM393 comparator to compare one photoresistor to the other and power that with PNP transistors. THere you go a line folo bot!
Here's the example you want.

**broken link removed**

Basically, I'm searching line following robots without relying on mc instead using simple ic's.
can anyone please give me the circuit diagram or link for making a line tracer robot with microcontroller for competitions
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips