Photo-reflector sensors

I'm building a line following robot with Arduino UNO R3 for a uni project and can't seem to get it working at all... it should work on the basis of using 2 photoreflectors to detect a black line.

I've used a chassis with 2x DC motors hooked up through 2 MOSFETs to an external power source and a digital pin per motor which works perfectly with Firefly (program for externally controlling arduino).

I then have 2x photo-reflectors each with 4 pins (Cathode, anode, emitter and collector) which I've got hooked up to live & ground but for the hell of me can't work out in which order they should connect back to arduino :frowning: I'm a tad confused how the emitter and collector pins should connect to allow me to connect to the analogue pins, and also how the 2 photo-reflectors should connect in relation to each other, any suggestions?

Any help at all would be HUGELY appreciated!

Links I've been looking at:
http://www.botbuilder.co.uk/codeandprojects/bbline/
http://garagelab.com/profiles/blogs/tutorial-make-your-line-following-robot

In their diagram the 47K resistor is the tricky part; if the analogRead (the voltage) on the "OUT" line is always low then you need a smaller resistor; if it's always high then you need a larger resistor. It can be very problematic getting reflectance sensors to give good values.

For your two sensors you need to connect the OUT lines to separate analog ports.

Don't forget that you can look at the sensor with your cell phone camera to see if the IR LED is actually lit up.