IR sensor help

If I understand what you have done correctly that is wrong.

A0 should go to a resistor and the cathode of the photo sensor. Then the anode should go to ground and the other end of the resistor to +5V. Use a 10K resistor to start and if you want to improve the sensitivity (but also increase the noise) make the resistor a larger value, say 100K.