Ohm's law, proved by the circuit above
- 192parts on the bench
- 25boards running now
- 1.00xreal time, on every board
Ohm's law says the current through a resistor is the voltage across it divided by its resistance: I = V / R. That is the whole law. The circuit above is the smallest thing that shows it doing real work.
Start at the switch. In position 1 it closes the loop: 5 V from the supply, through the switch, through a 220 ohm resistor, into the LED, and back to ground. Nothing here is a symbol standing in for the math. The resistor in Mokxi is a true two-terminal part: whatever is on one pin, the other pin is that voltage plus the drop I times R, and the kernel solves every part on the net together until the numbers agree.
The LED complicates the loop a little, in a useful way. It is not a resistor. It holds close to its forward voltage (about 1.7 V for a red one at this current), and then takes whatever current the rest of the loop can push through it. So the 5 V does not split across the resistor and the LED in proportion to their resistance; the LED takes its 1.7 V first, and Ohm's law only has to answer for what happens to the remaining 3.3 V across the 220 ohm resistor. I = V / R = 3.3 V / 220 ohm, which is about 15 mA. That is the number the LED actually lights at, and it is bright and safe. The drop is not quite fixed either: it climbs with the current, which is why the same LED reads 1.6 V at 8 mA and 1.8 V at 20.
Open this circuit in the editor and change the resistor's value in the properties panel while it runs. Raise it and the current drops in direct proportion, exactly as the law says, and the LED visibly dims. Lower it toward zero and the current climbs without limit, because Mokxi's resistor has no destructive failure mode: it will report a current a real resistor could not survive rather than pretending the LED burned out. That is a fair trade for a circuit you can push past its real limits without losing anything.
The pushbutton pull-down elsewhere on this site (see the pull-up resistor page) is the same law again: a 10 kilohm resistor between a net and ground draws 5 V / 10 kilohm, half a milliamp, which is small enough to disappear next to anything else on that net and large enough to hold the net at a real zero. One law, two very different jobs.
Want the step-by-step version? The lesson "A first circuit" walks through this with checkpoints.
Open the lessonKeep going
Build this for real
Open the editor, change a value and watch the number move with it. Nothing to install, and no account needed.