# Phototransistor circuit design

1. Aug 28, 2009

### StealthRay

Can anyone help me to check and calculate the resistance required?I am confused on the calculation part.

For example,the specification of a phototransistor is given below:
Vceo = 45v
Veco = 6v
Vcbo = not in datasheet
Vebo = not in datasheet
Power dissipation = 75 mW
Ic = 10 mA (condition Vce = 5V) (typical)
Ic = 2.5mA min
Ic = not stated for max
Dark current, Iceo = 2 nA
Vce (sat) = 0.2 V (condition Ic = 1mA)

The relay coil resistance = 393 ohms

Calculation of the Rc:
This is the way which I calculated (most likely wrong);

When phototransistor is off (no light);

Since we need 12 V to energize the coil,
Ic = V coil/Resistance of relay
= 12/393
= 30.5mA
When Voltage across coil = 12 V,
then Vc = 12V
Hence Rc = Vc/Ic
= 12V/30.5mA
= 393 ohms

If I am to disconnect the relay, and when phototransistor on;

Given Ic = 10 mA and Vce = 5v in datasheet;

Vcc = IcRc + Vce
Rc = (Vcc - Vce)/Ic
= 1900 ohms

I am abit confused here on the calculation.If I am to select 1900 ohms for Rc,I will surely not get 12V dc to energize the relay when phototransistor is off since the relay coil resistance is so small.I think something is wrong the way I used the datasheet.Can anyone correct me please.

2. Aug 28, 2009

### vk6kro

The phototransistor would not be able to drive that relay.

I think you need an amplifier between the two.

I have attached a simple modification that might be suitable.
It uses a PNP transistor with the phototransistor as its base resistor.

I also added a couple of safety resistors and a diode across the relay.

#### Attached Files:

• ###### scan.jpg
File size:
25.1 KB
Views:
293
3. Aug 28, 2009

### StealthRay

Thanks for correcting my circuit.

The addition of another transistor in the calculation is going to increase my headache up a few notch.

I would be appreciated if you can advice me on the phototransistor specification provided and how they are used in the calculation to select the appropriate resistor value.I am afraid I will get it all wrong in the calculation.

4. Aug 28, 2009

### vk6kro

So this is a homework assignment?

5. Aug 28, 2009

### StealthRay

nope,I am doing a project and this phototransistor is used to provide the signal for the PLC to control the motor.

I am trying to determine the correct components value for the circuit.

Editonestly I dont know how to calculate for pnp transistors.I am so used to npn transistor calculation and this pnp transistor going to kill me.

Last edited: Aug 28, 2009
6. Aug 28, 2009

### vk6kro

You don't mind adding a transistor, but it has to be NPN? Is that right?

Have a look at the attached diagram and ignore the diode being the wrong way around and the PNP transistor, does it look familiar now?

You would have to use a power PNP transistor. I would use a TIP32 which I know is available locally, but you might know something else.
Or, you could just use a NPN transistor in my upturned diagram.

#### Attached Files:

• ###### scan2.jpg
File size:
44.3 KB
Views:
206
7. Aug 28, 2009

### StealthRay

Yea,it looks familar but I still abit blur on the calculation.

I googled up and read up some pnp transistors.It seems that when the phototransistor on,it provides a opposite current to the pnp base which turn off the transistor.

So when the phototransisor is off,the base current from emitter will turn on the collector and hence energize the relay.

I will try to do some calculation tomorrow to see how it goes.

Thanks alot.

8. Aug 28, 2009

### vk6kro

No, it is just the same as a NPN except the polarity is opposite.

When the phototransistor is on, it acts as the normal base resistor of a transistor and turns the transistor ON. This causes collector current to flow through the relay and pull it in.

Select a PNP transistor that has a HFE of about 100. Work out the base current from this and then the current that must flow in the phototransistor.

If it still freaks you out, use an NPN power transistor.

9. Aug 28, 2009

### StealthRay

There is still a problem here which I couldnt understand.

Let say we remove the phototransistor from the circuit.Since the Vcc and Rc are still connected to the base of the transistor,dont you think the Vcc supply will always turn on the transistor regardless of the state of the phototransistor?

I am grateful that you spent so much time answering my question.Thx.

10. Aug 28, 2009

### waht

Not if you use a PNP transistor as first suggested. That's another reason why it is a good choice rather than using a NPN. You have to let current out of the base to turn on a PNP.

11. Aug 28, 2009

### StealthRay

Thanks for all the help.Now I got alittle bit of idea on the use of phototransistor as input for control.

I will try to sort out the calculation part.Can I post the calculation here and see if any expert can check it out or possibly correct them?

Initially I tried to get some help from the lecturer but she always asked me to simulate the circuit to determine the component values rather than calculate them up manually.I guess this forum is the only way I can ask for help.

12. Aug 28, 2009

### uart

Stealth-Ray, if you really want to use only npn transistors then try the following. (the components shown are suggestions only.)

BTW. In the original circuit that you posted the relay was off when the photo-transistor was on and visa versa. Is that intended or required? Note that all the proposed modifications (including this one) work the other way around. That is, the relay turns on when the photo-transistor is on.

#### Attached Files:

• ###### relaycct1.png
File size:
143.5 KB
Views:
158
Last edited: Aug 28, 2009
13. Aug 28, 2009

### uart

ARHHH So this IS homework!

14. Aug 28, 2009

### StealthRay

The on or off doesnt really matter as long as I can get 12V to energize the relay.The programming part can invert the inputs so it is still doable.

Btw,since when lecturer is only available for homework?

I am buidling a model to work on control and this phototransistor is only a small part of the model.And I am asking for help on the calculation and component selection.

I tried to look for help from the lecturer so I can learn how to calculate and then determine the correct component value.But it seems that the lecturer could not be of any help (I dont want to criticize the lecturer here).So I came here for help.

15. Aug 28, 2009

### uart

That's ok but at the with the present designs your relay will get close to 24 volts. Is that problem?

16. Aug 28, 2009

### StealthRay

Then how about adding a resistor at collector of the pnp transistor?

Vcc = IcRc + Vce + V coil

Or can we try to reduce the vcc to 12 V? I guess the resistance of the circuit has to be very low so there is enough voltage to energize the relay.

17. Aug 29, 2009

### uart

Yes you can add a series resistor to drop some voltage but normally it would be preferable to choose a relay which matches your availalble voltage (or visa versa).

18. Aug 29, 2009

### fleem

This is the way I'd do it. Then swap the relay contact and the resistor to invert the logic. Make sure the power transistor can take the current, and that Vcc is right for that relay coil (if the coil wants less voltage, put a resistor in series with it). if you need to increase the gain, add another darlington. if you need to decrease the gain, put a resistor from the phototransistor's emitter to gnd. In fact you can do both those things to make it more digital, and thus more efficient.

EDIT: i forgot to draw the damping diode.

#### Attached Files:

• ###### ckt.gif
File size:
3.7 KB
Views:
112
Last edited: Aug 29, 2009
19. Aug 29, 2009

### StealthRay

I have completed the calculation but I am not sure if they are correct.

Can I anyone good in this check my work out?

20. Aug 29, 2009

### vk6kro

Happy to have a look.

Do you know what your light source is and how fast you want to operate the relay?
ie Do you want to turn it on once a minute, once a second or once an hour?

And how long would it stay in each time?