Source: https://mokxi.com/teachers/plans/light-color-and-gesture
Updated: 2026-11-19

Lesson plan

# Light, color, UV and gesture sensors lesson plan

The digital light sensors read close to their datasheets on the Uno: lux with the BH1750 and VEML7700, the LTR390’s UV index, color with the TCS34725 and by frequency with the TCS3200, APDS-9960 gestures and AMG8833 heat pixels, then a candy color sorter.

4 chapters, 7 lessons, about 7 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

- Light in lux and ultraviolet in UV index, and the gain that sets the range.
- Two color sensors, one with counts on I2C and one with a frequency on a pin.
- A sensor that sees which way a hand swipes, and one that sees in heat.
- A color sensor, a servo and a tally: a candy-sorting machine.

### Materials for the whole unit

- Ambient light, VEML7700
- APDS-9960 gesture sensor
- Arduino Uno R3
- Buzzer
- Character LCD with I2C backpack
- Color sensor, TCS3200 / TCS230 (GY-31)
- Color sensor, TCS34725
- Hobby servo
- LED
- Light sensor, BH1750
- Resistor
- Thermal camera, AMG8833
- UV and light, LTR-390

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

## How bright

Light in lux and ultraviolet in UV index, and the gain that sets the range.

Lesson | Time | What students do

Lux with BH1750 and VEML7700 Two digital light meters that answer in lux: the BH1750 read with three Wire calls, the VEML7700 with automatic gain, a streetlight with hysteresis, and what saturates in full sun and how a longer or shorter measurement fixes it. | 65 min

- Run it: two light meters
- How bright is bright
- Dusk
- The streetlight
- Two thresholds
- Full sun
- A shorter measurement

UV index with an LTR390 An LTR390 measures visible light and ultraviolet with two photodiodes, one at a time: mode switching, raw counts into a UV index with the datasheet’s sensitivity, the WHO’s exposure bands, and gain against range. | 65 min

- Run it: invisible light
- One photodiode at a time
- Counts into an index
- The beach at noon
- Extreme
- Too much gain
- Less gain, more range

### Materials

- Ambient light, VEML7700
- Arduino Uno R3
- LED
- Light sensor, BH1750
- Resistor
- UV and light, LTR-390

### Check for understanding

Each student finishes "UV index with an LTR390" 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: "Less gain, more range".

Chapter 2. About 1 h 50 min

## What color

Two color sensors, one with counts on I2C and one with a frequency on a pin.

Lesson | Time | What students do

Color with a TCS34725 Red, green, blue and clear counts under the sensor’s own white LED: why a color is in the shares and not the counts, naming a color by its hue, what the LED is for, and what too much gain does to a white card. | 55 min

- Run it: four numbers
- A green card
- Naming a color
- White, gray and black
- Switch the LED off
- Too much gain

TCS3200: color by frequency A color sensor with no bus at all: four filter groups chosen with two pins, light turned into a square wave, edges counted on an interrupt for a fixed gate time, calibration against white and black cards, and frequency scaling. | 55 min

- Run it: light as a frequency
- Choosing a filter
- Counting edges
- White and black cards
- Frequency scaling
- Which color sensor

### Materials

- Arduino Uno R3
- Color sensor, TCS3200 / TCS230 (GY-31)
- Color sensor, TCS34725

### Check for understanding

Each student finishes "TCS3200: color by frequency" 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: "Which color sensor".

Chapter 3. About 1 h 50 min

## Hands and heat

A sensor that sees which way a hand swipes, and one that sees in heat.

Lesson | Time | What students do

Gestures with an APDS-9960 One chip that sees light, color, a hand coming close and which way it swipes: proximity from reflected infrared, the gesture engine and its FIFO, the interrupt pin, and a lamp you switch and dim with a wave. | 55 min

- Run it: a sensor that watches
- A hand comes close
- Swipe right
- The interrupt pin
- Dim it
- Finer steps

Heat pixels with an AMG8833 An 8x8 thermal camera on I2C: 64 thermopiles that read temperature from a distance, the raw quarter-degree words, a heat map in text, the hottest pixel’s row and column, and a presence lamp that works in the dark. | 55 min

- Run it: a picture in heat
- Quarter degrees
- Someone there
- Move across the room
- An empty room
- Farther away

### Materials

- APDS-9960 gesture sensor
- Arduino Uno R3
- LED
- Resistor
- Thermal camera, AMG8833

### Check for understanding

Each student finishes "Heat pixels with an AMG8833" 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: "Farther away".

Chapter 4. About 1 h 5 min

## Boss: the sorter

A color sensor, a servo and a tally: a candy-sorting machine.

Lesson | Time | What students do

Boss: a candy color sorter Build a candy-sorting machine: a TCS34725 looks at each candy, a nearest-neighbor match against six taught colors picks a bin, a servo swings the chute, an LCD keeps the tally, and anything unknown goes to the reject bin with a beep. | 65 min

- Run it: the first candy
- The chute
- Nearest neighbor
- The tally
- Something it does not know
- The beep
- Teach it pink

### Materials

- Arduino Uno R3
- Buzzer
- Character LCD with I2C backpack
- Color sensor, TCS34725
- Hobby servo

### Check for understanding

Each student finishes "Boss: a candy color sorter" 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: "Teach it pink".

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.
