I want to study the circuit of an Infrared proximity sensor, so I assembled a circuit with an infrared LED (940nm) and a phototransistor.
When no current passes from the LED, obviously the phototransistor is switched Off, thus the whole amount of current passes from the A0 branch. In that case I read from A0 a 1023 value which is equal to 5V for a 10bit ADC (Arduino).
When current passes from the IR Led, thus the Led is on, the phototransistor should be switched On, thus a considerable amount of current should pass from the phototransistor to Ground. Yet, even if LED and phototransistor are positioned extremely close, I read from A0 a value no less than 900, which means that only a 10% of the total current reaches the Ground.
I expected (and desired) when the IR Led is On, the value of A0 to be near zero, thus the phototransistor to be fully open and almost the whole current to pass from it.
Do I miss something there? Should I change something to the circuit or the components, in order to get an almost clear 0V or 5V?