I am working on a project to switch a spring-applied brake (datasheet, page 84, MCNB 2GR) using a Teensy 3.5.

I only have limited electronics knowledge and am struggling with weird behaviour from the transistor. I have previously asked for some help in this post and have applied the help to create the following circuit:

Circuit diagram

As opposed to my previous question, I have switched to using a Teensy 3.5 which only supplies 3.3 V as an output on the digital pins.

The idea is to use a Sharp PC817 (datasheet) to isolate the Teensy and the 24 V circuit and then use a 2N3904 (datasheet) to turn on off the 24 V for the brake which is symbolised as R1.

The strange behaviour starts after a few seconds of sending a 3.3 V signal to the opto-isolator. At first the circuit works as expected and the brake turns on and off based on the current state of the output pin. However after some time (probably about 5-10 seconds), the brake doesn't turn off anymore (i.e., it still receives enough power to be in its on-state) when the output pin is turned off. The only way to turn it off is to turn off the 24 V DC power supply.

After some investigation, I found that the transistor gets extremely hot, hot enough to cause burn marks when touching it for less than a second. Considering that the circuit works normally after a little while, I think this issue is transistor related and has some relation to its temperature. I have also taken voltage readings on the transistor and have found the following:

When turned off: E: 0 V, B: 0 V, C: 23.96 V
When just turned on: E: 0.125 V, B: 0.84 V, C: 5.76 V
When turned off after being on 5-10 sec: E: 0.075 V, B: 0.493 V, C: 8.6 V

It seems to me as if the transistor does not completely turn off and still letting enough voltage/current through to keep the electromagnet in the brake engaged.

I am not entirely sure if the temperature is the problem. I am guessing that I may have either chosen the wrong resistance values in my circuit or that maybe the transistor is no good for what I want to do.

Is there a way to fix this without changing the transistor?

  • 3
    \$\begingroup\$ Confirm that you are taking all voltage readings with reference to the battery negative. (Multimeter black lead to 24V-. The base voltage then should be 0 V when off and about 0.7 V when on. You should never see anything like B: 8.4 V. \$\endgroup\$
    – Transistor
    Commented Oct 15, 2020 at 6:38
  • 2
    \$\begingroup\$ @Custos yes but don't you need a suppression circuit like a diode for instance to protect the transistor? \$\endgroup\$ Commented Oct 15, 2020 at 7:01
  • 4
    \$\begingroup\$ You brake is electromagnetic: i.imgur.com/lveKdrO.jpeg, implying that it is using an induction coil. When the transistor switch is breaking electric circuit. There will be a huge "Back EMF" spike current flowing back to the transistor and might fry it. So you need a "flyback diode" to "absorb" the back EMF current/energy: Or you might consider an electromagnetic relay to switch the current, instead of the transistor. \$\endgroup\$
    – tlfong01
    Commented Oct 15, 2020 at 7:06
  • 7
    \$\begingroup\$ You should put a flyback diode on the brake, else it will burn the opto and transistor (or it already did). \$\endgroup\$ Commented Oct 15, 2020 at 7:07
  • 2
    \$\begingroup\$ @Custos add a freewheeling diode as everybody is suggesting. parallel to the brake and its cathode at the 24V side. \$\endgroup\$ Commented Oct 15, 2020 at 7:11

2 Answers 2


A brake is an electrogmagnetic component. It has a resistance but is mainly inductive.

When the brake is turned off the current will tend to continue flowing and a spike or back electromotive force will appear which will overheat or destroy the transistor after it is blocked.

Adding a freewheeling or flyback diode will allow current flow in this condition and protect the transistor:

enter image description here


In addition to the flyback diode problem, the fact that VCE (collector/emitter voltage) is 5.64V when the transistor is on means that it's not fully on. This greatly increases the amount of power dissipated in the transistor, which causes it to heat up more. Overheating can also damage a transistor.

You might need to increase the base current by decreasing R2, or even by adding another transistor stage between U1 and Q1 (if U1 is too weak). Q1's datasheet should tell you the needed amount of base current.

  • 3
    \$\begingroup\$ Depending on the Current Transfer ratio of the optocoupler, reducing R4 would likely be required as well. Given that the difference between the Teensy output and the optocoupler LED's forward voltage is about 1 volt, 220 ohms would be a good value. \$\endgroup\$ Commented Oct 16, 2020 at 4:44
  • 2
    \$\begingroup\$ 2N3904 is a small signal transistor, not well suited to the ~200 mA draw here. Darlingtons are a common solution. Personally, I'd go with an LM395: it protects itself. It'll stop delivering current if it gets hot, \$\endgroup\$
    – John Doty
    Commented Oct 16, 2020 at 13:05
  • \$\begingroup\$ @JohnDoty That's a really key point here. The maximum allowed collector current of the transistor is exactly 200 mA. This application runs it close to that limit. OP should really pick a different part that won't be stressed to the max every time it's turned on. \$\endgroup\$
    – TooTea
    Commented Oct 17, 2020 at 12:16

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.