Lesson plan

Systems of boards lesson plan

Designs that use more than one processor: why to split work, UART links between Unos, an addressed shared bus, SPI with a slave in software, a Raspberry Pi and an Uno together, framed protocols with CRCs and retries, and a rover with a display coprocessor.

4 chapters, 7 lessons, about 7 hours, on the Arduino Uno R3. Every lesson runs in the browser, with nothing to install.

The unit

Objectives and materials

By the end, students can

  • What a second processor buys, and the simplest link.
  • An addressed shared bus, SPI, and a Pi with a microcontroller.
  • Frames, CRCs, acknowledgments and retries.
  • A rover with a brain and a display coprocessor.

Materials for the whole unit

  • Arduino Uno R3 x 3
  • Character LCD with I2C backpack
  • Diode x 2
  • LED
  • Potentiometer x 2
  • Pushbutton
  • Raspberry Pi 4 Model B
  • Resistor 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 1 h 50 min

Why more than one

What a second processor buys, and the simplest link.

LessonTimeWhat students do
Why split workOne Uno crunching numbers between looks at a button counts 1 press of 5; a second Uno with nothing else to do counts all 5. What a second processor buys, and what it costs.55 min
  1. Two boards, one button
  2. The helper counts every press
  3. The brain misses them
  4. Reasons to split
  5. Smaller blocks
  6. What splitting costs
UART between MCUsTwo Unos on a crossed software serial link: ground control asks TEMP?, the probe answers with tenths of a degree, every reply checked before it is trusted, and what a baud mismatch looks like.55 min
  1. A crossed link
  2. Ask and answer
  3. The other side
  4. A cold reading
  5. Trust nothing
  6. A baud mismatch

Materials

  • Arduino Uno R3 x 2
  • Potentiometer
  • Pushbutton

Check for understanding

Each student finishes "UART between MCUs" 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 baud mismatch".

Chapter 2. About 2 h 55 min

Buses between boards

An addressed shared bus, SPI, and a Pi with a microcontroller.

LessonTimeWhat students do
A shared bus with addressesOne master, two nodes, one return wire: nodes answer through diodes onto a pulled-up line, each only when its address is called. The idea under I2C target mode, built where Mokxi can run it.55 min
  1. Three boards, one bus
  2. Called by address
  3. An address from a jumper
  4. Each node its own reading
  5. Wired-AND
  6. Call a node that is not there
SPI master and slaveSPI between two Unos: a bit-banged master at 10 kHz and a slave written in software on two interrupts, one byte each way per transfer, and the one-transfer lag every SPI slave has.55 min
  1. Four wires and a clock
  2. A reading over SPI
  3. The slave’s side
  4. Turn the slave’s knob
  5. Software has a speed limit
  6. In volts
Pi plus microcontrollerA Raspberry Pi as the SPI master in Python with spidev, the Uno as the software slave, and a resistor divider so 5 V never reaches a 3.3 V pin. Linux for the thinking, a microcontroller for the timing.65 min
  1. A Pi as the master
  2. The same protocol in Python
  3. The slave cannot tell
  4. 5 V meets 3.3 V
  5. Full scale
  6. A slower clock
  7. Who does what

Materials

  • Arduino Uno R3 x 3
  • Diode x 2
  • Potentiometer x 2
  • Raspberry Pi 4 Model B
  • Resistor x 2

Check for understanding

Each student finishes "Pi plus microcontroller" on their own, without opening the hints. The simulator checks 7 of its 7 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Who does what".

Chapter 3. About 1 h 5 min

Protocols

Frames, CRCs, acknowledgments and retries.

LessonTimeWhat students do
Shared protocolsPackets instead of lines: a start byte, sequence number, type, length, payload and CRC-8. The receiver ACKs or NAKs, a damaged packet is caught and sent again, and the retry limit decides when to give up.65 min
  1. Frames
  2. ACK
  3. Every frame its own CRC
  4. Damage a frame
  5. Try again
  6. No retries
  7. A protocol is a promise

Materials

  • Arduino Uno R3 x 2
  • Potentiometer
  • Pushbutton

Check for understanding

Each student finishes "Shared protocols" on their own, without opening the hints. The simulator checks 7 of its 7 steps as they go.

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

Chapter 4. About 1 h 15 min

Boss project

A rover with a brain and a display coprocessor.

LessonTimeWhat students do
Boss: a coprocessor displayA rover split in two: the brain reads its range sensor, picks CRUISE, SLOW or STOP and drives the motor; a dashboard coprocessor draws its status on an LCD and sends a park command, all in framed, checked packets.75 min
  1. The rover’s brain
  2. The dashboard
  3. On the screen
  4. Something ahead
  5. The dashboard follows
  6. Park
  7. A safer stop
  8. Make it yours

Materials

  • Arduino Uno R3 x 2
  • Character LCD with I2C backpack
  • LED
  • Potentiometer
  • Pushbutton
  • Resistor

Check for understanding

Each student finishes "Boss: a coprocessor display" on their own, without opening the hints. The simulator checks 8 of its 8 steps as they go.

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

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.