24 V transistor switch acting strangely

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.