Lesson plan

Build receipt printer gadgets lesson plan

Drive a thermal receipt printer from an Uno: ESC/POS bytes, 1-bit bitmaps, a fortune button, a to-do list, ASCII art and a daily brief.

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

  • The commands a printer understands, and pictures one bit per dot.
  • A fortune button, a to-do printer and a photo booth of text.
  • Put it all together into one press that prints your day.

Materials for the whole unit

  • Arcade button
  • Arduino Uno R3
  • Thermal receipt printer

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

Bytes on paper

The commands a printer understands, and pictures one bit per dot.

LessonTimeWhat students do
Printer commandsTalk to a receipt printer in its own bytes: text, line feeds, and ESC/POS commands for bold, centering, size, feeding and the paper sensor.60 min
  1. Hello from bytes
  2. ESC means a command
  3. Center
  4. Big letters
  5. Feed the paper
  6. Is there paper?
Text and bitmapsPictures for a print head: one bit per dot, eight dots to a byte, a 16 x 16 icon in 32 bytes, sent as a raster.50 min
  1. One bit per dot
  2. The raster header
  3. Print it
  4. Flip every bit
  5. Bits as text

Materials

  • Arcade button
  • Arduino Uno R3
  • Thermal receipt printer

Check for understanding

Each student finishes "Text and bitmaps" 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: "Bits as text".

Chapter 2. About 2 h 20 min

Gadgets

A fortune button, a to-do printer and a photo booth of text.

LessonTimeWhat students do
A fortune buttonOne press, one ticket: a debounced arcade button, a numbered fortune, and a shuffled deck so no fortune repeats before all have been dealt.40 min
  1. The button
  2. A ticket
  3. Paper counts
  4. A deck, not dice
A to-do printerKeep a list in a two-dimensional char array, change it over serial, and print it as a checklist you can tick with a pen.50 min
  1. A list in 200 bytes
  2. Add an item
  3. Tick one off
  4. Print it
  5. Check the list
A tiny photo booth of textTurn brightness into characters: a ten-step ramp from space to @, a face worked out row by row, contrast and a negative, on paper.50 min
  1. Characters are gray
  2. Say cheese
  3. On paper
  4. Contrast
  5. Negative

Materials

  • Arcade button
  • Arduino Uno R3
  • Thermal receipt printer

Check for understanding

Each student finishes "A tiny photo booth of text" 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: "Negative".

Chapter 3. About 1 h

A daily brief

Put it all together into one press that prints your day.

LessonTimeWhat students do
Project: a daily briefPut it all together: one press prints the day, a little weather picture, your to-do list and a fortune.60 min
  1. Your morning, on paper
  2. Which day
  3. The weather
  4. The list
  5. Press for the day
  6. Make it yours

Materials

  • Arcade button
  • Arduino Uno R3
  • Thermal receipt printer

Check for understanding

Each student finishes "Project: a daily brief" 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: "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.