Let's Make Robots!

line follwing programming anyone???(urgently needed)

hello, 

im building this robot with a little difference, i want my robot to move along only a black thick line of 3cm.

as im very new to this programming stuff, i want to know wat kind of programming is required using all the same components, that is using sharp IR sensor.

please assist me as soon as possible.

thank you.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

you have not told us what processor your using or what language you want to program in.

Probably the easiest route is to use a digital reflectance circuit like the ones sold by Pololu. This makes an analog to digital converter (ADC) unnecessary for detecting a black line on a white background. This may make your life easier, but you will still have to learn and understand how to control two motors and program a microcontroller.

You are skipping ahead.

Yes, this will require programming. Programs (code) are not something you can just turn on and they work. You have to know how and why programs work so you can make them work with your robot. There is no fast way of doing this. You need to start with the basics and then move forward. Yes, it is usually a IR led, but I ask you this: How are you going to read the IR phototransistor? You will need to learn how to program your microcontroller to read the value from your phototransistor. This is just one step of many.

First, study what others have done and see how they did it. Google picaxe and arduino and start looking at basic info. Check out the Start Here robot (right at the top of this page) and see what went into it.Google "line follow how to" and see what comes up. Look for FAQ and click on it.

You must start with a blinking LED.

also is there any other project board on which this bot can be built???

ok thats right we gotta use IR LED and IR phototransistor.

so even if we are using IR LED and IR phototransistor, we would require to progamme the microprocessor right?

so i need to know wat programe can be written for to make it work ?

It would be best to first get a LED to blink. This is the "Hello World" of the robot community. Next, I would move onto building and testing all the parts you will need on a breadboard. Your line follow sensor will have, at a minimum, 2 sensors. You can assemble one of these sensors on a breadboard and do all your testing and coding. When it is time to add it to the actual robot, all the hard work will already be done. This goes the same for the motors, etc.

Again, line following can be as simple or complex as you want to make it. At the core, it is simply:

If the line is too the right, turn left  --and-- If the line is to the left, turn right. That's really it in terms of getting started.

The Sharp IR sensor is a distance (or proximity) sensor only. It does not detect colours or colour differences. You need something that can "see" brightness of objects. And a little light. And some enclosure so daylight cannot illuminate the object.

Those components are not expensive. One or two IR LEDs plus IR phototransistors will do. But you will have to order them. O course, I assume you already ave a few generic components like transistors, resistors, capacitors. Or you know how to take them from old gadgets.