Source: https://mokxi.com/teachers/plans/pocket-pet
Updated: 2026-11-11

Lesson plan

# Build a pocket pet lesson plan

A Tamagotchi-style pet on an OLED: a screen, buttons, stats, a clock and a memory, ending with Pip.

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

- A screen to live on and buttons to talk to it with.
- Stats that fall, a clock that counts pet minutes, and growing up.
- Save the pet in EEPROM, then meet the whole thing.

### Materials for the whole unit

- Arduino Uno R3
- Full-size breadboard
- OLED display, 128x64
- Piezo speaker
- Pushbutton x 3

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

## A home for a pet

A screen to live on and buttons to talk to it with.

Lesson | Time | What students do

A face for your pet Wake a 128x64 OLED over two wires, write on it, and draw a pixel-art egg from flash. The first thing any pet needs is somewhere to live. | 40 min

- Two wires to a screen
- Words are drawings too
- Pixel art from flash
- Make it wobble

Three buttons and a menu SELECT, CONFIRM and CANCEL with no resistors to fit, a menu of six icons, and why a button needs debouncing. | 40 min

- Buttons with no resistors
- SELECT moves along
- CONFIRM picks it
- CANCEL backs out

### Materials

- Arduino Uno R3
- Full-size breadboard
- OLED display, 128x64
- Piezo speaker
- Pushbutton x 3

### Check for understanding

Each student finishes "Three buttons and a menu" 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: "CANCEL backs out".

Chapter 2. About 1 h 20 min

## A life in numbers

Stats that fall, a clock that counts pet minutes, and growing up.

Lesson | Time | What students do

A pet made of numbers Food, joy and rest that fall a little every pet minute on a millis() clock, and buttons that put them back. | 40 min

- Three numbers
- Time makes it hungry
- Feed it
- Play costs rest

Growing up and going to bed A clock that counts pet minutes, an egg that hatches, a baby that grows into a kid, and a pet that gets sleepy. | 40 min

- One knob for time
- Stages of life
- Sleepy time
- Lights out

### Materials

- Arduino Uno R3
- Full-size breadboard
- OLED display, 128x64
- Piezo speaker
- Pushbutton x 3

### Check for understanding

Each student finishes "Growing up and going to bed" 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: "Lights out".

Chapter 3. About 1 h 20 min

## Remember, then play

Save the pet in EEPROM, then meet the whole thing.

Lesson | Time | What students do

A pet that remembers you Keep the pet in the Uno EEPROM as one struct with a magic number, save when something happens, and find it again after a reset. | 40 min

- Memory that stays
- Save when it matters
- Press reset
- A fresh start

Meet Pip Everything together: hatching, feeding, two mini-games, cleaning up, medicine, sleep and a pet that remembers you. | 40 min

- Hatch
- Dinner time
- Play a game
- It remembers you

### Materials

- Arduino Uno R3
- Full-size breadboard
- OLED display, 128x64
- Piezo speaker
- Pushbutton x 3

### Check for understanding

Each student finishes "Meet Pip" 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: "It remembers you".

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.

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.
