I have tried this way to construct a circuit, but the ir sensor didn't show any result in my arduino mega.......... I had tried 3 pair IR components already but failed to show any voltage difference........ then i tried to use LDR and LED to replace IR pair, it works
http://tutorial.cytron.com.my/2012/09/07/how-to-use-ir-sensor/
i connected "SENSOR" to analog input