USB to 3.3 V
A USB-C breakout on a computer port feeds an AP2112K-3.3 low dropout regulator, which lights an LED at 3.3 V. There is no microcontroller in it: the simulator solves the 4 parts as a circuit, so it runs the moment you press Run, and nothing needs compiling.
Teaching? Assign it to your class in one click.
Beginner Runs in your browser. Free, and no account needed.
The parts retail for about $5.15. On Mokxi they're free.
How it works
There is no microcontroller in this one, so nothing is compiled: the simulator solves the circuit itself. The file in the editor is the notes that come with it.
// 3.3 V from USB with a low dropout regulator.
//
// There is no microcontroller here. Press Run and the simulator solves the
// circuit.
//
// WHAT IT IS. A USB-C power breakout plugged into a computer, 5 V on VBUS,
// into an AP2112K-3.3: the regulator most ESP32 boards make their 3.3 V with.
// Its output lights a red LED through 330 ohms.
//
// THE NUMBERS. The readout under the regulator says 3.30 V. The LED takes
// about 5 mA, and the regulator's own bias is 55 uA, so the port gives about
// as much as the load and no more: a linear regulator's input current is its
// output current.
//
// WHY A LOW DROPOUT PART. The AP2112K needs only 250 mV across itself at its
// full 600 mA. Change the model to AMS1117-3.3 in the regulator's properties:
// it still makes 3.3 V from 5 V, but it needs about a volt, so from a 3.7 V
// LiPo it could not. Try it: swap the USB part for a battery, kind lipo1000,
// and compare the two models.
//
// THINGS TO TRY. Set the breakout's source to charger; nothing changes, since
// the load is far under even a computer port's half an amp. Then put a 4.7
// ohm resistor across VBUS and GND: an amp from a computer port is more than
// it gives, and VBUS falls.
Parts list
5 parts, plus the jumper wires. They retail for about $5.15; on Mokxi they're free.
- 1 × Half breadboard
- 1 × USB power
- 1 × Voltage regulator
- 1 × Resistor, 330 Ω
- 1 × LED, red
How it is wired
4 connections, pin by pin, read from the circuit itself. Each line is one set of pins joined together, by a jumper wire or a breadboard strip.
- USB power pin VBUS; Voltage regulator pin IN
- Ground: USB power pin GND; Voltage regulator pin GND; LED, red pin C
- Voltage regulator pin OUT; Resistor, 330 Ω pin 1
- Resistor, 330 Ω pin 2; LED, red pin A
Change it and keep it
Open it in the editor, change the circuit or the code, and keep your version in a free account.