Source: https://mokxi.com/teachers/plans/printer-cnc-basics
Updated: 2026-11-11

Lesson plan

# 3D printer and CNC basics lesson plan

Learn what a printer’s firmware does underneath: homing, temperature control with safety, G-code motion and runout detection.

2 chapters, 4 lessons, about 4 hours, on the Arduino Uno R3. 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

- Find zero with an endstop, then move two axes from G-code lines.
- Hold a heater at temperature, catch a loose sensor and pause for empty spools.

### Materials for the whole unit

- Arduino Uno R3
- Filament lamp
- Full-size breadboard
- LED
- Limit switch, lever microswitch x 2
- MOSFET
- Photo interrupter, slot
- Piezo speaker
- Pushbutton
- Resistor x 4
- Slide switch
- Stepper driver, A4988 x 2
- Stepper motor, NEMA 17 x 2
- Thermistor, 10k NTC

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 2 h

## Motion

Find zero with an endstop, then move two axes from G-code lines.

Lesson | Time | What students do

Stepper homing How a printer finds zero: an A4988, a NEMA 17 and an endstop, a fast seek, a back-off and a slow second touch, then moves inside software limits. | 60 min

- Steps are not position
- Refuse to move blind
- You are the carriage
- Software endstops

A mini G-code interpreter Send G28, G0, G1 and M114 to a two-axis plotter line by line, and see what a firmware does with each one: home, interpolate, report, answer ok. | 60 min

- One line at a time
- Home first
- G28
- A straight diagonal

### Materials

- Arduino Uno R3
- Limit switch, lever microswitch x 2
- Stepper driver, A4988 x 2
- Stepper motor, NEMA 17 x 2

### Check for understanding

Each student finishes "A mini G-code interpreter" on their own, without opening the hints. The simulator checks 4 of its 4 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "A straight diagonal".

Chapter 2. About 2 h

## Printing safely

Hold a heater at temperature, catch a loose sensor and pause for empty spools.

Lesson | Time | What students do

Heated bed PID and thermal runaway A thermistor, a MOSFET and a PID loop that hold a bed at temperature, and the protection that switches the heater off when the reading stops following it. | 60 min

- What is real and what is modeled
- Heat the bed
- Drop the thermistor
- Break the wire

A filament runout sensor An optical runout sensor, a debounce, the filament still in the path after the sensor, and a pause that waits for new filament and a press of resume. | 60 min

- Where the sensor sits
- Load filament
- Run out
- Reload and resume

### Materials

- Arduino Uno R3
- Filament lamp
- Full-size breadboard
- LED
- MOSFET
- Photo interrupter, slot
- Piezo speaker
- Pushbutton
- Resistor x 4
- Slide switch
- Stepper driver, A4988
- Stepper motor, NEMA 17
- Thermistor, 10k NTC

### Check for understanding

Each student finishes "A filament runout sensor" on their own, without opening the hints. The simulator checks 4 of its 4 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Reload and resume".

Your class

## Teach this unit as a class

Start a class from this course and its 4 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.
