Problem with Running an Electromagnet with Arduino & Transistor

Hi there,

Okay, so I'm trying to run an small electromagnet, but I've discovered that the Arduino doesn't supply enough amps to run the magnet with enough force. So, I hooked up my electromagnet to a 9V battery, and am trying to use a transistor to allow the Arduino to control the electromagnet. However, when I try to apply power to the transistor using one of the Arduino's I/O ports, nothing happens, but if I connect the transistor to the 5V then it works just fine.

Is there something that I'm doing wrong here?

GreenPhorge:
Is there something that I'm doing wrong here?

Difficult to say, without seeing the circuit diagram and the code.

Assuming NPN and load on the collector, is the emitter hooked to the Arduino ground?

Hi, 9V battery, not the little square/rectangular one that fits in the smoke alarm?
If so, it supplies even less power than the arduino can.
Do you have any specs on the electromagnet?
Tom..... :slight_smile:

Here’s a diagram of my circuit, I think the emitter should be grounded. The electromagnet is just a coil of wire wrapped around a drinking straw.

TomGeorge:
If so, it supplies even less power than the arduino can.

As in how much less? When I hooked the Arduino directly to the electromagnet, nothing happened, but when I connected the 9V, it actually worked.

CircuitDiagram.png

Here's a diagram of my circuit,

No that makes no sense at all. How about a real schematic?

You should have a resistor in the base, the other end going to the arduino.
You should have the emitter to ground.
You should have your electro magnet connected to the collector and the +9V terminal and you should have the -ve terminal from your battery connected to the Arduino's ground.

The electromagnet is just a coil of wire wrapped around a drinking straw.

Then the 9V battery will last about three minuets before it is flat.

Express sketch is a free schematic drawing program that is pretty easy to learn. Attached is a schematic of how one would wire the circuit. You will need a better power supply that the small 9V battery. The diode is necessary to prevent the high voltage from the electromagnet from damaging the transistor when power to the electromagnet is removed. What is the resistance of the coil. You may need to limit the current through the coil if the coil resistance is too low.

EM DRIVER.jpg