Source: https://mokxi.com/teachers/plans/model-railroad
Updated: 2026-11-11

Lesson plan

# Model railroad electronics lesson plan

Throw turnouts, run a level crossing, follow a train with block signals and drive a DC loco with momentum, all from an Uno.

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

- Move turnouts from a panel and run a crossing that follows a train.
- Signal by block occupancy and drive a DC locomotive smoothly.

### Materials for the whole unit

- Arduino Uno R3
- DC motor
- Full-size breadboard
- Hobby servo x 2
- LED x 4
- Motor driver, TB6612FNG
- Photo interrupter, slot x 3
- Piezo speaker
- Potentiometer
- Pushbutton x 2
- Resistor x 4
- Slide switch
- Two-color LED, KY-011 x 2

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

## Trackside animation

Move turnouts from a panel and run a crossing that follows a train.

Lesson | Time | What students do

Servo turnouts and a panel Throw two turnouts from a panel with slow-motion servos, route lamps that blink while the points travel, and positions that survive a power cut. | 60 min

- A servo under every turnout
- Power up where it was
- Throw turnout 1
- Throw it from a computer

A level crossing Two beam detectors, alternating red lamps, a bell and a gate that waits before it falls: a crossing that follows a train from one side to the other. | 60 min

- The sequence
- A train from the west
- The gate comes down
- The train clears

### Materials

- Arduino Uno R3
- Full-size breadboard
- Hobby servo x 2
- LED x 4
- Photo interrupter, slot x 2
- Piezo speaker
- Pushbutton x 2
- Resistor x 4

### Check for understanding

Each student finishes "A level crossing" 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: "The train clears".

Chapter 2. About 2 h

## Running trains

Signal by block occupancy and drive a DC locomotive smoothly.

Lesson | Time | What students do

Block signals Two searchlight signals that show red, yellow or green from the blocks ahead, and how spot detectors stand in for track current detection. | 60 min

- Blocks and aspects
- All clear
- A train enters block A
- The train moves on

A DC throttle with momentum PWM speed control of a DC locomotive through a TB6612, momentum that makes it feel heavy, a brake, and a direction change only at a standstill. | 60 min

- DC, and where DCC differs
- Open the throttle
- Brake
- Reverse at a standstill

### Materials

- Arduino Uno R3
- DC motor
- Full-size breadboard
- Motor driver, TB6612FNG
- Photo interrupter, slot x 3
- Potentiometer
- Pushbutton
- Resistor x 2
- Slide switch
- Two-color LED, KY-011 x 2

### Check for understanding

Each student finishes "A DC throttle with momentum" 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: "Reverse at a standstill".

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.
