So I wanted to procrastinate studying for an exam last night and whipped out some components to make a simple light sensor circuit that would output analog between 0-5v. I had an IR phototransistor laying around that, so I used that instead of a photoresistor. At first I did not have R2 in the circuit, and although I was able to measure a signal, the data was very noisy when no light was on, or if the light level was low. I tried changing some resistors, but it didn't help anything. I then realized I had nothing connected to ground, but couldn't really see where anything should be connected to ground. I finally ended up putting a 100kohm resistor on the emitter of the transistor, and that solved all my problems. I think I understand vaguely how this works, but I don't fully understand the purpose of R2. Can anyone explain?
I drew the schematic in power point, please forgive me.
I drew the schematic in power point, please forgive me.
Last edited: