Arduino
This is an UNOFFICIAL Arduino community.
Everyone who uses Arduino board or their clones or associated boards and/or the Arduino IDE is welcome here. If it involves Arduino hardware or software it's welcome here. If it connects to Arduino hardware it's welcome here. If you're building your own boards that you use with an Arduino it's welcome here. There will be no Arduino elitist bullshit in this community.
You may also be interested in:
RULES:
-
It's always a floating input.
-
All Lemmy.ca rules apply here.
-
Everyone (see rule 98) is welcome.
-
If you’ve seen a question 100 times answer it the 101st time or ignore it. Even better, write a complete, detailed answer and suggest that the mod(s) pin it to the community.
[Did you actually think there were 98 rules?]
-
If you present something as fact and are asked to provide proof or a source provide proof or a source. Proof must be from a reliable source. If you fail to provide proof or a source your post or comment may be removed.
-
Don’t be a dick. Yes, this is a catch-all rule.
-
The mod(s) have the final say.
view the rest of the comments
The full answer requires roughly a 3rd year's course in Electrical Engineering. I'll try to summarize, but I'll inevitably miss a concept or two.
Transistors are the fundamental answer. Various VRMs are made from different transistors, but the core concept is that they have 3 pins: input, control, and output. The voltage on "control" controls the voltage on "output" (which is drawn from "input"). Fully understanding transistors is... difficult. So lets not talk about transistors, at least not at the beginner level.
Instead of discussing raw transistors, there's a combination of transistors called an 'OpAmp', which is easier to understand. This has 5 pins: positive-voltage-source, negative-voltage-source (usually tied to ground), PlusInput, MinusInput, and output. Ideally, the OpAmp creates "output = Infinity * (PlusInput - MinusInput)". Yes, you heard me, times infinity. In practice, it is "only" times 10-million or maybe times 100-million, but just pretend its times infinity, its so much easier to understand.
If you create a negative-feedback loop (that is, connect "output" to "MinusInput"), then the infinities cancel out and now PlusInput controls the voltage. Seriously, check the math. Say "A" is the gain (which is infinity), then...
Except MinusInput is output, we connected them together. So replace it with output.
Shuffle stuff around...
output = A * Plus - A * Output
A * Output - output = A * Plus.
(A - 1) * output = A * Plus
(A - 1) / A * output = Plus
If "A is infinity", then infinity-1 is infinity. (lol, yeah, math works like that. Infinity is a funny number), so this means that...
Now no matter what the output tries to be (which is changing because of changing resistances), the OpAmp will magically "hold" the voltage from plus and react in time.
Yes, this works. Yes, it sounds stupid, the math works and I've made many creations that do this kind of analysis. In practice, since the gain is "only" 10-million, you get: 9,999,999 / 10,000,000 * output = plus, but that's small enough that we can ignore the error.
Zener Diode + OpAmp is probably the simplest conceptual design for a voltage regulator. Real life VRMs include more features, like overcurrent protection and other detection. But you can imagine how additional OpAmps with just the right magic / wiring can provide these features.
Ah ha (great band)! Zener diodes! That was the only component in my kit I was unfamiliar with (aside from the various ICs), very cool tech.
Another question:I have 5v and 9v vrms, and obviously I need 3.3v; given that a vrm guarantees a fixed voltage regardless of current draw, can I use a downstream resistor to step the voltage down to 3.3v? Or is that also gonna cause problems?
I covered this a bit earlier. Lemme repeat a bit:
Which resistor can you use to turn a 5V VRM into a 3.3V VRM when the ESP32 is sometimes 20 Ohms, sometimes 150 Ohms? Answer: you can't. Not with a fixed resistor. You need a device that reacts and changes its resistance to match constantly. Aka: a VRM.
Only voltage-regulators can solve the voltage regulator problem. You can build a voltage regulator out of transistors, op-amps, or other such devices. (You can build one out of a uC like Arduino even though its really jank... but ADCs exist for a reason and capacitors + inductors do funny things at funny speeds that an Arduino can control).
Now, there are VRMs that are controlled by simple voltage dividers / aka simple resistors can control a VRM. But really, if you want 3.3V you should get a 3.3V voltage-regulator.
Alternatively, you get an "adjustable" voltage regulator (really: its a voltage-regulator with a very low set voltage, like 0.6V or something). You then use a voltage-divider (aka: 2x resistors) to control the feedback pin. Its a bit complex but you gain a "user-configurable" voltage by just changing resistors later. For example, the LM317 is nominally a 1.25V voltage regulator, but with the following circuit:
EDIT: It probably should be noted that the typical LM317 has 2V of dropout. That means 5V can turn into 3V, but not 3.5V (aka: only 1.5V of dropout). To have less dropout, you need a low-dropout voltage regulator.
Oh, right. Brainfart. Thank you.
Man. These have all been very detail answers. thank you so much for your time and knowledge. Very helpful. I think I'll try to build a vrm (for fun, not for my esp32) with this info.