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.
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.
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 VEML7700Two 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 |
|
| UV index with an LTR390An 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 |
|
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".
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 TCS34725Red, 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 |
|
| TCS3200: color by frequencyA 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 |
|
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".
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-9960One 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 |
|
| Heat pixels with an AMG8833An 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 |
|
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".
Boss: the sorter
A color sensor, a servo and a tally: a candy-sorting machine.
| Lesson | Time | What students do |
|---|---|---|
| Boss: a candy color sorterBuild 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 |
|
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".
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.