Lesson plan

Build a drink mixer lesson plan

Build a mocktail mixer on an Uno: four pumps on relays, calibrated pours, recipes in flash, an LCD menu and a cleaning cycle.

3 chapters, 6 lessons, about 5 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

  • Switch pumps safely, and turn time into milliliters.
  • Recipes in flash, a menu on an LCD, and a cleaning cycle.
  • Put it all together into a machine worth sharing.

Materials for the whole unit

  • Arduino Uno R3
  • Character LCD, 20x4, with I2C backpack
  • Keypad, 4x4
  • Mini water pump x 4
  • Relay board, four channels

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 30 min

Pumps and pours

Switch pumps safely, and turn time into milliliters.

LessonTimeWhat students do
Pumps and relaysSwitch four pumps with an active-low relay board, learn why a motor needs a diode across it, and add a safety limit no command can override.45 min
  1. A mocktail machine
  2. A relay runs the pump
  3. Active low
  4. The diode
  5. A safety limit
Measured poursA pump moves a steady amount each second, so a pour is a time: ml divided by ml per second, calibrated pump by pump with a measuring jug.45 min
  1. Time is volume
  2. Pour 50 ml
  3. Done on time
  4. Calibrate
  5. A better pour

Materials

  • Arduino Uno R3
  • Character LCD, 20x4, with I2C backpack
  • Keypad, 4x4
  • Mini water pump x 4
  • Relay board, four channels

Check for understanding

Each student finishes "Measured pours" 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: "A better pour".

Chapter 2. About 2 h 35 min

The machine

Recipes in flash, a menu on an LCD, and a cleaning cycle.

LessonTimeWhat students do
RecipesKeep a table of recipes as structs in flash with PROGMEM, copy one out when it is needed, and pour every bottle at once.45 min
  1. Recipes as data
  2. Read them out
  3. Make one
  4. All at once
  5. Ready
A menuA 20x4 LCD and a keypad: one number for the recipe on show, two states, and a stop key that always works.55 min
  1. The menu
  2. Down the list
  3. Wrap around the top
  4. Pour
  5. The stop key
  6. Ready
Cleaning cycleRun warm water through every line in turn with a small state machine, stop it any time, and count drinks to ask for a clean.55 min
  1. Clean every time
  2. Start the cycle
  3. One after another
  4. Done
  5. Stop it
  6. A reminder

Materials

  • Arduino Uno R3
  • Character LCD, 20x4, with I2C backpack
  • Keypad, 4x4
  • Mini water pump x 4
  • Relay board, four channels

Check for understanding

Each student finishes "Cleaning cycle" 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 reminder".

Chapter 3. About 1 h

A mocktail bar

Put it all together into a machine worth sharing.

LessonTimeWhat students do
Project: a mocktail barPut it all together: a menu, two glass sizes, parallel pours, a drink counter and a cleaning cycle on one machine.60 min
  1. Bar open
  2. Choose
  3. A bigger glass
  4. Pour a Sunrise
  5. Count the drinks
  6. Clean up
  7. Make it yours

Materials

  • Arduino Uno R3
  • Character LCD, 20x4, with I2C backpack
  • Keypad, 4x4
  • Mini water pump x 4
  • Relay board, four channels

Check for understanding

Each student finishes "Project: a mocktail bar" 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: "Make it yours".

Your class

Teach this unit as a class

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