I want to use a transistor to turn on and of an electric magnet, I have hooked up a transistor like this:


simulate this circuit – Schematic created using CircuitLab

The blue wire goes to the magnet and the white wire goes to the ground:

enter image description here

Regardless of if the arduino is on or off(I can even unplug port 12 from the arduino, the magnet is still on, the circuit never closes. What do I need to do to make the transistor turn off?

  • If you detach the base connection to the Arduino, it must close then. If not, you have reversed power source and the internal anti-parallel diode is opened. Or you've already destroyed your transistor.
    – KIIV
    Nov 11 '16 at 17:20
  • What is the part number? TIP120? Sounds to me like a transistor with a different pinout.
    – Gerben
    Nov 11 '16 at 17:30
  • 1
    Don't forget the freewheeling diode across the coil. Nov 11 '16 at 17:55
  • Did you make the electromagnet your self?If so some magnets will retain their magnetism for long time making it appear your circuit is not off. If you raplidy switch on or off too quickly may look like its on because it may retain magnetism Nov 11 '16 at 18:21
  • @Gerben, yes TIP120, cdn-shop.adafruit.com/datasheets/TIP120.pdf .
    – Himmators
    Nov 12 '16 at 15:34

Darlington transistors are very sensitive; even putting your hand near it can be enough to turn it on. Either tie the base to ground with a large resistor or switch to a MOSFET with its gate tied to ground through same. In either case put a diode backwards across the coil to absorb the energy from the coil when it de-energizes so that the transistor is not damaged.

  • Could you suggest a good MOSFET-transistor for a 12V magnet?
    – Himmators
    Nov 12 '16 at 15:33
  • I would recommend going to the web site of a distributor such as DigiKey or Mouser and using their parametric search tool to find an appropriate device. Nov 12 '16 at 17:13
  • @Himmators You dont need to MOSFET it, it will work with a tip 120 if you build the circuit, using TIP 120, correctly. The darlington is "sensitive" to your hand, which really isnt a problem . Its sensitive because it has high gain- high gain is useful for driving something like an electromagnet. Nov 12 '16 at 17:41
  • @DatHanBag, thanks! Do you have any idea what might cause the problem?
    – Himmators
    Nov 14 '16 at 15:46
  • 1
    @Himmators You may have damaged the TIP 120 transistor for some reason- since you need a dioide in the first place-as Edgar wrote above. I would start with a new TIP120 with the diode to protect it, Tie the base to ground as its says in the answer-this is important. Make sure your circuit is correct. If your base resistor is too low it wont work properly too-so try base resitor values from 10k -maybe as low as 4K will work. Nov 14 '16 at 19:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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