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.

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.

LessonTimeWhat 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
  1. Run it: two laws, two functions
  2. Amps from a nameplate
  3. Twice the volts, half the amps
  4. The element's resistance
  5. Pick the breaker
  6. 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.

LessonTimeWhat 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
  1. Run it: the K formula
  2. Flag it
  3. Try bigger wire
  4. Let the program choose
  5. At 240 V
  6. 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.

LessonTimeWhat 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
  1. Run it: the wires' area
  2. Pick the conduit
  3. Ten wires
  4. Mixed gauges
  5. 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.

LessonTimeWhat 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
  1. Run it: count the allowances
  2. Does it fit?
  3. Bigger wire, more room
  4. Let it pick the box
  5. 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.

LessonTimeWhat 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
  1. Run it: the base load
  2. The demand factor
  3. Add the appliances
  4. Size the service
  5. 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.

LessonTimeWhat 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
  1. Run it: look up the FLC
  2. The conductors
  3. The overload
  4. The breaker
  5. One function for any motor
  6. 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.

LessonTimeWhat 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
  1. Run it: the calculator
  2. Voltage drop
  3. A motor circuit
  4. Conduit and box
  5. Survive bad input
  6. 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.