Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Control a Coil with a Transistor?

Not open for further replies.


New Member
I need to switch an an inductor (coil) on/off fast and automatically for a boost converter. So I am using a transistor with its base connected to the output of a 555 timer with a low resistor. However, as I have seen before, if a coil is connected to a transistor's collector or emitter and the transistor's base has a resistor on it, the coil with not generate a proper magnetic field. Why is this? Is there a way to do it properly? Can I connect the transistor directly to the output of the 555 without a short? Anything helps. This is probably a noob question, but thanks anyway!

Boost issues.jpg
Welcome to the forums.
You need to determine your coil current. That will be your collector current on your transistor. Knowing that you can calculate your transistor's needed base current to get the transistor into saturation (acting like a switch) for your coil. You also want a diode to serve as a flyback diode across the coil. Typically a 1N4002 or higher rated voltage diode like 1N4003 or 4004. Lastly your transistor needs to be rated for your coil current and then some overhead. So we need the transistor part number and data sheet and the coil rated current. Keep in mind a 555 timer can sink or source 200 mA at the output (pin 3). Why do you have a capacitor (or what looks like a cap) across the transistor?

Here is the diode your circuit needs:


  • voltage boost converter.png
    voltage boost converter.png
    69.8 KB · Views: 240
Oh my! I just realized I forgot to include the diode in my schematic!:oops: I do have one, thanks for pointing that out! as for the coil, by 'coil current' do you mean the current across the coil? And so would I need to supply the base of the transistor with at least that much current? Thanks for the quick replys, by the way. ;)
... by 'coil current' do you mean the current across the coil?...
No. The current through the coil.
... And so would I need to supply the base of the transistor with at least that much current?...
No. Only enough current to allow the transistor to conduct. The current through the coil is controlled by the transistor. The transistor is responding to the signal to its Base, supplied by the 555.
Only enough current to allow the transistor to conduct
Thanks!:) But that's the problem, if I have a resistor on the base of the transistor, the coil won't generate a magnetic field, even if the resistor between the output of the 555 and the the base is only 1kΩ.:mad:
Your transistor has no part number. If we guess it is a little TIP31 power transistor then its datasheet says that its current gain is about 80 at a collector current of 550mA. Then when the 555 output is high at 7.5V and the base of the transistor is 0.7V, the 1k resistor has 7.5V - 0.7V= 6.8V and the 1k base resistor produces a base current of 6.8ma. then the current in the coil for each pulse from the 555 is 6.8ma x 80= 544mA if the 9V battery is new and the coil has a low resistance.

Each time the transistor turns off, the coil produces a flyback positive high voltage that passes through the diode to the load. The coil is an inductor, not an electromagnet.
Okay, I see some little writing on the transistor: 2n 3904 I hope that helps, does anyone know why this circuit might not be working? Again, I think the problem is in the coil (inductor) is not creating a magnetic field, and thus not delivering the voltage spike to the capacitor.

Sorry in advance, I am a bit of a noob.
The maximum allowed collector current of the 2N3904 transistor is shown to be 200mA on its datasheet but at such a high current it works poorly. It conducts 100mA well when its base current is shown to be about 100mA/60= 1.7mA or more. The base current is (9V - 1.5V - 0.7V)/1k ohms= 6.8mA. The coil voltage will be at most 8V and the coil will have a current of 100mA if the coil impedance is 8V/100mA= 80 ohms.

What are the inductance and resistance of the coil? What material is the core of the coil? What is the frequency of the 555?
The resistance is REALLY low, and I don't know its inductance, It is just around 50 winds around a nail, maybe more winds but not to many. Both resistors for the 555 are 3.3kΩ, the capacitor fr the 555 is 22uF. So it does not oscillate all that fast, this is a test setup and if it works I will go faster.
If your 5V supply can provide about 1A then your circuit has probably burned out the transistor with a current much too high for it.
50 turns of wire wrapped around a nail makes a very poor inductor. Also the frequency was very low. Then the output of the diode might be a short duration voltage spike a few volts higher than 5V and an average voltage of 5V or less if loaded.
Last edited:
The OP needs to do a bit of reading on how boost converter topology works.

Regarding coil saturation, coil heating, transistor heating and such performance criteria you must consider the matter of 'dwell' time to charge the coil to obtain peak back emf performance without wasting energy due to coil saturation. Note that the coil ohmic resistance is not at significant play unless the coil has saturated (by too long a charge pulse). By shortening the pulse length the peak current seen by the coil and hence the transistor can be controlled. Have a look at the function of pin 5 on the 555 timer to control pulse widths etc.
My very cheap solar garden lights use an IC that conducts the 1.2V battery current through an inductor to ground then produces a spike of high voltage each time the IC turns off during its oscillation. The spikes light a 3.2V white LED. They use a Schottky diode feeding a filter capacitor to power the IC in a colors changing LED.


  • solar garden light9.png
    solar garden light9.png
    696.5 KB · Views: 133
Okay, if I make the frequency higher, I will use a Schottky diode. :) But, I think I made a mistake when I included the boost converter example, that was not really what my question was about. I was wondering, simply, how to control an inductor with a transistor. Do I need a resistor on the base to avoid a short, because I tried that and it did not 'induct'. Any help on THIS would be great.
When you say 'control' an inductor it is unclear. Inductors have many uses. Even a bit of straight wire is an inductor and can be used as such.

You must have an end goal that requires an inductor and then you can determine how to specify it and use/control it.
Okay, I want to turn on and off a coil's magnetic field without using a manual switch. Will this schematic turn on the magnetic field when the input is high? If do, what value resistor should I use?
You must learn about the basics of transistors to do anything with them.

ALL transistors have a part number and a detailed datasheet listing maximum allowed voltages and currents and listing its current gain. Your latest circuit shows a PNP transistor with no part number as an emitter-follower (your previous circuit used an NPN transistor as a common-emitter switch) then it conducts when the input is low (0V), not high. When the transistor is turned off then the voltage spike produced by the inductor will destroy the transistor. The value of the base resistor is determined by the supply voltage and how much current the unknown transistor can produce with the unknown current in the resistor. Hey, an emitter-follower transistor does not even need a base resistor.
Go download LTspice, play around with what if designs, then try to build one. Be sure to look at the you tube videos on using LTspice to determine power dissipation on the components used and their voltage & current limits. Make sure everything is under 75% of the rated specs for operation and you should be ok for such a simple switching circuit.

Apart from that, understanding using transistors as a switch is important knowledge as well as selecting and sizing the different types of transistors.
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips