Electrician math with Python lesson plan
The arithmetic of the trade as Python programs on a Raspberry Pi: Ohm's and Watt's laws, voltage drop, conduit fill, box fill, a load calculation, motor tables, and a job calculator you build and extend.
Objectives and materials
By the end, students can
- Two laws as functions, and a breaker picked at 125 percent.
- The K formula, the 3 percent check and the longest run.
- Chapter 9 areas and the 40, 31 and 53 percent rules.
- Allowances, volumes and the smallest box that fits.
- Volt-amps, demand factors and the service size.
- Table FLC, 125 percent wire, 250 percent breakers.
- A command-line job calculator on the Pi.
Materials for the whole unit
- Raspberry Pi 4 Model B
Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.
Ohm's and Watt's laws
Two laws as functions, and a breaker picked at 125 percent.
| Lesson | Time | What students do |
|---|---|---|
| Ohm's and Watt's laws in PythonTurn I = V / R and P = V x I into Python functions, size a 1500 W heater at 120 and 240 V, find its element's resistance, and pick its breaker with the 125 percent rule. | 45 min |
|
Materials
- Raspberry Pi 4 Model B
Check for understanding
Each student finishes "Ohm's and Watt's laws in Python" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "A whole job at once".
Voltage drop
The K formula, the 3 percent check and the longest run.
| Lesson | Time | What students do |
|---|---|---|
| Voltage drop in PythonThe electrician's VD = 2KIL / CM formula as a function, the 3 percent recommendation as an if, a loop that finds the smallest wire that meets it, 240 V against 120 V, and the longest run a wire allows. | 45 min |
|
Materials
- Raspberry Pi 4 Model B
Check for understanding
Each student finishes "Voltage drop in Python" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "The longest run".
Conduit fill
Chapter 9 areas and the 40, 31 and 53 percent rules.
| Lesson | Time | What students do |
|---|---|---|
| Conduit fill in PythonAdd up THHN conductor areas from NEC Chapter 9 Table 5, compare them with 40 percent of EMT's area from Table 4, let a function pick the trade size, mix gauges, and code the one- and two-wire rules. | 40 min |
|
Materials
- Raspberry Pi 4 Model B
Check for understanding
Each student finishes "Conduit fill in Python" on their own, without opening the hints. The simulator checks 5 of its 5 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "The one- and two-wire rules".
Box fill
Allowances, volumes and the smallest box that fits.
| Lesson | Time | What students do |
|---|---|---|
| Box fill in PythonCount conductor allowances the NEC 314.16 way with a function and keyword arguments, compare with a box's volume, see what 12 AWG costs, and let a list of boxes pick the smallest that fits. | 40 min |
|
Materials
- Raspberry Pi 4 Model B
Check for understanding
Each student finishes "Box fill in Python" on their own, without opening the hints. The simulator checks 5 of its 5 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Two devices".
Load calculation
Volt-amps, demand factors and the service size.
| Lesson | Time | What students do |
|---|---|---|
| Load calculation in PythonA simplified dwelling load calculation as a program: volt-amps per square foot, kitchen and laundry circuits, the demand factor as a function, fixed appliances from a dict, the service size, and what an EV charger does to it. | 40 min |
|
Materials
- Raspberry Pi 4 Model B
Check for understanding
Each student finishes "Load calculation in Python" on their own, without opening the hints. The simulator checks 5 of its 5 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Add an EV charger".
Motor tables
Table FLC, 125 percent wire, 250 percent breakers.
| Lesson | Time | What students do |
|---|---|---|
| Motor tables in PythonLook up a motor's full-load current from NEC Table 430.248 with a tuple-keyed dict, size its conductors at 125 percent, its overload from the nameplate, its breaker at up to 250 percent, and handle a motor the table does not have. | 45 min |
|
Materials
- Raspberry Pi 4 Model B
Check for understanding
Each student finishes "Motor tables in Python" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Not in the table".
Boss build
A command-line job calculator on the Pi.
| Lesson | Time | What students do |
|---|---|---|
| Boss: a job calculatorPut the course in one Python program: a command-line calculator on the Pi that reads commands typed in the Serial Monitor for voltage drop, conduit fill, box fill and motor circuits, survives bad input, and takes a new command you add yourself. | 45 min |
|
Materials
- Raspberry Pi 4 Model B
Check for understanding
Each student finishes "Boss: a job calculator" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Add a command".
Teach this unit as a class
Start a class from this course and its 7 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.
The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.