connect IR Sensor

The answer so far is that you're doing it wrong. Everything. From the circuit, to the code, to using this forum to ask for help. All wrong.