I have implemented a PWM control over a relay from an Arduino. To isolate both circuits I have used an optocoupler 4N35 from Vishay. Since it cannot provide enough current flow to drive the relay, I have used a BC548B transistor creating a Darlington structure with the internal output transistor of the 4N35.

The problem is that I have simulated the circuit but then, when I try to calculate the currents in the circuit I am unable to achieve the simulated values. I don't know how to achieve the \$V_{CE(OK3)}\$ neither \$I_F\$.


$$I_{K1} = \frac{+12V_{PS2}-V_{CE(Q4)}}{K1}$$
$$I_{K1}=\frac{I_{C(Q4)}}{\beta _{Q4}}\frac{\beta _{OK3}}{(\beta _{OK3}+1)}+I_{C(Q4)}$$
$$P_{Q4}=I_{C(Q4)}V_{CE(Q4)}$$ I hope you can help me,

SOLUTION: Take the \$V_{CE(OK3)}=0.2V\$ as a standard bjt in saturation region and all the rest came easy. Calculations and simulations matched perfectly.

  • \$\begingroup\$ Why are you driving a relay with PWM? \$\endgroup\$
    – Wesley Lee
    Feb 28, 2017 at 14:06
  • \$\begingroup\$ Relays have a limited lifespan in terms of number of conmutations. Even with a very low PWM frequency you can easily wear out the relay pretty quickly. You should use a MOSFET instead. \$\endgroup\$ Feb 28, 2017 at 14:32
  • \$\begingroup\$ The PWM is a very very low frequency in this case. Nonetheless, the matter is how to calculate the power dissipation of this circuit. Can you help me with this? \$\endgroup\$
    – Salus
    Feb 28, 2017 at 16:44
  • 2
    \$\begingroup\$ Thanks for posting your solution, but realize the stackexchange is not a forum. It is a Q & A site. If you have an answer to your question, please post it as an answer and leave your question as just a question. \$\endgroup\$
    – Bort
    Mar 1, 2017 at 13:05
  • 1
    \$\begingroup\$ @Salus Don't forget to accept your own answer! \$\endgroup\$ Mar 1, 2017 at 13:41

1 Answer 1


The simplest answer is that you should not use this configuration. Instead, try


simulate this circuit – Schematic created using CircuitLab

A few notes:

You can calculate the opto current from the input current times the CTR, which you get from the data sheet. Then, since this is PWM, Q2 will be switched hard on and off, and in the on condition will only have a gain of 10 to 20 (it's called being in saturation), so you can calculate the load current from that.

Knowing the opto current in mA, multiply by about 11 to get power in mW. Voltage times current, right?

If you want to reduce opto power, place another resistor from +12 to the collector of the opto, sized to drop about 9 or 10 volts at the opto current.

  • \$\begingroup\$ Hi WhatRoughBeast, First of all, thanks for your answer. The thing is that the circuit is the one I added in the figure, there is no possibility to change it. I should calculate the power dissipation but I'm not able to modify the circuit. \$\endgroup\$
    – Salus
    Feb 28, 2017 at 14:57
  • \$\begingroup\$ Sure you can modify it. You cut pin 5 on the 4N35 right at the pcb and lift the lead stub, then solder a short piece of 30 ga wire from the stub to +12. Easy peasy. It'll take you less than 5 minutes. \$\endgroup\$ Feb 28, 2017 at 19:10
  • \$\begingroup\$ Jaja, I correct my words, I want to keep it as it is shown. Anyway, I have solved the problem by taking a Vce = 0.2V for the OK3, then, using the formulas given in the main post, the rest of the values come easy. \$\endgroup\$
    – Salus
    Mar 1, 2017 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.