What you build
A desk word clock. An 11 x 10 face of letters, designed for this course, sits over a grid of LEDs. The Uno reads the time from a real-time clock, picks the words, lights the letters behind them and adds a dot for each minute between the fives. It dims at night, brightens by day, and plays an animation whenever the words change.
- The face: a WS2812 matrix, 16 x 10 and wired as a snake, on pin 6. The letters use the left 11 columns; the top row's last four LEDs are the minute dots.
- The clock: a DS3231 on I2C.
- The light meter: a BH1750 on I2C, address 0x23.
- The brain: an Arduino Uno.
The face:
ITKISATENOW
HALFQUARTER
TWENTYFIVEX
TOBPASTKONE
TWOTHREESIX
FOURFIVEJOY
SEVENEIGHTS
NINEELEVENX
TENTWELVEPM
MOKXIOCLOCK
The simulator shows the LEDs, not the letters in front of them, so every sketch also prints the lit face in the serial monitor.
How it works
Words as numbers. Each word is a row, a first column and a length. Saying the time is choosing words.
Five-minute rounding. minute / 5 gives a block from 0 to 11, and a switch picks the words: FIVE PAST, TEN PAST, QUARTER PAST and so on. From 35 past it counts down to the next hour. minute % 5 lights the dots.
A snake-wired panel. The LEDs run left to right on even rows and right to left on odd ones, so the LED behind a letter is y x 16 + x on even rows and y x 16 + 15 - x on odd ones.
Real time. The DS3231 keeps time on its own crystal and coin cell, drifting about a minute a year. Typing set 7:45 sets it.
Brightness by light. The BH1750 answers in lux, and the brightness is lux / 2, from 8 at night to 255 in daylight.
Animations. A sparkle of random letters and a wipe that sweeps the new words in, every five minutes.
The course
Build a word clock has six lessons, all on the same wiring:
- A letter grid: a face that holds every word, and finding words on it.
- Mapping words to LEDs: a word table, rounding, and a snake-wired panel.
- RTC time: the DS3231, and minute dots.
- Brightness by light: lux from a BH1750.
- Animations: sparkle and wipe.
- Project: a desk word clock: setting the time and a face of your own.
Every step is checked against the running circuit, apart from the last, where you design your own face and share the clock.