Electronics notes/Changing voltage

From Helpful
(Redirected from Level shifting)
Jump to navigation Jump to search

⚠ This is for beginners and very much by a beginner / hobbyist

It's intended to get an intuitive overview for hobbyist needs. It may get you started, but to be able to do anything remotely clever, follow a proper course or read a good book.

Some basics and reference: Volts, amps, energy, power · batteries · resistors · transistors · fuses · diodes · capacitors · inductors and transformers · ground

Slightly less basic: amplifier notes · varistors · changing voltage · baluns · frequency generation · Transmission lines · skin effect

And some more applied stuff:

IO: Input and output pins · wired local IO · wired local-ish IO · ·  Various wireless · 802.11 (WiFi) · cell phone

Sensors: General sensor notes, voltage and current sensing · Knobs and dials · Pressure sensing · Temperature sensing · humidity sensing · Light sensing · Movement sensing · Capacitive sensing · Touch screen notes

Actuators: General actuator notes, circuit protection · Motors and servos · Solenoids

Noise stuff: Stray signals and noise · sound-related noise names · electronic non-coupled noise names · electronic coupled noise · ground loop · strategies to avoid coupled noise · Sampling, reproduction, and transmission distortions

Audio notes: See avnotes

Platform specific

Arduino and AVR notes · (Ethernet)
Microcontroller and computer platforms ··· ESP series notes · STM32 series notes

Less sorted: Ground · device voltage and impedance (+ audio-specific) · electricity and humans · power supply considerations · Common terms, useful basics, soldering · landline phones · pulse modulation · signal reflection · Project boxes · resource metering · SDR · PLL · vacuum tubes · Multimeter notes Unsorted stuff

Some stuff I've messed with: Avrusb500v2 · GPS · Hilo GPRS · JY-MCU · DMX · Thermal printer ·

See also Category:Electronics.

When you talk about trying to get an particular voltage level, 'voltage regulator' and 'voltage converter' are near-synonymous terms, and 'voltage stabilizer' is also related.

Some terms and properties

This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.
  • Step-down: output voltage is lower than the input voltage
  • Step-up: output voltage is higher than the input voltage
  • Inverting - Creates a voltage of opposite polarity
(Not to be confused with 'inverter' , which refers to DC-to-AC conversion, such as those use in cars, and solar panels that provide AC power)

  • Charge pumps - designs that use capacitors for temporary storage, switching it one of a few ways to exchange voltage for current (fractionally divide/multiply one for the other)
Charge pumps are somewhat cheaper and simpler than inductor-based circuits.
Depending on design and use, they can be ~80-95% efficient, usually a bit less.

  • low-dropout, often referring to voltage regulation step of something larger:
A low-dropout variant requires less input-output voltage difference than is typical.
e.g. where linear regulators often need 2 to 2.5V higher input, LDO regulators may need only 1.5V.
note that they are often also pickier about what range they comfortably accept
Can matter for small drops, for efficiency, for battery-powered situations

Continuous/Discontinuous mode:

  • Discontinuous designs either simply discharge to zero, or rely on a short-term buffer to sustain current (e.g. capacitors)
Discontinuous designs are often simpler and smaller.
  • Continuous mode never discharge too significantly during operation (which particularly for DC-DC converters depends on load), meaning you'll always get current.
Performance is usually better in continuous mode.

Further notes:

  • In any designs that are based on feedback, stability and adaptation speed are conflicting interests.
  • One distinction is whether you use a switching design (stepdown can e.g. be primarily resistive instead)

LED drivers

LED drivers are somewhat unusual, often often CC (Constant Current) or CV (Constant Voltage) - see also Electronics_notes/Diodes#LED_drivers

DC level shifting

This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.

Level shifting usually refers not to power conversion, but to making voltage signals like logic and communication work between devices that naturally run at different voltages.

The thing that makes this simpler than much of the DC-to-DC section below is that you are dealing with negligible current - just enough to move the level (with the capacitance involved, which is typically tiny).

DIYers will regularly run into

  • 3.3V output to 5V input
3.3V logic to 5V TTL: high starts above 2V so a 3.3V high is high enough and will work as-is.
3.3V logic to 5V CMOS, is high above ~3.5V (70% * 5V) so 3.3V won't work.
The recommended approach is probably a diode logic level step-up (see below). There are others.
  • 5V output to 3.3V input
If the 3.3V device, or some pins on it, are 5V tolerant, that roughly means its pins have protection diodes that can sink the difference without shortening lifespan(verify)
This varies between devices, so unless the datasheet says it's okay, don't do a direct connection.
The recommended approach is probably a voltage divider. There are others.

On 5V tolerance

You will see terms like "5V tolerant" around IO (and often GPIO) logic lines.

It means that you the pins themselves work at a lower voltage, but will not break with that voltage applied to them in input mode.

Most GPIO have ESD protection, which is relevant to 5V tolerance in that this is also overvoltage protection that siphons off current based on voltage.

Yet ESD protection often expects that to be transient and with so little charge behind it that it is easily dissipated. While it may happily do that for decades, that same silicon may still slow-fry if it gets a continuous 5V (depending e.g. on how large that actual silicon is).

Additionally, if that protection is snapback, it does nothing until triggered by a sufficiently high voltage. For example, an ESP8266's ESD protection triggers above 6V, so does not apply to 5V signals.

So for multiple reasons, ESD details do not answer 5V tolerance questions.

And whether that protection, and the entire I/O construction, can deal with a consistent something-more-than-Vcc depends on more than that.

We tend to go on manufacturer recommendations, which can vary per device and even per pin

...and it's not always clear how optimistic/pessimistic these recommendations are.

Related notes:

  • Note that pins in output mode are more fragile
and note that while booting, pins may be in a state you don't know (may or may not be defined), so set them as soon as you can.
  • tolerance may work differently (e.g. not) while the IC is not powered


components: optocouple and (current limiting) resistor
should work fine below <1MHz (order of magnitude, check datasheet)
not the smallest, or least components, but easy
can give isolation to boot (e.g. isolating ground between devices, which is one reason it was a nice choice in serial MIDI).

Note that most optocouples can't sink much on the output - usually a few dozen mA for most (check datasheet). For IO that's plenty, for anything else you may want to add a transistor.

voltage divider (lower voltage only)

components: 2 resistors
simple for a singe line, sort of annoying for more than a few

diode logic level step-up (higher voltage)

This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.
components; 2 diodes, 1 resistor
simple and cheap
additional footnotes about the two rails communicating
resistor choice is a careful balance between four different things
wastes a little power, so not ideal for battery

some footnotes about impedance (and note the low level is raised)
see e.g. its mention in 3V tips 'n tricks

IO controlling a BJT/FET

components: transistor + resistor
inverts the logic. If you can tweak the code, this saves a component over the diode solution (but for hardware protocols this may be impossible)
in general you should tweak the resistor values to lower current use
for faster cases, FETs aren't always easier. that is, specific FETs may have distinct parasitic properties to mitigate

Bidirectinal FET level shifter

  • components:
see e.g. [1] [2]

IC level shifters

  • IC solutions can be nice when you have a handful or more lines
e.g. the (74hc)4050 is six non-inverting high-to-low shifters
will output what it gets on its Vcc
has over-voltage tolerant inputs (up to ~15V)
or TTL logic gates (e.g. 74HCT) in general

Other level shifting notes

Some ICs, e.g. various serial adapters

are designed to accept a Vcc in a range, like 3 to 5V on Vcc
and will output relative to the Vcc they get
which can make it a lot easier to interface them variably to 3.3V or 5V devices (and from the same supply)

See also:


This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.

Shunt regulator

This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.

A shunt regulator is based on a Zener diode used as a shunt. [3].

The diode is used in reverse (i.e. not in the conducting direction), because we rely on its reverse breakdown voltage - the point at which it starts conducting in reverse. (This is also why we use zeners - non-zeners have too high a breakdown voltage for use in most electronics, and break too easily)

The net effect is that above a certain voltage, current goes through the diode and won't go to the load.

Usually needs some current limiting, e.g. a series resistor. There are a number of variants of this idea, including even simpler designs, but also more efficient ways and more complex designs of shunt regulation, yet we quickly add enough components that there are better or more widely applicable designs.


  • simple to implement, using basic components
  • good enough for very-low-current applications


  • low current capacity
  • the higher the difference between the voltage supply and intended voltage (and/or the lower the load current), the more wasteful it is
  • requires a fixed load and design
  • If the zener burns out it puts the full voltage on the load

Transistor series regulator

A transistor series regulator is basically a shunt regulator fed into a transistor as a voltage follower[4].


  • Better regulation than shunt (transistor's base is a light load)
  • handles more current


  • still sensitive to load variation, sensitive to supply variation.
  • Linear regulator is often better for similar price.

Linear regulator

So the more typical resistive design is the linear regulator,

  • basically operates as a variable resistor, intentionally wastes the voltage difference (times the current actually drawn) as heat
  • named for being a device (BJT, FET, tube) operating in its linear region - or passive device like a zener diode operating in its breakdown region.
...and contrasted to e.g. switching regulators
  • Simple, cheap
  • lower noise than switching (still has thermal noise) particularly for lower frequencies

Fixed versus variable linear regulators:

  • you can change a fixed, but variable ones are more precise (and efficient) to tweak

Low-dropout regulator (LDO)

  • a (typically linear) regulator which can work with a lower-than-typical voltage difference
  • More power-efficient (than basic linear) for larger currents
  • sometimes a practical necessity (over linear) when supply voltage is not far away (consider e.g. batteries)

Around the regulator:

  • you'll want a capacitor on the input side, particularly if it's a bit away from the power supply
bypassing moderate current draws, so order of ≥0.1 μF or more on the input side (verify)
but too large will make it less stable (verify)
on all regulators, really (but it's not known as a rule, in part because the once-uniquitous 78xx series was more stable than most)
  • a capacitor on the output side can help stability and transient response
could be on the order of ≥1 μF (verify)

See also:

Capacitors around regulators

See also:

Switching designs

Switching designs refer broadly to any design that uses fast switching to change how storage elements (inductors and/or capacitors) are connected, and can be step-up, step-down, and inverting constructions..

Since they work with a charge-discharge cycle they will have voltage ripple in their output.

Efficiency (often something between 70% and 90%) varies with current drawn, so are typically more efficient than linear regulators (except in some low-difference situations, where LDOs may actually be more efficient).

See also:

Designs of switch-mode regulators include:


Buck converter

a switch-mode step-down design, based on a single inductor



Boost converter

a switch-mode, step-up design, based on a single inductor

Basically charges a capacitor, and connects it so that it regularly doubles the input voltage


Step-up or step-down

Buck-boost converter

(Note: distinct from the buck / boost transformer)

based on a single inductor


mostly used for stabilisation


flyback converter

basically buck-boost, but with the inductor split into a transformer

giving isolation, and allowing voltage multiplication via the transformer

can also do AC-to-DC

Push-Pull converter

(similar to the flyback converter)


Forward converter



topology of inductors and capacitors

similar to buck-boost



inductors and capacitors(verify)



Single-ended primary-inductor converter

inductors and capacitors(verify)



This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.

Half-Bridge rectifier


Full-Bridge rectifier




The basic transformer can be seen as a specific exchange between voltage and current.

Flyback transformer

Zeta converter

buck / boost transformer

(note: distinct from the Buck-boost converter)

capacitive dropper



Basically anything that generates a simple waveform, and allows load worth mentioning to be drawn from it.



See also

Comparison notes


See Electronics_notes/Inductors_and_transformers#Transformers