I see many circuits in which transistors or MOSFETs are used as "automatic" on and off switching devices. This on and off switching creates an oscillating signal. Can somebody explain how a MOSFET can oscillate up to many hertz without outside interference?

An example would be the circuit of a joule thief. How is it possible that you use a couple of resistors and MOSFETs and make a pulsating signal?

I want to add a circuit as an example so somebody could maybe explain how the MOSFETs in this inverter cycle work and how they manage to turn on and off. It transforms 12 V DC into alternating current.


simulate this circuit – Schematic created using CircuitLab

  • 6
    \$\begingroup\$ There are many, many, many tutorials on oscillator circuits on the Internet. I suggest that you read some of those and then come back and ask a specific question on a part that you don't understand. As it stands your question is asking us to write an article for you to save you doing your research. \$\endgroup\$
    – Transistor
    Jun 9, 2020 at 20:06
  • \$\begingroup\$ In the so-called "relaxation oscillators", RC circuits are used to produce voltage that changes through time. Transistors are used to "automatically" reverse its direction at the ends. Thus the voltage wiggles between two levels and transistors pulsate. A typical example is 555 timer. \$\endgroup\$ Jun 9, 2020 at 20:06
  • 1
    \$\begingroup\$ @abdussamed17 There are many of those too and some ways are completely different than other ways. Making a low power sinusoid is very different than making a high power sinusoid. \$\endgroup\$
    – DKNguyen
    Jun 9, 2020 at 20:53
  • 2
    \$\begingroup\$ en.wikipedia.org/wiki/Joule_thief#Description_of_operation \$\endgroup\$
    – Janka
    Jun 9, 2020 at 20:54
  • 1
    \$\begingroup\$ @awjlogan, Now it looks very well:) Thanks for the efforts! \$\endgroup\$ Jun 11, 2020 at 13:12

4 Answers 4


What you are asking about is oscillation. It's a very broad subject and spans everything from mechanical oscillators (like a "grandfather's clock's pendulum and escapement mechanisms tied to its gearing to the clock face) to crystal oscillators to simple relaxation oscillators (both flyback and astable), which also have a mechanical equivalent. A comprehensive view of the entire topic would occupy many books.

But we can pick on exactly the case you mention -- the so-called "Joule thief" circuit found in many different incarnations. The simplest form is something like this:


simulate this circuit – Schematic created using CircuitLab

The left side is closer to how you'd build it. You fold a wire in half and then thread it through a toroid core, building a "counter-wound auto-transformer" of sorts. It will have three contacts, which include both original ends of the wire plus a third contact where you folded the wire before making the transformer. Also, if you follow the usual instructions for making this transformer, the inductance of \$L_1\$ equals the inductance of \$L_2\$.

The right side is closer to a schematic representation designed to understand how the circuit works. Note that all I've done is some modest re-arrangement. It's still the exact same circuit as on the left. Nothing has changed. But it is easier to use the right side when explaining how it works.

Note the dots. This is important for understanding how it works.

When the battery is first attached, the currents all start out at zero. Since there is no current just yet, the voltage drop across \$R_1\$ is also zero. So initially, the battery voltage, less the \$V_\text{BE}\$ junction voltage, appears across \$L_2\$. But while \$L_2\$ does momentarily resist a too-rapid change in current, it does allow change to occur. Within a very, very short time the battery voltage, less the \$V_\text{BE}\$ junction voltage, appears across \$R_1\$ and this supplies some base current to \$Q_1\$, turning \$Q_1\$ on.

Once \$Q_1\$ is on, its collector pulls down hard on \$L_1\$, turning the LED off and causing the full battery voltage (less a small \$V_{_{\text{CE}_\text{SAT}}}\$ for \$Q_1\$) to appear across \$L_1\$. This battery voltage across \$L_1\$ causes the collector current (and the current in \$L_1\$) to rise rapidly but at a controlled rate. So the current ramps upward in \$L_1\$ and in the collector of \$Q_1\$.

If you ignored \$L_2\$, the base current will be something like \$I_{_\text{B}}=\frac{V_{_\text{BAT}}-V_{_\text{BE}}}{R_1}\$. But, because \$Q_1\$ has turned on, there is now almost the full battery voltage across \$L_1\$. The transformer behavior causes the same voltage to appear across \$L_2\$. And here, the dots become important. The more positive end of \$L_1\$ is where the dot is at. So the more positive end of \$L_2\$ will also be where its dot is at. So that point is more positive than the battery voltage. This is very important to its function for a variety of reasons: (1) it boosts the battery voltage providing still more base drive current; and, (2) it adds "positive feedback" that reinforces the on state of \$Q_1\$. So the actual current in \$R_1\$ will be more like \$I_{_\text{B}}=\frac{2\cdot V_{_\text{BAT}}-V_{_\text{BE}}-V_{_{\text{CE}_\text{SAT}}}}{R_1}\$. And that fact will keep \$Q_1\$ on for a somewhat longer time.

Eventually, one of two things happens. Either the transformer's toroid core saturates, leading to an extremely rapid change in \$L_1\$'s current and quickly exhausting the \$\beta\$ current gain of \$Q_1\$, or else the \$\beta\$ current gain of \$Q_1\$ is exhausted before the toroid core saturates. Either way, \$Q_1\$'s \$\beta\$ current gain is exhausted and \$Q_1\$ (even with its enhanced base current) can no longer support the ever-increasing current that \$L_1\$ "wants" when a fixed-voltage is applied across it.

At this point, \$Q_1\$ goes out of saturation and goes into active mode. It does this by relaxing its grip on its collector, allowing the collector to float. \$L_1\$, however, won't have any of this. It was quite happy before increasing its current rapidly and it already now has a high current in it which it demands will continue. Just the same, \$Q_1\$ is done with this and allows the voltage at its collector to rise back upwards. That drops the voltage across \$L_1\$ a little, but even with a smaller voltage across \$L_1\$ it only means a smaller increase in \$L_1\$'s current. But increase it still means. But \$Q_1\$ can't increase. It just can't. So the collector voltage goes still higher and higher, trying to stop the increase. But \$L_1\$ doesn't care. The only way the current in \$L_1\$ can decline is if the voltage across \$L_1\$ flips over and changes sign. Which is exactly what happens. The voltage at the collector of \$Q_1\$ rapidly flips and becomes higher than the battery voltage, so that the sign of the voltage across \$L_1\$ can change.

Now, \$L_1\$ still has all that current in it which has to go somewhere. Guess what? There's that handy LED over there! That looks like a good place to dump that current. So the voltage rises at the collector of \$Q_1\$ until the LED turns on. Now, this is a white LED and it probably needs something like \$3.5\:\text{V}\$ to operate. Well, \$L_1\$ has no trouble helping out there. It immediately modifies the voltage at the collector such that the LED can in fact turn on and accept the inductor's current.

But this also means that the voltage across \$L_2\$ flips over, as well! Remember, this is a transformer. \$L_2\$ was, previously, adding voltage to the battery voltage to help increase the base current. But now, because \$L_1\$ reacted so quickly to reverse its voltage in order to dump current into the LED, it also reverses the voltage across \$L_2\$, too. (It can't help doing that.) Now, this means that \$L_2\$ subtracts from the battery voltage and basically turns \$Q_1\$ completely off.

There's a moment we missed, here. That's just at the place where the collector voltage is rising up, but the voltage across \$L_1\$ hasn't quite reversed itself, just yet. As the collector "lets up" and floats upward, there is a diminishing voltage across \$L_1\$. This diminished voltage across \$L_1\$ yields a similarly diminished voltage across \$L_2\$ (transformer action.) That leads to a lower base drive current in \$Q_1\$. Which means that \$Q_1\$, which was able to handle more collector current beforehand, can handle just that much less collector current. Which means the collector has to rise still further as \$Q_1\$ approaches being turned off. \$L_1\$ is very unhappy with change in \$Q_1\$, too, and reacts. If the current in \$L_1\$ can't increase, and can't even stay the same, there is only one response possible -- the magnetic field must start to collapse. The moment this takes place, the voltage across \$L_1\$ reverses itself, the collector voltage rises above the battery voltage, the voltage in \$L_2\$ also reverses itself and greatly reduces the base current towards zero, and this whole process rapidly feeds on itself. Very quickly \$Q_1\$ is turned completely off.

Now that \$L_1\$'s magnetic field is collapsing, it's current can decline as it drives current into the LED. Eventually, the magnetic field energy has completely collapsed to zero and no more current is possible. At this point the voltage across \$L_1\$ returns to zero, the voltage across \$L_2\$ also returns to zero, and now \$R_1\$ can supply a starting base current needed to turn \$Q_1\$ back on, which then places a voltage across \$L_1\$, leading to a supporting voltage across \$L_2\$ that increases the base current, again, and the cycle repeats itself another time.

This whole process takes time as it stores increasing energy in \$L_1\$. However, eventually, the BJT cannot continue to support those increases in the magnetic field and then the magnetic field must collapse. This collapse is used to turn the BJT off and drive current into the LED. When the stored energy in the magnetic field is exhausted, the process repeats.

So one of the keys is the temporary storage of energy "somewhere." This can be done by temporarily storing energy in magnetic fields (inductors), temporarily storing energy in electric fields (capacitors), or both. You can slosh the energy back and forth between magnetic and electric fields, too (tank circuit.) But you need a place to temporarily store energy. That's one of the keys. With that key, plus a way of providing sufficient positive feedback to keep things from finding a "quiescent point" in some halfway-place, gives you an oscillator. The trick, as always, is working out good ways to achieve both in a simple circuit.

  • \$\begingroup\$ jonk i appreciate your effort for helping but i would be glad if someone could provide a simpler explanation of why a turned on transistor should turn itself of again? where does the electricity on the gate go and why does it appear and disappear? maybe a one sentence solution would be very helpful. \$\endgroup\$ Jun 9, 2020 at 21:30
  • 2
    \$\begingroup\$ @abdussamed17 It doesn't get much simpler. But I'd love to see someone write a better description of the behavior. Perhaps someone will. I'd enjoy seeing it. That said, please see my last paragraph. Perhaps that's all you wanted to see. \$\endgroup\$
    – jonk
    Jun 9, 2020 at 21:44
  • \$\begingroup\$ @abdussamed17 a transistor can not "turn itself off and on." If a transistor is continually turning off and on, that's because of its interaction with other components in the circuit. In any kind of oscillator circuit, besides one or more transistors, you will also find at least one component that has time dependent behavior. Often, a capacitor. Sometimes, an inductor, or a crystal, or a combination of two or more time-dependent components. And also, there will always be some "feedback" path, that brings a time-shifted version of the transistor's output back around to its input. \$\endgroup\$ Jun 9, 2020 at 21:59
  • 1
    \$\begingroup\$ The grammar and sentence structure of your answer is top-notch. \$\endgroup\$ Jun 9, 2020 at 23:34
  • 1
    \$\begingroup\$ @Circuitfantasist Blocking oscillators are used all the time. May as well get used to it. They are in camera flashes, emergency beacons, etc., etc. Cheap and just work when you need them. Not the most efficient devices, I'll grant. (I mentioned here that I went to Barrie Gilbert's funeral. I suppose you saw that.) \$\endgroup\$
    – jonk
    Jun 10, 2020 at 22:18

Simple explanation to most cases, while not for the example circuit, as that was already covered: a) A delay circuit changes the output from one position to another. Often achieved with RC-circuit.

b) Slow feedback loop, where output of an amplifying circuit feedback loop lags 180 degrees out of phase at certain frequency. Meaning that when the output is at "maximum", the input has gone back to "minimum" and the amplifier over-corrects and ends up in opposite situation.

  • \$\begingroup\$ Interesting... Maybe a) describes relaxation oscillators and b) describes RC oscillators. It remains only to add c) - LC oscillators. I have a good intuitive notion about a) and c) but I can hardly imagine b). \$\endgroup\$ Jun 11, 2020 at 20:20
  • \$\begingroup\$ RC or LC could be used in either one. It's more about the principle, not the components used. It could be something mechanical too, intentional or not ;) \$\endgroup\$
    – Ralph
    Jun 12, 2020 at 21:38

I think it will be easier to understand if you flip the circuit to get the configuration as shown below, which shows two transistors connected in a feedback loop.


simulate this circuit – Schematic created using CircuitLab

For simplicity, first let's first break the feedback and see how the circuit would behave. If the circuit is broken at the input of transistor M1, the resulting circuit looks like as shown:


simulate this circuit

Now, suppose the voltage at the input of M1 (node A) rises. This implies a higher gate-source potential across M1 and consequently a higher drain-to-source current (\$I_{DS1}\$) through it. This increase in the \$I_{DS1}\$ would result in reduction of the potential at the drain node of M1. Thus, increase in the gate potential resulted in reduction of the drain potential and we can say that the gate and the drain potentials are \$180^{\circ}\$ out of phase.
Since the drain of M1 is connected to the gate of M2, reduction in drain potential of M1 implies gate potential of M2 also reduces. Using the same reasoning as above, it implies that the drain potential of M2 goes up.
Since the drain potential of M2 (node B) goes up when gate potential at M1 (node A) goes up, these potentials are in-phase or \$360^{\circ}\$ out of phase.
Now, imagine we have a pulsing voltage source connected at node A. The output at node B is expected to be exactly same pulse as at node A (just phase shifted by \$360^{\circ}\$). Thus, if you remove the voltage source and connect the node B to node A the circuit would not know the difference. It would now begin to generate the pulsating output on its own, without any external voltage source. The circuit is said to be in oscillation.

A little extra Detail
Note, to keep the explanation simple, I have glossed over some details. But just to be complete, the phase difference between the gate and drain of transistor is not always \$180^{\circ}\$ as it depends on the frequency of operation. But in this case, the inductors will be tuned such that they cancel the capacitance at the drain giving over-all \$180^{\circ}\$ phase shift at the oscillation frequency.

  • \$\begingroup\$ If this is true, we should expect sinusoidal oscillation. So far, two hypotheses have been formed - relaxation and sinudoidal oscillation. \$\endgroup\$ Jun 11, 2020 at 15:55

OP does not know how this MOSFET circuit works... I do not know it either (I am not a big fan of power electronics). The only differences between us is that I have some experience in understanding circuits. So we both have a unique chance to try to figure out this completely new (for us) circuit.

My appeal to all of you who know how the circuit works is to wait at least a few hours for us to try to understand it for ourselves... and only then explain it.

Just a few words about the "technology" of the experiment... I will start the unraveling by trying to see elements and circuit building blocks we already know. OP and you can do the same. I have nothing against to edit my answer by inserting your guesses so that it becomes a collective work (like a wiki).

It would be a unique experiment in SA EE. Do you agree? If so, let's begin...

OK, let me show what I mean to do...

Looking at the circuit, of course, first we can see separate elements - transistors, resistors and inductors (coils of a transformer). Each of them has some specific function here. Let's see what...

We know the resistor can act either as a voltage-to-current or current-to-voltage converter. The inductor (½ coil between 3-4 or 4-5 ends) can act either as a voltage-to-current integrator or current-to-voltage differentiator. MOSFET acts as an active voltage-to-current converter.

This was about the functions of the separate elements. But we see they are grouped into sub-circuits. So, we can recognize well-known sub-circuit solutions in this otherwise unknown circuit. Let's see what they are…

First, in the combination of two (470 ohm) resistors in series, we recognize the ubiquitous voltage divider. It has an input and output... and acts as a voltage-to-voltage converter (attenuator, scaler). We discern two identical voltage dividers here with gain (transfer ratio) of 0.5.

Then, we see that, with the help of the voltage dividers, a strange cross-connection is implemented - the drain of the one of transistors is connected (through the first voltage divider) to the gate of the other… and the drain of the latter is connected (through the second voltage divider) to the gate of the former. What could be the purpose of this strange topology?

There are still no people willing to get involved in this exciting adventure - understanding the unknown OP's circuit. So I will have to continue alone…

There is something familiar in this cross-connected pair of transistors... Let me think a little more…

But, of course, this is a transistor latch! It is drawn as a cross-coupled pair of two transistors (with voltage dividers at the input) but to realize its idea, would be more useful to see that these four stages are cascaded in a loop. The transistors act as inverters (a property of this common-source configuration). So, they form a non-inverting amplifier whose output is connected to its input. As they say, there is positive feedback… and the circuit can memorize.

Static RAMs (SRAM) contain thousands and millions of such memory cells… and it is interesting, for our purposes, to see how they are driven. To our great surprise, we find that they are "brutally" driven. Let's see why.

The cell has two states, for each of which one of the transistors is on and the other is off. Figuratively speaking, the "on" transistor is just a piece of wire. To toggle the latch, in SRAM they "pull up" the drain by connecting it to VDD. What does it mean? It simply means "short connection"... but only in the first moment. And since VDD is strong enough, the transistor is still toggled.

So, the conclusion is that our MOSFET latch can be toggled by "pulling up" the drains (temporarily connecting them to VDD). We can do it by "pull up" elements connected between the drains and VDD...

It seems that understanding circuits in such a heuristic way is a thankless job if no one is willing to do it… But I will...

Well, we need "pulling up" elements in the drains… But there are such elements in the circuit diagram… and they are the halves (3-4 or 4-5) of the primary coil of the transformer. They are inductors; then let's remember what the inductor behavior is...

When applying voltage to an inductor, in the beginning the current is zero… then it begins increasing linearly (integrator). Finally, the current is maximum and limited only by the low wire resistance. As though the inductor act as a switch that is initially open and finally closed.

Here is the secret of the self-commutating - it is implemented by the coils. Let's see how.

A pair of "pulling up" and "pulling down" elements (a transistor and an inductor) is connected to each drain. Imagine that one of transistors becomes on. Its inductor begins charging… and the current through it is gradually increasing. While the inductor is not completely charged, the transistor "pulls" the drain voltage down to ground.

Finally, the current becomes maximum. The coil (more precisely, VDD) begins "pulling up" the drain and, as it is stronger than the transistor, it wins this "arm fighting"... and the latch is toggled. Now the other transistor becomes "on" and its inductor begins charging. After some time, it "pulls up" the drain and the latch is toggled again in the previous state… and so on and so fort...

But a new question arises, "How do the inductors discharge when the transistors interrupt the current through them?"

Obviously, the only possible current path is through the voltage dividers. Yeah, that is why their resistors have low resistance...

More questions arise, "Why at all we need voltage dividers? Cannot we replace them with humble resistors?"

It would be possible, if MOSFETs were BJTs. Then the coil discharging currents would pass through the forward-biased base-emitter junctions (I know this trick from the classic BJT multivibrator). So, BJT implementations of this circuit could contain only base resistors instead voltage dividers.

Finally, let's say in simple words what is this circuit and how it works:

The circuit is an inductive multivibrator. It is implemented by an RS latch driven by two inductors acting as integrators. They alternatively toggle the latch by "pulling up" the drains.

This is how MOSFETs "pulsate" in this circuit...

  • 2
    \$\begingroup\$ This isn't actually an answer to the question. \$\endgroup\$
    – Simon B
    Jun 10, 2020 at 7:27
  • \$\begingroup\$ Actually the last part you mentioned is very interesting. So it is called self commutating. The self commutating effect has to be explained in more detail and is the key feature of the joule thief circuit. \$\endgroup\$ Jun 11, 2020 at 1:43
  • \$\begingroup\$ @abdussamed17, I have used "self-commutating" in the sense of "self-oscillating" or simply "oscillating". As others here said, there are many techniques to make a constant quantity change periodically. Your circuit belongs to the large group of the so-called "relaxation oscillators". They are based on an intuitive idea that can be seen everywhere around us (swimming in a pool, ping-pong and tennis game, city transport, all sorts of temperature regulators, etc.) In all thеsе cases, something moves from one point to another and vice versa... \$\endgroup\$ Jun 11, 2020 at 7:01
  • \$\begingroup\$ @abdussamed17, ...In most electronic oscillators, the voltage across a capacitor "moves" (i.e., changes) between two voltage levels aka thresholds (e.g., 555 timer). When it reaches the high threshold, its direction of change is reversed and it begins "moving" towards the low threshold… and so on, and so forth… Note that there is a need of memory to keep the direction of the "movement". In the so-called "multivibrators", two separate time-dependent elements (capacitors) are used for each direction. Your circuit belongs to this group but here the current through a coil "moves"... \$\endgroup\$ Jun 11, 2020 at 7:03
  • \$\begingroup\$ @abdussamed17, Now a few words about my story. It was a unique experiment because of a few reasons. You were unfamiliar with oscillators and were willing to think about ideas instead of using well-learned clichés like most people. Your circuit was completely new for me… and I decided to figure it out on my own. Then it occurred to me to involve my peers here in this initiative ... but as you can see, it didn't work out. So I had to finish it myself. Fortunately for me, I had successful insights and reached the end... \$\endgroup\$ Jun 11, 2020 at 7:29

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