Lessons and the learning game

Electrician math with Python

The electrician's everyday arithmetic as small Python programs on a Raspberry Pi, ending in a job calculator you build and extend.

What the course covers

Electrician math with Python is seven lessons, one chapter each, with a quiz after every chapter:

  1. Ohm's and Watt's laws: two laws as functions, a heater at 120 and 240 V, and a breaker picked at 125 percent.
  2. Voltage drop: the K formula, the 3 percent check, the smallest wire that meets it, and the longest run.
  3. Conduit fill: Chapter 9 areas, the 40, 31 and 53 percent rules, and mixed gauges.
  4. Box fill: conductor allowances, box volumes and the smallest box that fits.
  5. Load calculation: volt-amps per square foot, demand factors, fixed appliances, the service size and an EV charger.
  6. Motor tables: full-load current from the table, conductors at 125 percent, overloads from the nameplate and breakers at up to 250 percent.
  7. Boss: a job calculator: a command-line program that reads commands typed in the Serial Monitor, survives bad input, and takes a command you add yourself.

How it checks your work

Every lesson runs a main.py on a Raspberry Pi 4 in the page's Python engine, and each step checks what the program prints. Steps that ask you to write code are checked by running the code the step shows.

The code book

Every NEC figure in the course (table values, demand factors, fill percentages, box allowances) is informational and simplified for teaching. None of it replaces the code edition your jurisdiction has adopted, the manufacturer's instructions, or the inspector, and none of it is a design for real wiring. Wiring a building is licensed work.

Python from zero for the Python itself, Wire, fuses and breakers for what the numbers mean, and the Electrician capstone.