Source: https://mokxi.com/teachers/plans/tiny-mcus
Updated: 2026-11-19

Lesson plan

# Tiny chips: ATtiny85 and CH32V003 lesson plan

The eight-pin ATtiny85 and the ten-cent CH32V003 RISC-V: six pins and their fuses, an 8 KB budget with no multiplier, sleep and the watchdog for coin-cell life, I2C bit-banged by hand, a race between the two chips, and a twinkling star ornament.

3 chapters, 7 lessons, about 6 hours, on the ATtiny85. 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

- Why tiny, which pin does what, and what fits in 8 KB.
- Sleep for battery life, I2C by hand, and the RISC-V alternative.
- A coin-cell star ornament that twinkles and sleeps.

### Materials for the whole unit

- ATtiny85
- Full-size breadboard
- I/O expander, PCF8574
- LED x 2
- Potentiometer
- Pushbutton
- Resistor x 2
- WCH CH32V003 (RISC-V, 16 KB)

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

## Life in eight pins

Why tiny, which pin does what, and what fits in 8 KB.

Lesson | Time | What students do

Why tiny An eight-pin ATtiny85 on a coin cell’s 3 V: six I/O pins, 8 KB of flash, 512 bytes of SRAM, 8 MHz from its own oscillator, a serial port it makes itself, and two lamps blinking for about a dollar. | 45 min

- Run it: a whole computer in eight pins
- Two lamps, one port
- Why use a chip this small
- Up the tempo

Pins and fuses Six pins doing four jobs: a knob on the ADC, two PWM lamps, a button on the pin-change interrupt and a software serial port, plus the fuses that set the clock and can turn the RESET pin into a seventh. | 55 min

- Run it: the pin map
- Turn the knob
- Press the button
- The lamps are PWM
- Fuses

8 KB budgets Flash, SRAM and time on a chip with no multiplier: a temperature conversion in fixed point fits in 3.4 KB and runs 100 times in 144 microseconds; the same in floating point needs 7.3 KB and 1872 microseconds. | 45 min

- Run it: fixed point
- 512 bytes of SRAM
- No multiplier
- Try floating point

### Materials

- ATtiny85
- Full-size breadboard
- LED x 2
- Potentiometer
- Pushbutton
- Resistor x 2

### Check for understanding

Each student finishes "8 KB budgets" 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: "Try floating point".

Chapter 2. About 2 h 35 min

## Tiny chip skills

Sleep for battery life, I2C by hand, and the RISC-V alternative.

Lesson | Time | What students do

Sleep and wake A coin cell lasts as long as the chip sleeps: the watchdog wakes the ATtiny85 every half second to flash a lamp, the button wakes it at once, and the datasheet’s currents say 63 days, or 669 at eight seconds. | 55 min

- Run it: the sums first
- Asleep
- The watchdog alarm clock
- The button wakes it too
- Sleep longer

Bit-banged I2C I2C by hand on two ordinary pins: open drain by switching the pin direction, a START and a STOP, eight bits and an ACK, a scan that finds a PCF8574 at 0x20, and a byte written to its pins and read back. | 55 min

- Run it: a scan with no library
- Open drain, by hand
- Write a byte to eight pins
- Read it back
- Your own pattern

RISC-V for cents The ten-cent CH32V003, a 32-bit RISC-V at 48 MHz, races the ATtiny85 on the same CRC-32: 6.4 ms against 131 ms, the same answer, and what 32 bits and six times the clock buy you. | 45 min

- Run it: the same code on two chips
- The AVR finishes
- It blinks too
- Choosing between them

### Materials

- ATtiny85
- Full-size breadboard
- I/O expander, PCF8574
- LED x 2
- Pushbutton
- Resistor x 2
- WCH CH32V003 (RISC-V, 16 KB)

### Check for understanding

Each student finishes "RISC-V for cents" 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: "Choosing between them".

Chapter 3. About 1 h 5 min

## Boss project

A coin-cell star ornament that twinkles and sleeps.

Lesson | Time | What students do

Boss: a coin-cell star ornament A twinkling star ornament on an ATtiny85: two lamps twinkle at random in PWM, the button steps through twinkle, steady and off, and off is a deep sleep that only the button ends, with the battery sums from the datasheet. | 65 min

- Run it: a star that twinkles
- Twinkling
- Steady
- Off really is off
- Wake it up
- Make it yours

### Materials

- ATtiny85
- Full-size breadboard
- LED x 2
- Pushbutton
- Resistor x 2

### Check for understanding

Each student finishes "Boss: a coin-cell star ornament" 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 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.

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.
