Normally we get Black path on White background or White path on Background. As we know Black colour absorb the infrared and white colour reflect the infrared. So we can use this characteristic of infrared to indentify whether the sensor is placed in path or not.
Sensor Number :- TCRT 5000
Note :- there are many sensors which do the same task as TCRT5000
In here I describe about sensor called TCRT 5000 But for Line tracking purpose the best Sensor is
395F 048W
In Sri lanka you can find it in UNITEC and SENITH electronics.
395F 048F
This sensor can use for following circuits.
In above sensor there is two components. One is IR LED and other one is IR sensitive photo transistor.What is Photo transistor:- It act like a normal transistor. But only different is this transistor can on/off by point a IR beam to it.
Sensor is worked like below picture.
1) When power up the IR LED it continuously emit the IR beam. (you can see it through a Camera).
2) If it hits in a White surface it will reflect lot of IR beam to Photo Transistor. So current is passed through the Collector and Emitter.
If it hits in a Black surface it will absorb lot of IR and reflect few IR beam. So it is not sufficient to open the gate between Collector and Emitter.(So current cannot through the Collector and Emitter or very low current will flow through the Collector and Emitter).
But we are not connect this sensor directly to the arduino. It will connect through the following circuit.
You can connect two sensor to one IC(LM 358).
Use J1 and J2 to connect wit arduino. In J1 and J2 there is two terminals to each. One cumming from the circuit's ground(Say pin_G ) and other direct from the IC (say pin_IC). When connecting to the arduino you need to connect one of pin_G to arduino's ground pin. other to any analog read pin.
Also you can adjust the sensitivity by adjusting the preset. (RV1 and RV2).
Also you can use ready made arduino line hunting sensors.
And there is ready made line sensor array.