Line following robot?

So I want to make a line following robot. In my electronics 12 class we are making one but out of an LM393 or something like that. It just measures which voltage source is greater then distributes more voltage to different side of a circuit to drive the motors. Now the challenge is to get the photoresistors calibrated and balanced because slight resistance changes affect it.

So here is my idea to how to approach the programming.

Basically photo resistors on lets say analog pins 2 and 3. Motors on digital pins 9 and 10 and use a voltage divider between motors and arduino.

Then basically get arduino to check which photo resistor has more or less light depending on surface and line to be followed. If the photoresistors show a the same value or close to the same value then it will go full to both motors.

So basically the resistors will be in their of little plastic squares which eliminates outside light and so they can only focus on the light in front.

So what do you say? DO I have the idea right or should I add more things or consider certain parts in my code?

You can just use a pot to calibrate the photoresistors. That's what I used on my line follower tank recently (TLC372CP instead of LM393, but same thing really). And there's no reason why you need an Arduino at all - the comparator can be used to drive the motors (through a transistor obviously).

Instead of a single photoresistor each side try using at least 2 - I found that works much better. Another thought is some under-body lighting via a couple of white LED's - they'll give your photoresistors a much better picture of things - causing less impact from ambient light changes. And what about a switch to change it from a black line follower to a white line follower? Simple inversion of the signal could achieve that.

Just my $0.02 worth!

Cheers,

pocketscience: You can just use a pot to calibrate the photoresistors. That's what I used on my line follower tank recently (TLC372CP instead of LM393, but same thing really). And there's no reason why you need an Arduino at all - the comparator can be used to drive the motors (through a transistor obviously).

Instead of a single photoresistor each side try using at least 2 - I found that works much better. Another thought is some under-body lighting via a couple of white LED's - they'll give your photoresistors a much better picture of things - causing less impact from ambient light changes. And what about a switch to change it from a black line follower to a white line follower? Simple inversion of the signal could achieve that.

Just my $0.02 worth!

Cheers,

this is funny cause this is exactly what we have on our shematic and plans to build the line follower. Thees 4 photo resistors, and a light display area to add light under the bot and the comparator. well thats great!

Great minds think alike! :)

I'd like to see the results of your project - for some reason line followers hold a strange attraction with me - especially those built on nothing more than simple voltage comparators. It's cool how much functionality you can get from such a simple component!

Cheers,

pocketscience: Great minds think alike! :)

I'd like to see the results of your project - for some reason line followers hold a strange attraction with me - especially those built on nothing more than simple voltage comparators. It's cool how much functionality you can get from such a simple component!

Cheers,

Ok well this is for school so IDK if I can keep it and it might take some time but ill let you know how it goes and maybe a picture if I get to keep it