Source: https://mokxi.com/teachers/plans/build-moon-phase-lamp
Updated: 2026-11-19

Lesson plan

# Build a moon phase lamp lesson plan

Learn why the Moon has phases, work them out from any date, and build a lamp that shows tonight's Moon in the dark.

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

- Why the Moon has phases, and the sum that finds them.
- Draw the Moon on LEDs, keep the date and see the night.
- Put it all together into a lamp worth sharing.

### Materials for the whole unit

- Addressable RGB LEDs
- Arduino Uno R3
- Light sensor
- Real-time clock, DS3231
- Resistor x 2

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

## The Moon in the sky

Why the Moon has phases, and the sum that finds them.

Lesson | Time | What students do

The lunar cycle Watch a whole synodic month in fifteen seconds on 64 LEDs, learn why the Moon has phases, and stop the clock on any day you like. | 50 min

- A month in fifteen seconds
- Why the Moon has phases
- Stop the clock
- Jump to full moon
- Half lit is not half a month
- The last quarter

Phase from a date Work out the Moon on any date from one known new moon and the length of the month: day counting, a remainder, and a trap in C. | 50 min

- One new moon and a ruler
- Find a full moon
- And a new one
- Counting days is the hard part
- The Moon at Tranquility Base
- Your own date

### Materials

- Addressable RGB LEDs
- Arduino Uno R3
- Light sensor
- Real-time clock, DS3231
- Resistor x 2

### Check for understanding

Each student finishes "Phase from a date" 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: "Your own date".

Chapter 2. About 2 h 20 min

## Light, time and dark

Draw the Moon on LEDs, keep the date and see the night.

Lesson | Time | What students do

LEDs as a moon Draw any phase on an 8x8 WS2812B panel: a disc of 52 LEDs, the shadow edge from one cosine per row, and panels that zigzag. | 50 min

- A disc of 52 LEDs
- The shadow edge
- A thin crescent
- Nothing to see
- Waning
- Panels that zigzag

RTC time Read a DS3231 register by register: binary coded decimal, the oscillator stop flag, setting the time and a leap day, then the Moon from the clock. | 50 min

- A clock that never forgets
- Binary coded decimal
- Set the clock
- The Moon from the clock
- A leap day arrives
- Where it wakes up

Glow at night Read a light cell in a divider, switch at night with two thresholds so it never flickers at dusk, and ignore passing headlights. | 40 min

- A resistor that sees
- Night falls
- The gap
- Headlights
- Dawn

### Materials

- Addressable RGB LEDs
- Arduino Uno R3
- Light sensor
- Real-time clock, DS3231
- Resistor x 2

### Check for understanding

Each student finishes "Glow at night" 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: "Dawn".

Chapter 3. About 1 h

## Tonight's moon

Put it all together into a lamp worth sharing.

Lesson | Time | What students do

Project: tonight's moon Put it all together: tonight's Moon from the clock, glowing in the dark, with the next full moon, a month-long time-lapse and a southern sky. | 60 min

- Wake up the lamp
- Lights out
- When is the next full moon?
- Set your own night
- A month in six seconds
- Down under
- Make it yours

### Materials

- Addressable RGB LEDs
- Arduino Uno R3
- Light sensor
- Real-time clock, DS3231
- Resistor x 2

### Check for understanding

Each student finishes "Project: tonight's moon" 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.

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.
