DC-DC converters are hard, but fun. The basic concept is that when you put current through an inductor for a while, then disconnect it, you get a big voltage spike. That's a classic auto ignition system. You can put that spike through a diode and use it to charge a capacitor to get DC out. The neat thing about switching power supplies is that there's very little resistance in the power path. That's why the efficiencies are so good. The not-neat thing is that they are a dead short across the input for part of the cycle, which is why failures can cause fires and why you may need an inrush current limiter and/or a fuse.
There are boost converters, buck converters, and ones with transformers. With a transformer you can isolate the input from the output, which is mandatory for safety if you're driving the thing from the AC power line.
Here's one of mine. USB 5VDC in, 120 VDC out, to operate antique teletype machines that need 60mA 120VDC.[1] The basic circuit is simple, but there are multiple surface mount ferrite beads and small capacitors to keep the spikes from coming out via the input USB, output, or as RF. LTspice simulation was needed to pick the values for those, so as to minimize noise in both voltage and current.
> The basic concept is that when you put current through an inductor for a while, then disconnect it, you get a big voltage spike.
That's actually usually not true, as the vast majority of DC to DC converters are step-down converters: you do not want the voltage to spike. And in general, it isn't really a "spike".
A better way to think about what is happening is that passing a current from a power supply through an inductor transfers energy into the magnetic field. When you stop doing that, the magnetic field diminishes, transferring energy back into current. But this time, you direct the current into the circuit.
The trick is that by picking the timing and other parameters correctly, you can pick the voltage of the downstream current. Specifically, you can do this because the voltage across the inductor is a function of the slope of the strength of the magnetic field around the wire in the inductor. Pick a different slope, and you can pick a different voltage. Since you usually want a stable voltage, the graph of the magnetic field strength will be (roughly) a sawtooth, and the graph of the induced voltage will be (roughly) a square wave (I am simplifying here for understandability!). A sawtooth shape has a consistent current slope, which leads to a consistent voltage.
This brought back a great memory from my childhood. When I was a boy, in fourth or fifth grade, my dad showed me how to give my friends an electrical shock with a transformer and a 9-volt battery.
I made the design my own by mounting the transformer to a 4x4 piece of scrap plywood, and then cutting out two square 'finger pads' from a tin can, and screwing those into the plywood also.
Add in some wire, a switch, a battery, and a little patter, "place your two fingers on the shiny pads and this will make music....using your mouth as the speaker" and your parents get a call from the principal.
Honestly, I always thought I was the only one who did this. My dad was a practical joker with a sense of humor that only he understood.
My dad died last February. This was a wonderful memory that made me smile. Thanks Hacker News for two memories in a weeks time!
My cousins did this to me as a kid. I thought it was great that a little battery could give such a huge jolt simply reversing the input side of a step down transformer to the output side.
As kids we had rudimentary knowledge of what a transformer did since our country used 220v but most of our electronics came from the U.S. and needed a step down transformer.
...and it really is a pretty good jolt if I remember correctly. After reading this post I considered rebuilding my project and showing it to my wife....but that's probably a bad idea lol.
DISCLAIMER: Described for entertainment value only. Some details omitted. Don't try this at home!
That energy transfer makes an “interesting” party trick.
Get the step up/down winding transformer from an old CRT TV. Get rid of other components*, and wire it with a 9 volt battery on one side, and connect the other with + to conducting surface on three sides of a box with - to the three opposing sides. Put a switch on the underside that opens the circuit.
To pick up a box generally requires touching two opposite sides. Opening the circuit dumps the field into the person picking it up who gets a momentary jolt.
It's enough to run through multiple people: hold hands in a ring of 2 - 10 people, and have two people at ends of the ring each press an opposite side of the box and pick it up, the whole ring gets the jolt!
As a grade school science experiment, have the experiment display say something along the lines of "Guess the weight" so people pick up the box and get a surprise.
This is sort of a single vibe (the switch opening) of a vibrator-transformer-rectifier transformer, to collapse the magnetic field that dumps into the still "closed" side through the person picking it up. No rectifier since it's not AC, it's just C. So the same principle, without the rest of the parts.
* WARNING: Don't look up the rest of the owl. Don't build this. Don't try this. Don't let anyone touch this.
Way, way back, when I was in fifth grade, my dad (who was part owner of a car repair shop) brought an ignition coil (the old kind, that was connected to a distributor for the spark plugs) into the classroom, and I guess a 12-volt car battery. All 25 of us students held hands in a large circle and got the jolt. this was part of the teacher's ongoing study of electricity, which also involved winding wire around a hollow cardboard cylinder to make a magnetizer/de-magnetizer tube.
(Wasn't it great learning in an age before cars had seatbelts, before push mowers had kill bars, and when nothing had warning labels?)
I was mostly tongue in cheek about the danger above, as the most dangerous step would be relieving a previously functional CRT of the transformer block. The CRT discharge can kill you.
Using an ignition coil should work (I didn't try it) and is likely safer to source if you're getting it from something assembled instead of from a used parts bin.
As for the rest of the owl, this is from memory, nearly half a century ago, so, yeah, disclaimers:
---
# How to Build a Prank Shock Box for a Science Exhibit
This fun project will surprise your friends with a harmless electric shock when they pick up a prank box to guess its weight. Here’s how you can build it and how it works.
## Materials:
- 9-volt battery
- Step-up transformer (designed to increase voltage)
\_ consider a flyback transformer from old CRT or auto ignition coil, talk to circuit electrician expert
- Switch (spring-loaded or pressure-based)
- Wires
- Small box (to hold the circuit)
- Electrical tape
- Conductive foil or metal strips for accessible sides of box
## How It Works:
This circuit uses a step-up transformer coil to generate a small electric shock when someone picks up the box. While transformers typically work with alternating current (AC), here you use direct current (DC) from the 9-volt battery. The trick happens when the circuit opens as the box is lifted, causing the transformer’s magnetic field to collapse and induce a voltage spike.
When the box is lifted, the switch opens, cutting off the current from the battery. This sudden interruption collapses the transformer’s magnetic field, generating a quick, harmless jolt.
## Steps to Build:
1. Assemble the Circuit:
- Connect the 9-volt battery to the primary side of the transformer, with a switch in between. The switch should stay closed when the box is at rest and open when it’s picked up.
- Wire the secondary side of the transformer to two sets of exposed contact points on the outside of the box: one set connected to the positive side and the other set to the negative side of the transformer.
2. Add Conductive Surfaces:
- To make it more effective, cover three sides or faces of the box with conductive material (like aluminum foil or metal strips) connected to the positive output of the transformer. Then cover the opposite three sides with conductive material connected to the negative output of the transformer.
- When someone picks up the box, their hands will naturally touch both a positive and negative side, allowing the shock to pass through them.
3. Install the Switch:
- Position the switch on the underside of the box so that it opens when the box is lifted. You can use a spring-loaded or pressure-based switch that triggers when the box is moved.
4. Test the Circuit:
- With the box resting, the current will flow through the transformer, building up a magnetic field. Once someone lifts the box, the circuit breaks, causing the field to collapse and induce the shock.
5. Secure the Box:
- Place and affix all the components securely inside the box, bringing your two wires through the sides and making sure the exposed contact points are positioned on opposite sides of the box. Tape down any loose wires.
## Science Explanation:
This project uses Faraday’s Law of Induction, which states that a changing magnetic field induces voltage. The transformer converts the collapsing magnetic field into a brief, high-voltage spike, delivering a small shock to whatever is completing the high side circuit when the low side circuit is opened. Although transformers usually work with AC, you’re using the moment when the DC current stops to mimic that effect.
The conductive material on the box ensures that when someone lifts the box, their hands make contact with both the positive and negative sides, completing the circuit for the jolt.
## Safety Note:
When done correctly, this project delivers a tiny, harmless jolt, similar to static electricity. Always use low power, an appropriate transformer, and avoid using higher voltages or currents. Consult with a TV repair expert or similar on your design before starting. DO NOT TOUCH ASSEMBLED CRTs. Let the TV repair person do it. She'll have parts anyway.
> A better way to think about what is happening is that passing a current from a power supply through an inductor transfers energy into the magnetic field. When you stop doing that, the magnetic field diminishes, transferring energy back into current. But this time, you direct the current into the circuit.
That's not my understanding of how down-converters work.
Rather, there's a big fat output capacitor that the load is connected to, and you keep topping off its charge with a MOSFET gated by a feedback loop that monitors the capacitor's voltage and actively adjusts the PWM duty cycle to keep the capacitor charged at the desired voltage regardless of what the load does. If you your input is 100V and your desired output is 10V, you just keep charging a capacitor to 10V, disconnect when it gets to 10V, and keep repeating that at hundreds of kHz, faster than the load can appreciably drain the capacitor. Inductors and diodes are "optional", but added to absorb current spikes. Their main principle doesn't rely on induction though.
Boost converters, on the other hand, rely on inductors to achieve higher output voltages than the input.
That voltage spike only applies to flyback converter. Your typical buck/boost converter doesn't do that - the current waveform is a sawtooth, and voltage ripple is designed to be in the mV range.
DC-DC converters are not a "dead short across the input for part of the cycle" in normal operation - rather the voltage is across the inductor. If the switch stays on too long and the inductor reaches its saturation current, or one of the many other (cascading) failure modes, then can you end up with effectively a short across the input. This can happen to many kinds of electronics (eg a simple tantalum decoupling cap, or an IC's SCR latchup), but designing the power topology is a good place to think about these failure modes.
(Although going 5V->120V with USB as the power source, I can understand how "dead short" was a decent intuition)
> DC-DC converters are not a "dead short across the input for part of the cycle" in normal operation - rather the voltage is across the inductor. If the switch stays on too long and the inductor reaches its saturation current, or one of the many other (cascading) failure modes, then can you end up with effectively a short across the input.
Right. Which is why under-designed AC-line powered power supplies can catch fire.
The failure mode of MOSFETS is usually to the "on" state, so the switch staying on is quite possible.
Sure, I don't see how FETs having a common failure mode of passively conducting is exceptional though? You've got to design (and test) for likely failure modes. Like even if you use a linear regular, you should be thinking about what happens when there is a short downstream.
The problem with fires isn't the type of circuit per se, but rather that anything connected to the mains can unleash a significant amount of power. And that designing/building for safety increases cost, for additional components or even things like larger PCB area for creepage. We basically take a lot of the work that goes into electrical safety for granted.
This is known as a charge pump, and is the third concept described in the linked article. The article only mention one flying capacitor, but you can use more than one and connect them in series to get a higher multiple of the input voltage.
The high voltage version of that is called a Marx generator. The Museum of Science and Industry in Chicago used to have a million volt Marx generator made by General Electric. The parallel to series switching was mechanical. The "crack" when it fired echoed through the whole building.
I know exactly what you're talking about! I used to go there so often as a kid and definitely remember the crack. (Also nearby was that exhibit where you could perform electrolysis on some water. It had a "push to start" button that was activated by touching some glass with a button outlined by a red decal. I still don't know how that works.)
Something else stuck in my head from that museum was the Operation Lifesaver displays around the model train exhibit. I think my dad was a little freaked out by how many times I wanted to watch the video of the train hitting a car.
Honestly, I'm a little disappointed every time I visit a museum because of how much fun I had at MSI as a kid. I think a lot of that was from being a kid, but ... good museum.
I don't think a dead short for part of the cycle is the right way to think about it. The inductor has a bunch of impedence unless the switch fails.
You might be doing a short through some parasitics for a bit, but in the ideal case, you're not.
The new chips typically do soft start on their own, the problem is you need input caps, which really are a dead short when first connected.
Which wouldn't normally be an super big issue with small ceramic capacitors, except the cable inductance forms an accidental boost converter that wants to give your actual converter a voltage spike.
I think of it as synthesizing a sine wave (AC power) with DC pulses, using an inductor or capacitor for smoothing. The result is then rectified back to DC.
I see you made a current limiter from a mosfet + resistor. I wonder if there are ready-made components that do the same, and also monitor overheating. Maybe not necessary in this case (because you're only limiting the inrush current, not a continuous current). There are current-limiting diodes but as far as I've seen they are only available for smaller currents.
Oh, you mean Q2-R5 in [1]? That was a late addition, and yes, it's a linear current regulator using a depletion-mode MOSFET. I did that because I didn't want to change the board layout much and it only took two components. Others have built this device, and having good protection circuitry means it works for them, not just me.
Q2-R5 is not the inrush current limiter. The inrush current limiter is U2. That's an AP2553W6.[2]
That's a part designed to solve a specific problem - plugging into a USB port. USB port ICs have overcurrent detection which will quickly turn off power from the port if you try to pull too much power. This keeps external devices from pulling down the +5 rail in a laptop or pad with limited power available. The port turns off until reset. (On Windows this used to take a reboot; Linux usually resets if you close and open the device.)
So if you plug in something with a large filter capacitor, the inrush current as the capacitor charges can momentarily cause an overcurrent condition and shut the port down. The AP2553W6 has both a linear regulator and a switch. When everything is good, the switch is closed and power flows through. If there's a momentary overload, it current limits. If there's a steady overload, it cuts power.
Devices which don't do this power startup properly are often the cause of problems mentioned in searches for "USB port stops working". Not doing this properly saves about $0.25 in parts cost in volume. Such devices will work fine plugged into a USB charger or a desktop machine, but may shut down a USB port on a laptop or tablet.
> When everything is good, the switch is closed and power flows through. If there's a momentary overload, it current limits. If there's a steady overload, it cuts power.
Yes I'm looking for a device family that can do exactly that, but for a large range of currents and voltages (48V, 5A max). Preferably with just two terminals.
That would probably be a self-resetting positive-temperature-coefficient fuse. Those are available for a wide range of currents. They're simple, cheap two-terminal devices.[1]
Those are safety devices. If you're worried about a sudden load introducing a glitch on the 48VDC rail, you may need faster response. It wouldn't have worked in my application, because I need something that will current limit before the overload detector at the power source end trips.
Here's a bigger current limit switch.[2] Versions are available that can handle 48VDC 5A. Texas Instruments calls it an "e-fuse". Not two-terminal, though; it needs some external resistors and caps, plus a connection to ground. Turns off in 280 nanoseconds on a short circuit. This is functionally similar to the part I used, but for higher voltages and currents in industrial applications. TI has many useful tech notes available.
You can get single-chip current limiters for LED driver applications. A CL2N8-G for example.
In some applications you can also use almost any linear voltage regulator - put a resistor between your linear regulator's ground and output pins, and you'll get a constant current.
Of course if your application involves the amount of power dissipation that requires a heatsink, you'll probably end up with a discrete component for that anyway :)
Let's say I have a voltage source of 48V, and I want to limit current in my system to 4.5A, precisely, and with overheating protection. I could be wrong but I don't think the led-driver and voltage regulator solutions would fall in this range. Also, a heatsink would not be required if the duration in which the current needs limiting is small.
I just fixed up a 1972 Honda motorcycle, and when I took the cover off the ignition point it was fascinating looking at that whole system, so simple and easy to fix.
There exists an interesting connection between Boost Converters and Hydraulic Rams [1].
A Hydraulic Ram is device that can pump water from a stream to a higher location by harnessing the kinetic energy of the stream, no other power source required.
The equations for the two devices are essentially the same, only the units change.
Water flows in pipes, valves, etc. concepts transfer to a lot of basic electrical circuits and concepts. E.g. voltage is analogous to pressure. Current is analogous to the volume of water flowing. Bigger pipe (wire) can carry more current. Valves are like switches or resistors. It works to de-mystify concepts for kids who have no concept of what electricity is but can think about water flowing in a pipe.
Circuitry (both digital and analog, including entire computers) can be built using hydraulics. Complex parts like logic gates, oscillators are present, but also "passive" things like accumulators, resistors, and valves -- it's all there.
They work in about the same way as electronic circuits do.
(But it's almost always less expensive to push electricity around than it is to push liquid around, and the parts are a lot smaller, so obviously electronic circuits are the usual winner.
Nonetheless, hydraulic circuits are still pretty common: See, for example, the valve body of an automatic transmission such as (mostly?) electronics-free 700R4.)
Coming from an EE background and doing some simple hydraulics work, it blew my mind that the various components are mainly just the right shapes of metal. In retrospect I don't know what else I could have been expecting, except that electronic components are generally made of some special substance. Talk about actual "bare metal" development.
There are limits to the propagation velocity of signals in both systems that are sometimes necessary to account for. Hydraulics tend to be slower, but it's still the same problem -- each just has different values to plug in and deal with.
Concerns about things like impedance matching and reflections are also the same.
There is a whole area of multi-domain simulation, where the simulator seamlessly jumps from one form of energy to another as long as the units match. I have always loved that.
Prof. David Perreault is excellent. While the course gets into pretty advanced topics that simply won't matter unless you are designing multi-kW systems, it covers all the fundamentals and builds understanding from ground up so you will know what makes sense to use and when.
I was just going to ask about recommended resources for getting into electronics. I've never been able to find anything that I personally found useful - often times, introductury courses are too basic and slow to keep me focused, or they lack exercises or are too theoretical, etc.
There are many hobbyists who have learned all that stuff and can design and implement their own circuits (say, audiophiles or model train enthusiasts), so obviously they have all been able to get there. But I have never managed to learn anything about electronics, although I would really like to.
The MITx version of MIT's 6.002, "Circuits and Electronics", is excellent. Its on MIT's OpenCourseWare [1], and on EdX where a session is starting today [2]. The EdX is divided into three parts, and that is part 1. Here are parts 2 [3] and 3 [4].
Caveat: when I took it at EdX the textbook was available online for free during the course, and it is an excellent textbook that I found very useful. That was back when all the MOOC platforms weren't too worried about monetization.
Now the textbook is only free online for people enrolled in the "verified certificate track" of the course, which is $189. The book is $64.97 for the paperback or DRM-free PDF [5]. I'm not sure how well the course works without the book.
Yeah it can be hard. As a self-taught hobbyist I've found a mix of university courses (not whole curriculum, just pick and choose and don't feel bad fast-forwarding over some of the math theory), books (art of electronics, practical electronics for inventors), and high quality youtube channels (eevblog, phil's lab, robert feranec, microtype engineering) to be a good way to learn.
Also eevblog forums are great. I don't post much but just reading through the discussions you get a lot.
My greatest annoyance is the flood of very low quality Arduino tutorials everywhere that polute the search results. Not to be ungrateful, Arduino got me into the hobby, but if you just learned about resistors last week the world doesn't need your blogpost on how to connect it to a breadboard.
You probably know about this already, buy in case you missed it: The Arts of Electronics is a wonderful book on electronics, starting from zero, ending up at bachelor level EE.
I was introduced to the second edition (silver) when I attended college in the late 90s, and have later upgraded to the third edition (gold). It also has a companion book with more exercises and lab experiments.
For everyone that wants to learn EE, it is highly recommend. Just beware: there are fake copies for sale on Amazon, so be sure you get a genuine copy.
What's the starting level? My electronics knowledge is very basic and I'd like to start "designing" some simple power circuits.
I know the basics of resistors, diodes, capacitors, transistors... And I could explain the most simple classic power supply: transformer, full wave rectification, capacitors and so on. I've built basic digital circuits (LDO + arduino/ESP + leds and stuff) and know some basic physics. I'm good soldering, though :D
Checkout bigclivedotcom on youtube - he reverse engineers circuits all the time in entertaining and accessible ways; a great way to learn through practical applications.
Big Clive is is one of my favorite people but I feel like it would be pretty frustrating (and possibly even dangerous) to try to learn electronics from weatching random chinesium product teardowns.
Ha! It's true Big Clive is always testing dangerous things. I sometimes watch it when YouTube recommends it, and I take it as a lesson of things I shouldn't do. Also, I think it might help to notice badly engineering things in cheap (or not that cheap) products. And I like his hand-drawn diagrams.
MIT I think always starts from first principals. If one can understand and not do math that is generally enough. I have taken many MIT OCW classes and I’m completely uneducated.
> Between the resulting thermal management issues and reduced battery life, linear regulation is seldom worth the pain.
I'd argue the exact opposite. The article is targeting "enthusiasts", and a very large portion of enthusiast projects are going to be powered by a 5V USB charger and consume in the order of a few 100mA of power.
LDOs are dirt cheap, widely available, have pretty decent output characteristics, and incredibly easy to use. If you have basically unlimited 5V and want 100mA of 3.3V, why not use one?
On the other hand, buck converters require you to actually do some actual engineering. You can't just haphazardly throw in a single IC and expect it to work flawlessly on your first try. You either have to use an (expensive!) fully-integrated module, or do a decent bit of math and part sourcing yourself. Neither option is exactly attractive to a hobbyist building a fairly simple one-off PCB.
> On the other hand, buck converters require you to actually do some actual engineering. You can't just haphazardly throw in a single IC and expect it to work flawlessly on your first try.
It used to be a hassle a few years ago - but these days you can haphazardly throw in a R-78K3.3-0.5 - which has the pinout of a classic three-pin 3.3v linear regulator, but it's actually an 80% efficient DC-DC converter with 500mA output and an input range that goes up to 36v.
That's enough current even if you've got something like an ESP32 that needs 250mA - and for any type of hobby project, the $2.40 is fine.
> Cheap buck converters are very noisy and annoying...
Yes. This is why the good ones have more parts. It's a totally fixable problem, and the parts cost to fix it isn't high, but it takes extra engineering effort.
You are right. Yet, if you asked me how to get less noise on your audio circuit the LDO is the easier answer that will cost you less time to implement and likely give you the superior result.
Especially for beginners without a ton of measuring equipment and experience having potentially bursty high frequency components in series can be an interesting way to not get the thing they were planning done, but instead have to deal with an entire new set of problems whose existence they didn't even know about.
Technically you are correct, but "just slap a LDO on it" is probably the better advice.
Agreed. I had to learn a lot to build one. I had an application so unusual (driving antique teletype machines from a laptop) that I had to do a unique design. For most low-volume applications, it's not worth the trouble.
In my experience, not only noise in the RF sense, but also audible. I put together a little audio amplifier, and the sound of the DC/DC makes it unusable in quiet situations. The 12kHz (coming physically from the converter, amplifier off) really hurts the ears!
Can that also help with the emanations security issue where an adversary might be able to extract usable data from the audio produced by the electronic components?
The noise would correlate with load, but this is the least of your worries.
Unless you have a proper RF testing lab and skilled EMC engineers at your disposal, the only thing you can do is stuff everything into a properly designed faraday cage.
The usable data would just be "DC-DC converter is on/off". In theory, if the converter uses a variable frequency or duty cycle, you might be able to extract some information about that too. But that's not very interesting.
A DC-DC converter always uses a variable duty cycle to maintain the target output voltage (or for CC, current). Without it, the voltage would vary wildly depending on load.
For something like an audio amplifier, obtaining precise power supply load would in turn give you a curve over amplifier load, which effectively gives you the speaker amplitude. Input caps and filtering will likely remove the high frequency components entirely, but you might be able to construct at least part of the played waveform.
All good points. I would say that it's a fairly outlandish scenario where you are (i) close enough to the device to listen to the caps whining but (ii) can't measure actual voltages within the circuit (which could be a lot more informative) and (iii) can't just listen to the audio output of the device directly.
Acoustic noise is one thing, but it's not at all outlandish to be within range of the EMI emitted from the same power supply which tells the same tale. What is outlandish is thinking anyone bothers listening in. :)
TEMPEST and other side-channel hardening is hard to do if you lack access to anechoic/RF isolated chambers, sensitive scopes/microphones and knowledge.
yes, but the audio usually doesn't travel as far as the rf; you'd almost have to be in a situation where the adversary can't put equipment near you but has managed to subvert a microphone
The other answer about magnetostriction is technically correct (the best kind) but Misses the actual cause, which is subharmonic oscillation. This occurs when you have not stabilized your control loop properly and is often the result of inadequate phase margin. A simple fix may be to allow the control bandwidth by increasing capacitance at the work amplifier output. But this may also make the response too slow.
For most people designing DCDC converters, this is the most difficult part to understand and correctly tune. If you get the parts selection right and carefully lay out the circuit, this is the one that they can't get right. It takes some understanding of control theory or careful testing and tweaking. And it's what drives a lot of folk to the expensive and relatively inflexible power modules.
If you have 5V and have to step down to 3.3V using an LDO is a very reasonable choice (at 100mA you have about 170mW losses). However if you have e.g. 24V and need to step down to 3.3V, an LDO can get annoyingly hot (at 100mA you now have over 2W losses). But I agree, this is really a "it depends" situation.
And 3.3/5 is approximately 66% efficiency, which isn't too horrible.
So even if you get your buck converter working, getting those 95%+ efficiency numbers you see in datasheets out of the circuit is not trivial.
For beginners it is super annoying that many tutorials say "there is a magical switch or oscillator here which is integral to the function of the boost converter, but we will not tell you how to actually realize it". Additionally, that needs to work at the voltage level you are starting out from and in many cases should be galvanically isolated from the converter. This is a lot to keep in mind and it is actually not trivial.
The answer here is usually to find an IC that works at your desired input voltage or to have a linear regulator provide a small amount of power for the PWM generator. Also be wary of just running with an AI generated answer. Claude 3.5 Sonnet suggest you connect an Arduino straight to 230V and after some back and forth generates circuits which contain strange elements like "antiparallel diodes" which makes no sense.
The TI Power Designer[0] is a great resource. Obviously it will only show you TI parts, but it's very helpful to get a base design. You can filter by complexity (roughly BoM count), size, cost etc based on the parameters (input voltage range, output voltage range, power etc). The designs usually have a reference layout as well.
It is a very hairy cow, which likes to bite and is stuck in the mud. Also it has a wierd high-frequency response. There is a description of tractors to get it out, but we'll skip how the controls work for now.
I do work in automotive EMC testing and it's nearly always the voltage conversion at fault when you fail tests or influence other devices.
Buck-Boost converters are a noisy and finicky thing, and not easy to debug if you use a monolithic IC from the cheapest vendor. Quite annoying discussions.
I've been working with audio recently and found so many of the devices that convert 3.7V to 5V for example inject noise into the rail that make's it in the microphone input source.
The battery support from pisource does this terribly. But so do many battery sources. It's not just microphones that get affected, but also other sensitive sensors like accelerometers.
I hope that other people making DC-DC convertors put some effort into making sure the supply is so clean so as to prevent this in future.
Making a noise-free DC-DC converter is very difficult. Any buck/boost style converter is going to introduce ripple and switching noise into the system. This is inherently unavoidable, and it’s very sensitive to the layout of the board. Actively or passively filtering out all this broadband frequency content is far from trivial, and there is no general solution - only a large, high dimensional tradeoff space.
You’re right that noise is a concern for any analog circuitry though, and if you want to, you can spend a lot of money on specialized DC/DC converter modules with integrated inductors that do their best to eliminate this noise.
As the sibling comment mentions there are several aspects.
You'll need proper input filtering which may require a non-trivial filter network. You'll also need proper output filtering, which does include slapping a lot of capacitors on there, but also careful selection of those capacitors both type and size. Parasitic inductance of larger packages can mean they can't filter high frequencies, and MLCC capacitors have a DC bias which means the effective capacitance is significantly reduced when they have a DC bias on them which they will have in a DC-DC converter.
Then you need to take great care about component placement and board layout, to minimize the return path of the currents and such.
You can skip all of that and get a board that functions as a DC-DC converter if you measure it with a multimeter, but actually be horrible. And you just can't fix bad layout by slapping more capacitors on there. And even with a not terrible layout, you can't fix it by using the wrong kind of capacitors. Like anything through-hole is just not gonna pass.
I think a lot of people are overly cautious of DC-DC conversion in this topic, but you've gone full-tilt in the opposite direction and are severely underestimating the problems that occur.
1. Its not "power-conversion" that's hard per se, its EMC that's very hard and not taught very well at a bachelor's level.
2. DC-DC Voltage Converters usually handle the entirety of your board's power, meaning they are the highest power component.
3. High power and high-frequency is a difficult EMC problem. This means that a bad design will absolutely send your electrons / energy out and radiate out like an antenna. And if things on the same board pick it up, it will be called crosstalk. And if things off-board pick it up, its called electromagnetic interference which almost certainly leads to a compliance problem.
---------------
1. Hobbyists don't care about compliance. So bam. We are already dealing with the biggest problem by simply not caring about it. (Maybe you can care and go into deeper studies, but... if you're a beginner just don't care. Learn this very difficult stuff later).
2. Prevent crosstalk by following good board design rules: have a 4-layer board. Use Power+Signal / GND / GND / Power+Signal stackup. Use two vias (one for signal-1 to signal-4 traversals), and a 2nd via for GND2 to GND3 traversal of the return current). Thinking of both the forward current and a tightly bound reverse current is basically all you need to do to avoid difficult crosstalk problems on board.
Done.
Point#2 requires deeper studies than is typical in bachelor's level electrical engineering. But it truly isn't very difficult once you learn the theory. Tight ground-planes reduce crosstalk (and EMI problems), and furthermore thinking of the return-current explicitly prevents problems.
Now you could have some truly difficult "ringing" from trace inductance and other such nasty problems... but that tends to occur beyond 100MHz. I'm thinking most beginners are going to be under 20MHz for most of their designs and thus never deal with those advanced "PDN" / Power Delivery Network problems.
Though if you do go into PDNs, its obviously a tough subject with huge amounts of study and reading involved. But most of the problems truly are at very high frequencies and/or at EMI compliance. Beginner Hobbyists avoid the most difficult issues entirely by nature of beginner (aka: low-speed) and hobbyist (and therefore don't have to follow regulators).
----------
I'm not a professional. But my understanding is that top-level EEs who work on PDNs will simulate the circuit-board itself to figure out trace inductances / capacitances in the board itself. (Closer planes of ground/power will create more capacitance. Long traces tend to increase trace inductance, etc. etc.). And tight simulations are the only way to truly understand the PCB and how it interacts at high frequencies with high-power.
But such methodologies are gross overkill for a 1MHz boost converter with a pre-made PCB Layout, and a list of capacitors + inductors already picked out for you. (ex: https://www.microchip.com/en-us/product/mcp1640)
We have a couple of challenges today. Hobbyists often go over 20MHz, because they put WiFi, BT or USB on their boards, giving EMC issues. Also, the speed of the modern ICs tend to be very high. If you have a 9600 Hz UART signal, that is not a 9600 Hz signal if it's a square wave with a modern IC with very short rise time on the pins. So a good old, slow serial line can with modern MCU emit noise up in the hundreds of MHz range.
So your PCB layout tips are important, even on slow circuits these days.
Depends on your definition of beginner. It's trivial to put a nrf52 module (like [1]) in a PCB design and wire a USB socket to it; just make sure to route the data lines as a differential pair in kicad (add protection diodes if feeling fancy). And speak a little prayer that it actually works as intended. No need to understand what any of that means.
Of course the notion of using such a module might be a step up from beginner for you, but IMHO it's more about the understanding. But I agree that there is no definite definition.
> Use Power+Signal / GND / GND / Power+Signal stackup.
I'm just a novice (maybe intermediate) so I'm wondering: the common 4-layer stackups available to hobbyists seem to be 1oz/0.5oz/0.5oz/1oz and I assume the outer layers have better thermal dissipation since they're only kept from the air by solder mask; so wouldn't it be better to put power/ground on the outer layers and keep signals in the middle?
Also maybe I'm weird and this is pointless but I typically put a filled copper zone tied to ground on every single layer, unless I have a reason to put some other kind of zone in a particular area. Is it necessary to have a full, dedicated ground plane, rather than ground + signal or ground + power?
> so wouldn't it be better to put power/ground on the outer layers and keep signals in the middle?
Signals must never cross a break or split in the plane they're referencing (usually 0V or ""ground""). This creates huge EMI problems. Your proposal would have signals on layer 2 crossing a split in the ground plane on layer 1 (that split caused by power traces).
Ground fill is counterproductive on the signal layer.
If you accidentally get the return path on layer1 or layer4 instead of the designated layer2 or layer3, you've created noise.
Power+Signal / GND / GND / Power+Signal is about consistency and braindead-easy tracking of return paths. The return path for layer1 is always layer2. The return path of layer4 is always layer3.
Keeping track of both the forward signal (or power line) and the reversed return current (which was electrically induced onto the nearest reference plane) stops working if suddenly you have random reference ground-fill planes on the layer1 or layer4.
DO NOT put GND on layer1 or layer4 if you're doing this methodology.
---------------
Beginners likely aren't working with a hot enough circuit where thermal dissipation is an issue. If you do have thermal dissipation then I guess thermal ground on layer1 and layer4 ties with thermal vias will be needed.
In practice, the thermal resistance across the PCB cross section is better than beginners expect anyway. Thermal conductivity is just one attribute, the other attributes of heat movement are distance and cross sectional area.
So the shape favors you up and down the PCB. Yes the fiberglass has worse thermal conductivity but you win on shape.
96% efficiency sounds great on paper for synchronous converters, but as SBC current draw just keeps increasing and BLDC motors can run at higher voltages it starts to create a major heating problem when you have to supply both from the same source.
Something like 12V down to 5V at 5A creates a managable amount of heat, but going higher, 20V, 30V on the battery side and things start to melt all around from heat losses from that large a drop. In some cases I've had to resort to using cascaded rails, stepping first down to 24, then 24 to 12 and then 12 to 5 just to keep the heating spread between different buck converters even if it multiplies losses. Would love to hear what the expert solution is to this that isn't just a massive heatsink.
I see they are very confident about going to 6A. These ratings are often just "yeah it can technically do that but it will reach 100 degrees during it", for any kind of stable continuous draw you just have to halve the rating to be safe.
That looks more like it (8A fuse), and relatively cheap on Mouser too interestingly enough. Thanks for the heads up I'll have to order and try one.
It does puzzle me why they went with the 2.54mm pin layout though, those are rated for 3A max I think? So even if the draw is perfectly split between the two vout pairs they give it'll be melting at 6A already, probably more like 5 if not.
I know the pin looks small compared to the cable you'd run to a wall socket for a 10A current - but those cables are a lot longer these copper pins, and cables are sized with the assumption the copper will be coated in insulation then coated in another layer of insulation then installed into a wall full of insulation.
A 10mm copper pin measuring 0.6mm x 0.6mm pin would have half a milliohm of resistance. Even if you ran your entire 5A load through a single pin, it would only have to dissipate 13 milliwatts.
I'd be more worried about the PCB traces if I were you - 2oz copper is only 0.07mm thick :)
> Would love to hear what the expert solution is to this that isn't just a massive heatsink.
A smaller heatsink with active cooling and parallel MOSFETs. At a certain power level, it's just physically impossible to rely on convection cooling alone - just look at audio amps or your average CPU/GPU... banks of MOSFETs, caps and inductors it is. While the BOM part count may be higher, you need lower-capability parts.
The danger is, you need to carefully grade and match the MOSFETs, otherwise you risk them failing sequentially in a very short time if you're operating too close to their rated current - one burns out, the load distributes to the others, and then they fail because they cannot handle the additional load (or one fails into dead short instead of open, which instantly kills all of the others).
Friendly warning to people who aren’t electronics savvy: this blog post is written in a “now draw the owl” sort of way. I’m not sure who the audience is. Anyone who can read this stuff at the level presented inherently knows most of this and then some. Everyone else will need a book and that book will cover this material as it’s fairly fundamental and will derive equations used in here as well so you can make sense of it.
Maybe the target audience is those with lapsed circuit theory knowledge from undergrad and no hobby or professional power electronics experience afterwards? Describing myself, of course (most of icamtuf's stuff is up my alley, fwiw).
One would think the title including "DC-DC voltage conversion" is enough of a squirrel-catcher to stop folks who either 1) Know nothing about what it means or 2) know exactly how to do it, from reading the article.
A commonly used alternative in the microcontroller world is to simply stack a few diodes. Very simple alternative which I have seen being used a few times.
I have often wondered if ideas from a buck/boost converter could be applied to a mechanical gearbox. Voltage and current in electrical circuits (where voltage x current = power) is completely analogous to torque and speed in mechanical shafts (where torque * speed = power). Every electrical component has a physical counterpart. Spring = capacitor. Inductor = mass with momentum. Resistor = friction brake.
The goal would be a variable ratio gearbox using a fully mechanical system, using a spring and a hammer type mechanism to convert one torque/speed to another torque/speed.
This is already done in impact wrenches, but I would hope that rather than having an impact rate of say 5 Hz, you have an impact rate of 50 kHz or more, allowing a smooth conversion from one speed to another.
Obviously, the difficulty is in the details - designing parts to withstand 50k hammers per second for years of operating without failing from fatigue.
Various other mechanical things already operate at high mechanical frequencies. SAW filters vibrate things mechanically at Ghz and don't suffer fatigue failures.
You're overcomplicating it; you only need a single clutch and in/out springs[1] to do this. If you're spinning at 4000 rpm and your springs cover 6 degrees of rotation, then your clutch needs to be able to actuate at 4000 Hz.
When the clutch is engaged, the engine-side springs compress to supply the torque and match the speed difference. When it's disengaged, the springs expand back out as it returns to engine speed. The obvious problem is that clutches do not smoothly click on and off like a transistor.
However there are more specialized devices that use stick-slip dynamics like piezo actuators. Since there is a much more rapid transition between "on"/"off", they can be very efficient and allow relatively weak devices to exert very large forces. They're just only able to take very small steps.
> When it's disengaged, the springs expand back out as it returns to engine speed.
What is it?
I think you need an intermediate flywheel, with springs and clutches on each side. The intermediate flywheel's mass is tiny, so might be formed by just the masses of the springs and clutch mechanism.
It is the clutch. The clutch is your flywheel; it's free floating and connected to the driveshaft with springs. When its engaged, it is connected to both shafts by springs. When it's disconnected it's only connected to the driveshaft by springs.
A decent article, but there’s a ton of misunderstanding in the comment section.
For one thing: LDOs can be more efficient than buck converters, especially at very low current consumptions. If you’re drawing sub 1 mA, like a battery powered system, an LDO is going to be a more efficient step down converter, because it doesn’t have switching losses. Bucks are only better choices for stepping down voltage at higher currents because the switching losses become negligible.
Second: a ton of people here are vastly exaggerating the difficulty of designing a step down buck converter. Integrated designs from TI or analog devices will tell you all the compensating components, output capacitor values, inductor values, etc. for common step down output voltages. Most will include reference layouts with a four layer six layer or even two layer stack up for optimal performance. It’s really not that hard to get a one spin win out of most common buck designs.
Don’t be afraid. Just follow the manual. You’ll be fine.
The challenges I’ve had with buck or boost conversion is on mixed signal boards where I have very sensitive analog circuits. The ripple and switching noise on the output can make you lose bits on ADCs, or show up on a DAC quite easily. It’s easy to get a buck converter doing the right thing without horrible EMC/EMI if you’re careful and follow the manual, but it’s a lot harder to optimize for something like low noise without utilizing LDOs
For one: most LDOs don’t have a high enough PSRR bandwidth to completely eliminate buck switching noise. Most LDO PSRRs roll off sharply in the low hundreds or high tens of kHz. That’s generally below the switching frequency (and noise frequency) of most buck regulators. If you’re dealing with audio that’s generally fine. RF, however, is a separate problem.
Second: there are more cost effective and wide bandwidth solutions for noise reduction. Capacitance multipliers are one that spring to mind. Ferrite beads are another great means for tamping down high frequency noise.
Third: layout and current return paths are often just as much of a problem as the buck itself. Couple a high current return path into an audio chain with a shared return, and you’re gonna have a problem no matter which way you slice it.
Yeah the PSRR of a typical LDO doesn’t to as well up in the high frequencies, but it generally still does some attenuation.
I’m not an expert myself, but I’ve read that RF noise in audio applications isn’t always okay because it can demodulate into your amplifiers.
Re. Capacitance multipliers, I may be mistaken but I think they typically introduce significant positive gain at high frequencies due to the transistor parasitics. They make sense for very low frequency cut off (AC mains transformer ripple), but I’m not so sure about typical SMPS output. I would bet other filter topologies (LC, etc), would generally do better in practice.
And definitely 100% on the layout. Return currents and common mode noise will get ya.
I've moved a lot of my home computing to home-brewed 12V UPSes using these. LFP charger --> Battery --> 12V or 5V DC-DC buck or boost/buck regulator --> device. Most UPSes are designed for high wattage, short runtime, but things like my firewall or small proxmox box for SDN+DNS benefit from low-wattage, long-runtime, and getting the inverter out of the picture substantially improves runtime. Said proxmox box uses under 10W and gets about 20h of runtime from a $50 battery.
Interestingly, many universal power supplies (as in, works in the US and in Europe without doing anything to the PSU) are naturally capable of digesting 200~300V unregulated DC.
Beware though that DC arcs above 500mA will not easily extinguish, so devices should not be plugged under load (and if it can't be helped, a rapid yoink keeps the arc from burning the contacts).
Circuit breakers have to be used with 2 poles in series and mechanically linked to switch together. Check the datasheet for details. Mains fuses with a suitable DC rating on their datasheet are readily available, though.
Well, yeah, but this actually goes beyond those that first rectify.
E.g. bridge less totem-pole designs where rectifying and the active power factor correction stage are fused, would also work unless the firmware gets confused by the lack of input polarity flipping.
And yes, that topology can also go into a flyback transformer or pretty much any other unipolar magnetic of an SMPS.
For the moment some random cheap ones from Amazon - I haven't run it long enough to see if it will last more than a few months of full-time use. The battery was a freebie, so I don't actually recommend it; the charger is an "ULTRAPOWER 4a". We'll see.
What it's augmenting is a pretty cheap AIMS power brand modified sine-wave inverter/charger (meh, should have gone pure sine, it causes some of the power supplies to make funny noises) hooked up to a Litime 2kWh LFP battery (very happy with the big battery). TODO on the experiment is swapping out the inverter part with direct 12V conversion for some of the things on the inverter, but I wanted to test the regulator approach with a non-critical component for a month or two first before hooking it to something that can deliver 100A, obviously with a fuse. :-)
There are IP camera 12V UPSes you can get that are ok -- I have a few TalentCell 98Wh units -- but they don't actually deliver regulated power, they just tap directly off of the li-ion cells. Those are about $65.
With an inverter UPS, $50 gets you a unit with a single 12V / 8ah or so lead-acid cell; 90 or so watt-hours _could_ be reasonable except that the inverter draws upwards of 10-15W while running, so these units actually won't run even a router for more than a couple of hours. Also, lead-acid dies after about 3 years, and then you're in for another $15 or and a bit of a pain replacing it. I'm really sick of doing surgery on old UPSes at this point and trying to move entirely to LFP for the 10 year lifespan alone.
If you want really long runtime, you basically have to DIY, but it's fortunately quite straightforward. Larger LFP batteries are about $250 per kWh, sometimes less. DIY'ing it, you can pick your capacity/runtime independent of your wattage, vs pre-packaged UPSes that frequently couple the two.
(I have a big pile of APC UPSes of various sorts, some with external expansion battery packs, and it's quite a hassle to get truly extended runtime from any of them -- I don't want to have a generator, I want 20 hours of extended runtime. I realize I'm a little weird, but I like to hope I'm just ahead of the curve a little on switching. :-)
I want to power my 12V devices with USB PD. Looks like 12V is optional in the spec and is supported only by some devices (eg. UGREEN), and not by others (eg. Anker)
Given a USB PD power supply which supports 15V but not 12V, and a usb-c/barrel-jack cable configured to negotiate for 15V, what would be the simplest (yet safe) circuit i could add via barrel jack to regulate the to voltage down to safe/consistent 12V?
is a simple linear voltage regulator (LM7812) sufficient? would i need capacitors to smooth it out?
It might be cheaper to get a power supply that supports later PD standards? E.g. IKEA is selling some cheap here for either 8€ (Sjöss, 1 USB-C port (max. 30W, up to 3A)) or 15€ (Sjöss, 2 USB-C port (combined power output of 45W, up to 3A, also on a single port)). Both support PD 3.0 and PPS (that's the fanciest PD standard that implements requesting arbitrary voltages from the power supply) They also stock nice and cheap USB-C cables. These power supplies work fine with USB-PD trigger boards set to 12V.
Linear loss obeys Kirchoff's and Ohm's and power laws pretty simply. If you need to lose a certain voltage at a given (max) current, the power lost is P = U * I. For example, 3 V * 0.1 A = 0.3 W. If your LM7812 can run at that overhead (yes), take the voltages and currents (yes) and dissipate the 0.3 W as heat (almost certainly yes) then it'll work.
Caps will depend on how fast the response needs to be. If your load jumps too much too fast and there's no reservoir, you'll get a voltage drop. If it feeds too much back, you'll get a voltage climb. Caps may help and are pretty cheap and IIRC 78xx chips are very stable, but the datasheet will have limits and recommendations.
All the information will be in the data sheet and making some test circuits is easy for these, especially if you have some measuring equipment. Anything below 1A will probably be easy, anything above might be risky, as a rule of thumb. Very small or very large voltage differences will also be tricky or impossible.
A 3V drop over an LDO is usually reasonable with low enough currents. Some LDOs require capacitors to be stable, and it’s usually a good idea to have some capacitance on your power rails anyway.
I'm a theoretical physicist and I swear electrical stuff is so hard to understand! I have a lot of respect for electrical engineers ^^' (and electricians)
1. You don't get a voltage spike when you disconnect an inductor. The field collapses and induces a current. If you measure it across a high impedance then it looks like a voltage spike. If you measure it across a low impedance then it's not necessarily much of a spike. Ergo depends on load impedance.
2. SMPS designs are not necessarily noisier than linear power supplies. It's always a design trade off. In fact you see SMPS in all modern RF test gear which is generally far more sensitive and has far more bandwidth than anything back when linear supplies were common. Also there is a lot of noise coming off the diodes in a basic bridge rectifier as well! Noise is a whole-system design consideration that has to be made.
3. Don't use any LLMs for designing circuits. Please go read a book on it designed by experts, not stuff scraped from thousands of idiots. I've seen some horrible stuff out there.
> If you measure it across a high impedance then it looks like a voltage spike. If you measure it across a low impedance then it's not necessarily much of a spike.
"Disconnect" implies an open circuit and high impedance.
Irrelevant. If it's not an open circuit, then the inductor is connected to things in parallel, and the impedance increase creates a voltage spike. If the load impedance is significantly lower than the thing being disconnected, then you're just disconnecting something that doesn't matter to the circuit and it's silly to be that pedantic about an irrelevant situation. You're bending the statement from "disconnecting an inductor" to "disconnecting something from an inductor (while something else is still connected)"
The fundamental action of a boost converter is from the inductors "voltage spike" behavior. The lowest noise linear regulator is less noisy than the lowest noise smps.
I agree though that LLM's are not good at circuit design.
If you measure any voltage at low impedance, you'll suddenly have a massive spike of current that will blow out your fuses, drain your battery/capacitor/inductor, or blow your measurement device
It would actually charge your inductor. The energy stored in an inductor is proportional to current running through it. This is key to the action of a boost converter.
The physical equivalent of an inductor is a flywheel, which makes it much easier to visualize.
My point is that measuring voltage with low-impedance is essentially introducing a short, which is not really a useful thing to do for most circuits. Bad things tend to happen.
5. Contrary to the article, FETs don't make suitable pass transistors for Zener regulators that rely on Vgs being relatively constant, the way Vbe is with bipolars. In fact, even with a proper feedback loop, most FETs make awful series regulators due to SOA limits.
While not generally available at this voltage level, SiC VJFETs do not have an SOA limit (on drain-source current and voltage; the p-n junction from the gate to the source-drain channel has current limits for non-capacitive current (i.e., forward conduction and reverse biased avalanche mode; though with a high enough gate impedance in the off-state the drain-source connection is avalanche proof to full drain current for as long as it takes for the channel to reach it's ~500C limit)).
It's generally sad that power JFETs are so neglected, because e.g. a normally-on switch in a buck eliminates the auxiliary startup supply, and the absence of a gate oxide allows designing with the junction's clamping activity in mind. Also the forward conduction gate-source is a diode temperature sensor literally right at the channel.
Interesting, but I had expected to see a comparison of generating DC voltages using tubes, which were used in my university Electronics course, with solid state. In those days to generate a DC voltage from another DC voltage required generating an AC voltage from the DC and then rectifying it.
I suppose the downside is the complexity in circuit design. If the datasheet has a good reference schematic and instructions, or if you are good with electronics fundamentals, it's not a big deal. If not... rolling the dice if it will work. These circuits have been one of the biggest sources of me having to respin boards. Requires a lot of attention to detail to get the passives correct in terms of values, net connections etc, compared to an LDO.
Then you may go down rabbit holes like "The one at the switching frequency I want went out of stock. Can I use the one that switches slower? Can I substitute this capacitor in instead of the nonstandard value the ref diagram recommended?"
They should IMO be the default for most designs, but double-check everything!
Many people use DC-DC to down-regulate a 48 volt battery system to 12-volt for their RV where they remove the original battery pack and replace it with Lithium. Not everyone does that, some use a 12-volt lithium system. Less 4/0 cables needed when adding inverters and other fun stuff to the RV.
There are boost converters, buck converters, and ones with transformers. With a transformer you can isolate the input from the output, which is mandatory for safety if you're driving the thing from the AC power line.
Here's one of mine. USB 5VDC in, 120 VDC out, to operate antique teletype machines that need 60mA 120VDC.[1] The basic circuit is simple, but there are multiple surface mount ferrite beads and small capacitors to keep the spikes from coming out via the input USB, output, or as RF. LTspice simulation was needed to pick the values for those, so as to minimize noise in both voltage and current.
[1] https://github.com/John-Nagle/ttyloopdriver/blob/master/boar...