Simple Photodetector Circuit

I´ve designed this simple circuit to test a photodetector. I got the detector from an old 5 1/4" disk drive. If you can get one, you will find two photodetectorts: one is used to sense the density (double density or high density) and the other is used to detect floppy presence in the drive. You can get a stepper motor too, a LED and other components.

Well, the circuit is simple:

Photodetector Circuit

I use a small breadboard. As power supply I have a LM7805 voltage regulator wired to a wall transformer (220VAC-9VDC), but you can replace the transformer and the regulator with 3 1.5V batteries or 4 1.2V batteries.

The photodetector spec sheet tells me that with a foward current of 25-30mA I can get about 1mA of collector current (depends on temperature and life). The output is taken from the point between the transistor emitter and the 3.2K resistance.

With no load, my voltmeter reads 1.4V with photodetector´s gap free, and about 4.7V with the gap not free (you can put whatever you want to cut the ray: paper, plastic, etc; any non-transmisive material).

If you are careful, you can realize that this is not an on-off sensor. When the paper is moving, there is a short moment when the light received by the phototransistor does not equal the light emitted by the LED. This is because a portion of the light is stopped by the paper. As you move the paper to fill the gap, less light excites the phototransistor.

Magnifying the "proportional" part of the graphic (note I´ve drawn a red bar)

Measuring the voltage at the output, the voltage is more or less proportional to the distance the paper fills the gap. This is a problem in low speed gap filling.

To avoid this, I´ve added the 7404. It´s an Hex Inverter. It outputs the opposite of what it sees as input:

     Input: 0-1.4V ---> Output: 5V
     Input: 3.6-5V ---> Output: 0V

Tie phototransistor output to pin 1, the inverted state is at pin 2. Pin 7 is ground, and Pin 14 is +Vcc=5V.

Comparison of LED light with and without hex inverter:

So this device makes detection a little bit less non-perfect, resulting in a almost real light-no light sensing.

My circuit looks like this (Creative webcam has poor resolution):

Tinkered circuit