Electrical – Electromagnet stays energized after being switched off

magnet

I've designed a circuit to turn on/off a 12V electromagnet but when I turn off power to the magnet it still has a magnetic force. The magnetic force when OFF is not as strong as when it is ON but it still has more magnetic force than desired. The electromagnet has no magnetic force before the circuit is powered up and current is applied to the magnet. Is there a modification I can make to my circuit that will eliminate the magnetic force when the magnet is switched off.

The 100nF capacitor is to absorb flyback current caused by the coil into the switch which is actually a digital I/O pin of an Atmel 328p

schematic

simulate this circuit – Schematic created using CircuitLab

Best Answer

You actually have a Darlington transistor with internal resistors rather than the BJT that you show.

I will assume that your solenoid draws quite a bit of current. You need much more than a 100nF capacitor across the transistor to absorb the energy. You have probably damaged the transistor (or possibly the capacitor).

When the Darlington turns off, the inductance will try to maintain the same current flowing, and the voltage at the Darlington collector will rise to make that happen. If the solenoid current is substantial, hundreds of mA or more, the capacitor will have little effect and the voltage will rise, probably to over 100V, causing the transistor (or possibly the capacitor) to break down. With enough energy that will kill the transistor. If the capacitor breaks down it has failed and probably short.

You can leave the capacitor on there, it does control the EMI and is not high enough value to cause problems for the transistor, but you must add a flyback diode across the coil (or something similar).


If you want the solenoid to drop out faster, you can add a resistor in series with the diode. The voltage across the coil will rise to a maximum of I*R +Vf where I is the operating current of the solenoid and Vf is the diode forward voltage. So if the solenoid draws 500mA and you want to allow the collector voltage to rise to 30V you can allow the (coil + diode) voltage to rise to 17V so R should be less than 34\$\Omega\$.

Related Topic