Breadboard power supply
A breadboard power supply is a small module that plugs into a breadboard's power rails and gives them clean 5 V and 3.3 V from a barrel-jack or USB input. The shop's part, for $5, is an MB102-style board with an AMS1117 regulator: 5 V and 3.3 V outputs, an on/off switch, and enough current for hungry parts — motors, LED strips and relay coils — that the Pi's own pins should not feed. It is a supply, not a device: it has no data pins and takes no commands, so the reference here covers wiring and ratings rather than software.
Pins
| Pin | What it is | Type |
|---|---|---|
| 5V | 5 V output | io |
| 3V3 | 3.3 V output (AMS1117) | io |
| GND | Ground | ground |
| Setting | Type | Range | Default |
|---|---|---|---|
switch | enum | on, off | on |
PowerSupply()— Breadboard power supply — $5- Pins: 3
5V and 3V3 are outputs (the table's ranges are the current budgets the simulator warns over), and GND is their shared ground. There is also a physical on/off switch; in the simulator it is the PowerSupply switch setting ("on" by default). Because the board is placed rather than chained, wire each rail by name.
Wiring it in circuit.py
This page has no runnable circuit.py/main.py example pair: the supply is passive, so a program cannot interact with it, and a pair would only re-test wiring the other pages already cover. The wiring that matters is the ground join:
from wiring import *
pi = Pi()
psu = PowerSupply()
psu.gnd >> pi.GND # a shared ground is not optional
motor = Motor()
motor.v12 >> psu.v5 # the motor's supply comes from its own rail
motor.v5 >> psu.v5
motor.gnd >> psu.gnd # and returns to the supply's ground, not the Pi's
This is the pattern for anything power-hungry: its supply comes from the power supply, its ground joins the common one, and only the signal wires run to the Pi. Without the ground join the signal has no reference and everything behaves erratically.
Driving it in main.py
Nothing to drive: the supply has no software interface. main.py drives the parts it powers — Motor(...), OutputDevice(...) — exactly as if they were fed from the Pi, because the simulator computes one circuit either way. What changes is which pin budgets the current lands in: the supply's 5 V output has a 700 mA budget and its 3.3 V output 800 mA, while the Pi's own rails are smaller. Loads fed past a budget raise budget warnings and fail the judge's damage check.
Electrical notes
- Model: two sources, 5 V behind 0.25 Ω and 3.3 V behind 0.15 Ω, so the outputs sag slightly under load — a real AMS1117 board does the same. Both outputs carry one fixed deviation within ±1 % (the feed's
outputTolerancePct). - The 3.3 V rail comes from an AMS1117 regulator; the input is 6.5–12 V on the barrel jack (some boards also accept USB). The simulator does not model the input voltage or the regulator's dropout.
- Budgets: 700 mA on 5 V, 800 mA on 3.3 V. The AMS1117 gets hot above about 500 mA and an MB102's traces are thin — treat those numbers as ceilings, not comfort zones.
- Never connect its 5 V output to the Pi's 5 V pins while the Pi is powered over USB. Two supplies will fight. Join the grounds only.
- Join grounds always. A supply and the Pi that share only a signal wire do not share a voltage reference.
Simulator vs real hardware
- The model is two Norton sources (nominal voltage through a small series resistance) switched together by the
switchsetting; off means the outputs are open. There is no input jack, no reverse-polarity protection, no thermal model and no fuse — the real board has a PTC fuse and an input LED. - Unlike the Pi's rails, each output declares a current budget, and the simulator warns when a rail's delivered current exceeds it. The Pi's 3V3 rail is budgeted too, so moving a heavy part to the supply's 5 V is a measurable improvement, not just tidier wiring.
- The board is drawn as a part but is a real electrical node, so current from it reaches parts exactly as the circuit graph says. Modules and kits built on the board work the same.
- In Lab mode you can give the part a label and place it anywhere; its pins export like any other part, so custom modules can chain off it.
Going deeper
- Primer: voltage, current and Ohm's law — what the sag and budgets mean.
- Parts that want their own rail: DC motor + L298N, relay module, stepper + ULN2003.
- The Pi's own header and its limits: GPIO header primer.
Further reading
- AMS1117 datasheet (Advanced Monolithic Systems, via LCSC) — the 3.3 V regulator on the board.
- Raspberry Pi 4 datasheet — what the Pi itself wants, and why two supplies must not meet.
- SparkFun: How to Use a Breadboard — Providing Power — breadboard power options and rails.