Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

IR Light sensor circuit with multiple phototransistors

Status
Not open for further replies.

mik3ca

Member
I'm trying to make this sensor work with any number of phototransistors in parallel but I do not know the equation for R2. When experimenting, I notice that with one phototransistor only, I get good results with R2 being 4.7M. When I add a few more phototransistors, I get good results with 470K resistor.

Eventually I'll be having 12 phototransistors in parallel in the same fashion as the three shown below and I'll also be connecting the output to an input of a 74HC251 IC for data processing.

The question is how do I adjust R1 and R2 given the number of phototransistors connected? and all phototransistors will be model PT334-6C and the opamp will be LM324N.

circuit.png
 
Would that be very useful it would act as one big phototransistor. If that's what your after I guess it would
I would think a resistor on each would work better you could get a idea of witch is on more if you made it like a r to r ladder.
 
The datasheet for the phototransistor says that its maximum dark current is 100nA which is 0.1uA. Then 12 of them might produce 12uA.
You forgot to tell us the minimum output high voltage you want So I will assume 3.0V. Then the resistor must be no higher than (5V - 3V)/12uA= 167k ohms. Use 150k or 160k if the dark light is very dark and the temperature is not high.
 
Allthough that might work I'd be inclined to use a conventional feedback divider using 2 resistors on the op amp, or reconfigure it as a comparator.
Also if you have 12 phototrannies paralleled capacitance might be an issue and slow down achievable datarate, 2 groups of 6 or 3 groups of 4 might be better, testing is probably the best way to find out.
Hum from mains lighting might also cause you triuble depending on the application, you can get special purpose infra red receiver modules that have toneburst decoding such as the Tssop38 as found in Tv's etc.
 
At least 25% of the time the phototransistors will be exposed to pitch black darkness with possibly a blacklight which I do not want detected. I think 2.4V would be more of a reasonable minimum high because I'll be connecting the opamp output to 74HC251 input and that output goes to an AT89C2051 microcontoller GPIO pin. I don't think data rate is an issue because if anything, I might require a rate of at most 30 bytes a second.
 
A 74HC251 is high speed Cmos with a minimum high input of 3.5V when the supply is 5V. Maybe you are thinking of an old 74xx TTL or the 74HCT251 with a TTL input spec.
 
A 74HC251 is high speed Cmos with a minimum high input of 3.5V when the supply is 5V. Maybe you are thinking of an old 74xx TTL or the 74HCT251 with a TTL input spec.

Yes I deliberately used a 74HC251 in my circuit because HC parts work over a wider range of voltages than HCT I think and HC is better at not producing EMI or other noise. But then again if for some reason, HCT is better, then I should prob use it.
 
The datasheet for the phototransistor says that its maximum dark current is 100nA which is 0.1uA. Then 12 of them might produce 12uA.
I'm not understanding how you get 12uA. If each one is 0.1uA then 12 x 0.1uA = 1.2uA.

Then your future comment suggests I use 3.5V for logic high input since the output of the opamp is connected to a data input of a 74HC251. so (5-3.5)/1.2uA=1250k resistor for 12 units. and for 1 unit.... (5-3.5)/0.1uA=15M

Am I accurate here with my calculations?
 
Yeah, you are correct, the buttons on my calculator are wearing out.
 
Use a separate resistor for each phototransistor and a diode AND gate to feed the opamp.

Mike.
 
I already did the PCB board so right now I'm gonna change resistor values to values according to audioguru's math and see what happens.
 
I don't think I'll need to make an and gate because I tested my circuit setup above on a breadboard and its just a matter of finding the correct resistor. I did the following tests based on components on hand.

All tests used 4 phootransistors in parallel and had the output of an opamp connected to an input of 74HC08 (and gate) and the other input tied high. I used 6VDC as batteries (ok I'll admit I used the el-chepo carbon zinc) but I noticed that R2 is very important.

If I use 1M then the phototransistors respond to lazer beam and room light (and LED turns off). If I used 470K then they only respond to direct lazer beam. It must make me think there is other math involved. Maybe I need to look up the "light" current instead of the "dark" and plug that into the equation.

Now what's interesting that I do like is that in both tests, when the circuit is in a pitch black room, the LED lights, but when the lazer beam hits within 1 inch of any phototransistor, the LED goes off. I notice I can slack in aiming accuracy more if R1 is doubled which is also what I like.

I'm gonna see what else the datasheet can reveal for me.
 
The datasheet shows that the phototransistors cannot all be made to be the same. 0.1uA is the maximum dark current at room temperature and some have less. The sensitivity (the light current) also has a range where some are more sensitive than others. The value of R1 sets the sensitivity to light (a higher resistance allows less light to turn in the phototransistor but then the dark current might also turn it on).
 
You are using an old LM324 opamp that has PNP input transistors where a negative going input turns them on. Then when there is a small amount of light the phototransistor must supply up to 0.25uA (the maximum input bias current of an LM324) to begin turning on the input of the opamp so the sensitivity to light is much less than if you used a modern Cmos rail-to-rail opamp.

EDIT: Wait a minute, the sensitivity is very low anyway because the value of R1 must be low enough to cancel the black current from 12 phototransistors.
 
see this is the thing... I know if R1 is too low, then the phototransistors will do nothing.
I already assembled my circuit and I don't know if there's a modern opamp that would work as a drop-in replacement for LM324 at a reasonable price. I guess for now I'll just have to buy a few packs of resistors in megaohm ranges and use trial and error since I did get good results with some combinations of resistor values when doing the circuit on a breadboard.
 
This is weird. I connect my circuit with 4.7M resistors and 8 photodiodes to an input of a 74HC251 and when I measure the voltage, I get 0.06V when light doesn't shine on the detector and when it does shine on it, I get 0V reading. Why is the reading so low?
 
This is weird. I connect my circuit with 4.7M resistors and 8 photodiodes to an input of a 74HC251 and when I measure the voltage, I get 0.06V when light doesn't shine on the detector and when it does shine on it, I get 0V reading. Why is the reading so low?
Before you used photo-transistors and now you have photo-diodes? Are the photo-diodes reverse-biased? How are they connected together? Please post your schematic.
 
The problem with your circuit design and why you are seeing the low output, is due to cumulative effects of adding more IR detectors and using them in a forward bias configuration (think paralleling several resistors.... the resistance cumulatively gets lower and lower) .... The key is to use the IR detector in a reverse bias mode where it acts like a capacitor and not a diode. In this mode the "capacitive" leakage is proportional to the amount of light falling on the IR detector. So the circuit "charges" the "capacitor" and any light falling on the IR detector discharges the "capacitor" proportionally.

For this circuit, personally I would do away with an Op-Amp, and use a Collector feedback bias configuration with an ordinary NPN (2n3904) transistor and use the IR detector in a reverse bias configuration. See "Collector feedback bias" at the following link ... **broken link removed**

The Cathode of the IR detector should go to the transistors Base, while the Anode of the IR should go to ground. Your 4.7M resistor would be fine across the Base-Collector (Rb) of the transistor. (Rc) should be anywhere from 10k to 47k. Your output is from the Collector of the NPN transistor. This is a self biasing configuration as well, so there shouldn't be any adjustments once you find the values that work for you.
 
Last edited:
The key is to use the IR detector in a reverse bias mode where it acts like a capacitor and not a diode.
The Anode of the IR detector should go to the transistors Base, while the cathode of the IR should go to ground.
Then you described a forward biased photodiode parallel with the forward biased base-emitter diode and it won't work.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top