Instructables

Step 5: IR distance sensor

the ir distance sensor is a very simple sensor, it is either of or on, if it is of it sends out a signal of 1 but if it is on it sends out a signal of 0, it cannot say how far away something is but only if something is there, It has a red led on the  back that light3s up when something is present, this is a very nice feature as it makes trouble shooting much easier. it is attchd to pin 9 on the arduino and the other two pins to the 6v power supply from the battery

I anyone else build a robot like this I recommend they put the sensor in the middle and set the caster back a bit, it would work much better if you are only using one, as I am planning on adding another sensor to the chassis on the other side that doesn't really matter to me