Skip to main content

Circuits and Voltage

This page builds a mental model of how electricity flows through a circuit. If you have never thought about what "3.3 V" actually means or why every component needs a GND wire, start here.


What Is a Circuit?

A circuit is a loop. Electricity flows out of a power source, through components that do useful work, and back to the power source. If the loop is broken at any point, nothing works — just like a function that never returns.

The simplest useful circuit has three parts: a power source, a load (something that uses the power), and wires connecting them in a loop:

Series circuit: battery on the left, resistor and LED in series on the right, wires closing the loop at top and bottom

Current flows from the positive terminal of the battery, through the resistor (which limits how much current flows), through the LED (which converts some energy to light), and back to the negative terminal. Remove any wire and the LED goes dark.

Software analogy

A circuit is like a pipeline: data (current) flows from a source, through processing stages (components), and back. If any stage is missing or disconnected, the pipeline stalls.


Voltage Is a Difference Between Two Points

Voltage is not a property of a single wire. It is the difference in electrical potential between two points. When someone says "this pin is at 3.3 V", they mean there is a 3.3 V difference between that pin and a reference point (ground).

Think of it like altitude. A mountain is not "3000 metres" in any absolute sense — it is 3000 metres above sea level. Sea level is the reference. If you moved the reference, the number would change even though the mountain did not.

In a circuit, the reference point is ground (GND). All voltages are measured relative to it.

A concrete example

In this project, when the ESP32 sets GPIO8 to HIGH:

  • The voltage between GPIO8 and GND is approximately 3.3 V
  • The voltage between GPIO8 and the 3.3 V rail is approximately 0 V (they are at the same potential)
  • The voltage between GPIO8 and the 5 V rail is approximately −1.7 V (GPIO8 is lower)

All three statements are true simultaneously. Voltage is always "relative to what?"


VCC and GND

These two labels appear constantly in datasheets and wiring diagrams:

LabelMeaningIn this project
VCCThe positive supply voltage for a component3.3 V for the ESP32, DS3231, SD module, and e-ink adapter; 5 V for the MAX98357A
GNDThe common reference point (0 V)Shared by every component

VCC is not a single global voltage. Different parts of the circuit can have different VCC values. The ESP32's VCC is 3.3 V. The MAX98357A's VCC (labelled VIN on its breakout board) is 5 V. Both are "VCC" for their respective components.

What is global is GND. Every component's GND pin must connect to the same ground rail. If two components have different ground references, a "3.3 V" signal from one component means something different to the other, and communication fails or — worse — components are damaged.

Power distribution: LDO converts USB 5 V to 3.3 V for ESP32 and DS3231; MAX98357A takes USB 5 V directly; all components share the same GND


Multiple Voltage Domains

The diagram above shows two voltage domains: a 3.3 V domain and a 5 V domain. This is completely normal. Different chips have different operating voltage requirements, and a single circuit often contains several voltage levels.

Why this works

The key rule is: all voltage domains share the same GND. As long as ground is common, each domain can operate at its own voltage independently. The ESP32's GPIO pins produce 3.3 V signals relative to the shared GND. The MAX98357A's amplifier operates at 5 V relative to the same shared GND. Both understand each other's signals because they agree on what "0 V" means.

When voltage domains interact: level shifters

Problems arise when a component in one voltage domain sends a signal to a component in another. If the MAX98357A drove a 5 V signal into an ESP32 GPIO input (rated for a maximum of 3.6 V), the ESP32 pin would be permanently damaged.

A level shifter is a small circuit that translates signals between voltage domains. The ESP32-FTS02 adapter board for the e-ink display includes one. The MAX98357A does not need one because its I2S input pins are 3.3 V tolerant — they correctly interpret the ESP32's 3.3 V signals even though the amp runs on 5 V.

The rule of thumb: check the datasheet for VIH (input voltage high) and absolute maximum voltage on any pin that crosses a voltage domain boundary.


3.3 V Logic Levels

The ESP32-S3's GPIO pins operate at 3.3 V logic. This means a pin interprets incoming voltages as either HIGH or LOW based on thresholds:

ConditionVoltage rangeWhat the pin reads
HIGH~2.0 V to 3.3 V1
LOW~0 V to 0.8 V0
Undefined0.8 V to 2.0 VUnpredictable — avoid this range

These thresholds come from the ESP32-S3 datasheet. The gap between 0.8 V and 2.0 V is the "undefined" zone where the chip might read either value — a noisy or slowly-changing signal that lingers here causes unreliable reads.

Why 5 V kills a 3.3 V input

The ESP32-S3 GPIO pins have an absolute maximum rating of approximately 3.6 V. Applying 5 V forces current through the chip's internal protection diodes in ways they are not designed to handle. The result is permanent, irreversible damage to that pin — and potentially to the entire chip.

Safe: 3.3 V signal → 3.3 V input. Always works.

Safe: 3.3 V signal → 5 V tolerant input (like the MAX98357A I2S pins). The 5 V chip is designed to correctly interpret 3.3 V as HIGH.

Not safe: 5 V signal → 3.3 V input. Destructive. Use a level shifter or choose a 3.3 V compatible component.


Where Does 3.3 V Come From? Voltage Regulators

USB provides 5 V. The ESP32 needs 3.3 V. Something has to convert one to the other.

The ESP32-S3 DevKitC-1 board has an onboard voltage regulator — specifically, a low-dropout regulator (LDO). It takes the 5 V from USB and outputs a stable 3.3 V. The "low-dropout" part means it can regulate even when the input voltage is only slightly above the output (the "dropout voltage" is typically ~0.5 V, so it works with inputs as low as ~3.8 V).

LDO voltage regulator: USB 5 V input on the left, 3.3 V output on the right, GND below

The regulator does not create or destroy energy. The voltage difference (5 V − 3.3 V = 1.7 V) is dissipated as heat. At 200 mA of current draw, that is 1.7 V×0.2 A=0.34 W1.7\ \text{V} \times 0.2\ \text{A} = 0.34\ \text{W} of heat — warm to the touch but nothing dangerous.

For a deeper treatment of different types of voltage regulators and how to choose one, see Essential Components: Voltage Regulators.


Summary

ConceptKey takeaway
CircuitA complete loop — current must have a path from source through components and back
VoltageA difference between two points, measured relative to GND
VCCThe positive supply voltage; can be different for different components
GNDThe shared 0 V reference; must be common across the entire circuit
Voltage domainsDifferent parts of a circuit can run at different voltages, sharing GND
Level shifterTranslates signals between voltage domains
Voltage regulatorConverts one voltage to another (e.g. 5 V → 3.3 V)