Source: https://mokxi.com/teachers/plans/electrician-math-with-python
Updated: 2026-11-19

Lesson plan

# 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.

7 chapters, 7 lessons, about 5 hours, on the Raspberry Pi 4 Model B. Every lesson runs in the browser, with nothing to install.

Start a class from this course

The unit

## 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.

Chapter 1. About 45 min

## 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 Python Turn 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

- Run it: two laws, two functions
- Amps from a nameplate
- Twice the volts, half the amps
- The element's resistance
- Pick the breaker
- A whole job at once

### 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".

Chapter 2. About 45 min

## Voltage drop

The K formula, the 3 percent check and the longest run.

Lesson | Time | What students do

Voltage drop in Python The 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

- Run it: the K formula
- Flag it
- Try bigger wire
- Let the program choose
- At 240 V
- The longest run

### 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".

Chapter 3. About 40 min

## Conduit fill

Chapter 9 areas and the 40, 31 and 53 percent rules.

Lesson | Time | What students do

Conduit fill in Python Add 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

- Run it: the wires' area
- Pick the conduit
- Ten wires
- Mixed gauges
- The one- and two-wire rules

### 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".

Chapter 4. About 40 min

## Box fill

Allowances, volumes and the smallest box that fits.

Lesson | Time | What students do

Box fill in Python Count 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

- Run it: count the allowances
- Does it fit?
- Bigger wire, more room
- Let it pick the box
- Two devices

### 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".

Chapter 5. About 40 min

## Load calculation

Volt-amps, demand factors and the service size.

Lesson | Time | What students do

Load calculation in Python A 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

- Run it: the base load
- The demand factor
- Add the appliances
- Size the service
- Add an EV charger

### 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".

Chapter 6. About 45 min

## Motor tables

Table FLC, 125 percent wire, 250 percent breakers.

Lesson | Time | What students do

Motor tables in Python Look 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

- Run it: look up the FLC
- The conductors
- The overload
- The breaker
- One function for any motor
- Not in the table

### 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".

Chapter 7. About 45 min

## Boss build

A command-line job calculator on the Pi.

Lesson | Time | What students do

Boss: a job calculator Put 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

- Run it: the calculator
- Voltage drop
- A motor circuit
- Conduit and box
- Survive bad input
- Add a command

### 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".

Your class

## 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.

Start a class from this course See the demo class

More units

## Other lesson plans

Electronics basics 20 lessons, about 10 h. Embedded on the Arduino Uno 16 lessons, about 12 h. Embedded on the ESP32-C3 13 lessons, about 11 h. Embedded on the Raspberry Pi Pico 7 lessons, about 6 h. Build your own fight stick 5 lessons, about 4 h. Embedded on the STM32F411 6 lessons, about 6 h. C++ on a board 13 lessons, about 10 h. Digital logic and memory 4 lessons, about 4 h. Interactive devices on the Uno 9 lessons, about 8 h. From gates to a computer 23 lessons, about 16 h. Build a claw machine 8 lessons, about 6 h. Every unit All the courses as ready-made units, on the teachers page.
