Q:

When wiring IR Phototransistor, why is a pulldown resistor needed?

My phototransistor looks like the one here, wired like this:

I don't know the exact model or anything like that. It came in an Arduino kit and was labeled "flame sensor". I used an arduino to connect mine and Serial.print values from 0-1023. It was pretty much a fire detector. Why is a 10k resistor needed to connect to ground? I understand why it is needed when reading the state of push buttons. Why is it needed in this case? If I remove it, the ir phototransistor reads 1023.

A:

The pull down to ground is used to create a voltage divider, with the top half being the relative resistance of the Photo transistor.  Without the pull down, you only have a series resistor, which results in very little if any voltage drop across it in a low impedance input setup.
As a microcontroller ADC is a voltage sensing, not a current sensing device, you require a relative voltage to read, hence the voltage divider.
It also works exactly like a push button, in that the fixed resistor provides a default state instead of leaving the pin floating. In this case, the button isn't a short to VCC, but a variable resistance. It can close a little or a lot.

