32 comments

[ 21.3 ms ] story [ 38.5 ms ] thread
Coincidentally I thought a class of art students just yesterday how to build oscillators. And it is not hard at all. Take a logic inverter IC (CD40106 Schmitt-Trigger Hexinverter) pick a single gate, connect the output to the input, add a capacitor from the input to ground. That is it. Three parts and you got a Relaxation Oscillator. And then you have 5 inverter gates left.. But of course one could argue ICs are cheating, since any PLL-IC would have an oscillator onboard.

Why the first two circuits fail is also pretty obvious without derper circuit analysis: to get reliable oscillation you don't only need amplification, you also need some time setting element, usually in the form of a capacitor (or involuntary capacitance).

I was hoping this would go more into startup and amplitude control, which are for me the tricky parts of building a phase shift oscillator (because you have to analyze the non-linear behavior).

I guess hobbyists nowadays are just using SI5351 and calling it a day.

Building an oscillator is "just" putting some gain around a large enough phase delay (>90deg). The challenge is in making the oscillator predictable and STABLE.

You want a frequency generator that oscillates with a constant period/frequency. Even an unbalanced oscillator can just be divided by two to provide uniformity. However, it turns out that building something that is not sensitive to any outside inputs (temperature, strain, voltage, time, etc) is really hard to do over a very wide frequency range (from ~DC to many MHz), but from that you can build a stable clock.

Look up Allan Variance, if you're looking for bit of a rabbit hole on clocks and oscillators and other sensors.

(comment deleted)
It's super easy to build LC oscillator.

I made a program that generate random topology and uses spice simulation to find if it oscillate. The goal was to find some novel LC oscillators. It worked, it found many different oscillators. I let it ran for a while and soon I found out that the simplest possible LC oscillator has 1 inductor, 2 capacitors, 1 resistor and 1 transistor. I found many different variations of it, I called this class of oscillators "LCCRT oscillator" and it also always had 2 internal nodes so that's not very large search space (40000 combinations) so I generated all possible combinations and I found out there are exactly 12 distinct LCCRT topologies.

Basically any time cap connects to a rail it can be placed to other rail as well, and any time one rail connects via resistor, the resistor can also be moved to other rail. This creates 12 possible combinations. I tested them in real life and they are stable, even used one in metal detector.

Of course it found many different topologies. Some times they were unique, other times they could be simplified into already found oscillator. It can also use multiple transistors not just one. You can find entire project on github, it is a ngspicejs script: https://github.com/dvhx/lc-oscillator-finder

Never found it hard to build an oscillator, the hard part is musical voltage per octave. 3340 repro chips are the way to go, the best non-3340 circuit I've seen is this one and it's still temperature-sensitive: https://www.youtube.com/watch?v=FiCMjt0mqvI
As someone with a CS degree and not an EE degree, this is fascinating. I tried a decade ago to build some simple RC lights controller circuit that would operate off of a PWM signal and failed. Hats off to you hardware folks. Manipulating atoms and electrons and building circuits that allow us to play games, build businesses, communicate with loved ones, and write this post.
When I was starting out in electronics I found the easiest way to build an oscillator was to build an amplifier and the easiest way to build an amplifier was to build an oscillator. I guess the trick is to be 7 years old and have far more ambition than skill. Couldn't guess at how many tries it took me to make an amplifier that didn't oscillate and when I moved onto oscillators, they never oscillated but they did amplify. In that first year or so, I couldn't actually read resistor color codes, but I thought I could.
I wish Esaki oscillator was mentioned. It's a funny bit of trickery.
One of my favorite is an RC circuit with a Schmitt triggered inverter. So simple and ingenious.
> There’s an old electronics joke that if you want to build an oscillator, you should try building an amplifier

It's funny, I was just thinking this morning about an old article in (I think) Television magazine that I read in the 80s when I was getting into electronics. The author was talking about some service notes he'd received for a particular model of Philips radio, which had just come out, and it was when shops tended to have their own service department that would repair things right there in the shop - and also, apply any "factory fixes".

One such fix was described as "Fix VIUPS", and involved changing a couple of resistors and adding a couple of capacitors. Not really any difference, but the author did think it seemed to make the amp a bit more stable and less inclined to make squealy ploppy noises at high volume when the battery was low. But, curiosity got the better of him, so he rang the Philips rep - what's this "VIUPS"?

No idea. But I'll get hold of someone at head office you can ring. Okay, what's this "VIUPS" thing? No idea, said the head office guy, but I can put you in touch with one of the factory engineers in Eindhoven.

So, a call came in, an international call! Quite a big deal in the 80s. "What's this VIUPS Fix thing in the service notes?" he asked the guy.

"Aha yes", he said in a heavy Dutch accent, "the VIUPS is the noise the set makes when the fault is present."

VIUPS VIUPS VIUPS. Yup.

What intrigued me was the "just use a microcontroller" comment at the bottom of the page - I genuinely don't know if it was pinned because it's a joke, a genius idea or just top 10 dumbest comments of 2025
Two things not mentioned - hey maybe I should blog about these myself and post them up?

The first being the "Two Transistor Metronome" that I can't even remember where I saw first - possibly Electronics Today International or Hobby Electronics, although Practical Electronics was a contender - we didn't get that one much though. I remember my dad and I building this when I was probably about seven or eight, and I've built loads since.

https://tinyurl.com/22qjecj7

It's a relaxation oscillator where the two transistors form more-or-less an SCR, which fires when its (negative-going) gate voltage exceeds its anode voltage. Kind of.

A similar circuit using three transistors and a diode is used in the oscillators in the Roland TB303 and Korg MS10/20/50 series, with a current source used to set the capacitor charging time so you get a nice linear sawtooth. Conveniently the expo converter turns an incoming control voltage into an exponentially-rising current, which is just what you need!

As the famous one-liner from EE goes- if you want to build an oscillator, build an amplifier; if you want to build an amplifier, build an oscillator.
I remember creating an oscilator by soldering a transistor onto an inductor with two windings in series with loudspeaker an battery.
> The circuit can be simplified to two transistors at the expense of readability, but if you need an analog oscillator with a lower component count, an operational amplifier is your best bet.

Well... Using a NOT (really a NAND) gate was a very classic way of generate clocks for discrete logic.

I've build a signal injector to debug a guitar pedal that was not working. It was a nice little journey in itself. The astable multivibrator produces so much harmonics that I could hear it all the way back from the input jack, where it was supposed to be silent. Heck, I could hear it just by putting the probe nearly close to the circuit. The signal pushed through the circuit like Juggernaut breaking walls. Learned a lot about filters and was able to produce a nice sine wave out of it, it worked great.
Easy negative resistance oscillator: a neon bulb in parallel with a capacitor connected to a DC power supply through a resistor.
(comment deleted)
In some reading I did several (decades) years ago, I read how the invention of the oscillator was an accident. Someone was building an amplifier, and made a wiring error that was described as connecting the amplifier's input to the amplifier's output and it produced a squeal.

Up until that time, radio frequency carriers were produced with AC Generators designed for a high-frequency (> 60 Hz) output. That is in part why it took so long for things like music to be broadcast by radio: you needed a high-frequency carrier. Generators were topping out at about 15K Hz according to the old article I read.

So once they had the accidental circuit that squealed, it was studied and expermented upon (trial and etrror modifications), and that is where all the 'classic' oscillator circuits originate.

Essentially, an oscillator is an amplifier with positive feedback. Amplifiers that are amplifiers sometimes have negative feedback.

It is hard to put into words how so many people "out there" can print things, have people read them, and they are so worded that the average person is probably reading this as "the truth".

> but it’s rather difficult to build a good analog oscillator from scratch. The most common category of oscillators you can find on the internet are circuits that simply don’t work. This is followed by approaches that require exotic components, such as center-tapped inductors or incandescent lightbulbs.

It is not hard to build a good analog oscillator from scratch, we have been doing this for decades. Secondly, while an incandescent _might_ be considered exotic, and completely unnecessary for an oscillator, a center tapped inductor is totally not exotic, and also, not really necessary for an oscillator.

As others have noted, it is simple to build a really good analog oscillator. This article is blah, and "meh" at best.

(comment deleted)
It's great to do experimentation because you get to learn a lot, but at the end of the day stick with well-studied designs if you're making a something you want to use. The oscillators mentioned below all have well known strengths and weaknesses:

The author mentions that they consider a center-tapped inductor to be "fancy," but if you consider a regular inductor to be fair game, then the Colpitts oscillator is a good choice. And I suppose you could build a Hartley oscillator with two inductors rather than one center-tapped inductor.

If you consider op-amps to be fair game even though it is made from multiple transistors, then you might consider digital logic to also be fair game and should consider a Pierce oscillator. I'm also assuming that a crystal is also fair game, but those are quite cheap.

Side note- these oscillators are all part of the exam material for the Extra class amateur radio license in the USA. If you find lcamtuf's Substack interesting, then amateur radio might be for you.