Tykun
Games

Small science games by Tykun

Sheet 02 · Game · live

Circuits

Build circuits from real parts and watch them work: lamps glow, batteries run down, and parts burn out.

Play Circuits Play it on a computer All the games Read the whole physics note

Fig. 1
Example 1, running: a battery, a switch and a bulb that glows.
Example 1, running: a battery, a switch and a bulb that glows.
Spec

What it needs

  • For a computer with a keyboard and a mouse. Phones and tablets aren’t supported yet.
  • The first visit downloads about 0.8 MB. After that, your browser keeps the files until the game is updated.
  • Your circuit is kept in this browser only. To keep a copy or take it to another computer, use Save file or Copy share link in the File menu.
  • It has sound: click the board to turn it on.
  • Tested in Chrome and Firefox, on Linux. Windows and Safari should work: they aren’t fully tested yet.
Procedure

How to play

You drag parts onto a board and wire them, and the circuit runs while you edit it. Point at a wire or a part to read its voltage and its current. Click a part and the Explain tab says what it is doing. To start, open one of the twenty examples from the Examples menu.

The twenty examples

  1. Battery, switch, lamp. Ohm’s law on a real bulb: its filament heats, its resistance rises 17-fold, the cold switch-on surges and the battery sags.
  2. Divider and its load. Why a meter changes what it reads: the same voltmeter reads the 1 MΩ divider 4.76% low and the 10 kΩ one 0.05% low.
  3. RC charge and discharge. τ = RC on the scope: 63% after one τ. Beside it, a current source fills a capacitor in a straight line until it reaches its voltage limit.
  4. RLC ringing, then the LC tank. Damping as the knob turns; with ideal parts the energy swings between the capacitor and the coil forever.
  5. RC filter on a sine. The −3 dB point, low-pass against high-pass, on the frequency graph.
  6. LEDs and their resistor. Each colour’s forward voltage, the resistor that sets the current, and an LED with no resistor that burns.
  7. 5 V power supply. AC to DC: a bridge rectifies, the electrolytic smooths, the Zener regulates.
  8. Transistor as a switch. A small base current runs a big lamp: 2.4 mA switches 100 mA.
  9. Two-transistor blinker. The classic flashing pair: two transistors take turns, each capacitor’s recharge setting the time.
  10. Common-emitter amplifier. A small signal made big (a gain of about −18.6), and clipping when the input is pushed.
  11. H-bridge and motor. A motor turned both ways by two switches, and four diodes that catch the coil’s kick.
  12. NAND from four MOSFETs. The same truth table as the chip beside it, and its analog switching point inside the chip’s thresholds.
  13. Op-amp amplifier and comparator. A gain set by two resistors (×11), then a Schmitt trigger that turns it into a square wave with two thresholds.
  14. Wien oscillator into a speaker. A pure tone you can hear, from a circuit that feeds back exactly a third of its output at one frequency.
  15. Gates and a 4-bit adder. Every basic gate with its switches and LEDs, then binary addition: the carry ripples through four full adders.
  16. Button counter on a 7-segment display. A bouncy button cleaned by an RC and a Schmitt input, then flip-flops counting 0 to 9 on a digit.
  17. Fluorescent tube, ballast and starter. Why a tube needs a high-voltage kick to light, and a ballast to hold its current once lit.
  18. Lamps in series and in parallel. Brightness and power, and why the textbook gets two unequal bulbs in series wrong.
  19. Calculator, one digit plus one digit. Thirteen push buttons, gates and flip-flops: key a digit, +, another, =, and the sum lights up on twenty-eight single LEDs, two to a segment.
  20. Storing energy: a flywheel and a battery. A supply spins a heavy flywheel and charges a battery; unplug it, and the flywheel keeps charging the battery.
Input

Controls

ActionKeys
Run or pauseSpace
One step (paused).
ResetShift+R
Slower · faster[ · ]
Rotate · flipR · F
DeleteDel, Backspace
Undo · redoCtrl+Z · Ctrl+Shift+Z, Ctrl+Y
Cut · copy · paste · select allCtrl+X · Ctrl+C · Ctrl+V · Ctrl+A
Save file · open fileCtrl+S · Ctrl+O
Text label · Explain · Where does the current go?T · E · W
Open a block · close it, cancelEnter · Esc
Move the selection (Shift: by 5)←↑↓→ · Shift+←↑↓→
Zoom in · out · fit+ · - · 0
Keyboard shortcutsH
Fig. 2
Example 3 on the scope: a capacitor charging through a resistor.
Example 3 on the scope: a capacitor charging through a resistor.
Fig. 3
Click a part and the Explain tab says what it is doing: here, example 8’s transistor.
Click a part and the Explain tab says what it is doing: here, example 8’s transistor.
Theory

The science in it

Two laws do most of the work. The currents entering any point of a circuit add up to zero, and the voltages around any loop add up to zero: these are Kirchhoff’s laws. The game writes them for the whole circuit and solves for every voltage at once, again at each step in time.

Some parts carry a physics of their own. A lamp’s filament heats up and its resistance rises with it. A battery gives less when you draw hard, and recovers at rest. Every part heats, and one held over its limit burns out.

Each of the twenty examples is held to a reference, a textbook formula or the ngspice simulator, within about 1 %.