The bench
Every lesson is one Uno with the lesson's sensor wired straight to its pins: the I2C sensors on SDA and SCL, the TCS3200 on pins 2 and 4 to 7, and a lamp on pin 8 or 9 where the lesson switches one. Change the light, the color, the UV index, the hand or the heat with the sensor's sliders.
The course goes past Sensors and measurement, which covers the photoresistor and the IR reflector, into the parts that answer in numbers. Take it at /learn/path/light-color-and-gesture on /learn.
The lessons
- Lux with BH1750 and VEML7700. Lux and how bright is bright, a streetlight with hysteresis, saturation in full sun, and the BH1750's MTreg to trade steps for range.
- UV index with an LTR390. Two photodiodes one at a time, counts into a UV index with the datasheet's sensitivity, the WHO's bands, and gain against range.
- Color with a TCS34725. Red, green, blue and clear counts, shares of the total, naming a color by its hue, white and black by brightness, why the board has an LED, and a saturated white card.
- TCS3200: color by frequency. Filters chosen with S2 and S3, edges counted on INT0 for a 20 ms gate, white and black calibration, and frequency scaling.
- Gestures with an APDS-9960. Proximity from reflected infrared, the gesture engine and its FIFO, the INT pin, and a lamp you swipe on, off and dimmer.
- Heat pixels with an AMG8833. 64 thermopiles, quarter-degree raw words, a heat map in text, the hottest pixel's row and column, and presence detection in the dark.
- Boss: a candy color sorter. Nearest-neighbor matching against taught colors, a servo chute, an LCD tally, a reject bin with a beep, and a new color taught in one line.
What each sketch does
| Sketch | What it does |
|---|---|
lxlux |
A BH1750 read with Wire and a VEML7700, with a streetlight on pin 9. |
lxuv |
An LTR390's light and UV counts, the UV index and the WHO band. |
lxcolor |
A TCS34725's counts, shares and color name; l switches its LED. |
lxfreq |
A TCS3200 read by counting edges, calibrated to white and black. |
lxswipe |
An APDS-9960's light and proximity, and a lamp worked by swipes. |
lxheat |
An AMG8833's 8x8 heat map, hottest pixel and a presence lamp. |
lxsort |
The candy sorter: TCS34725, a servo chute, an LCD tally and a buzzer. |
Honest limits
- The simulated sensors report exactly what their sliders say, with the datasheets' counts, gains and timings. Real parts add noise, see infrared and depend on the spectrum of the light, and colors depend on the lighting and the distance.
- The TCS3200's frequency resolution in the lesson (50 Hz) comes from the 20 ms gate, as it would on a real board.
- A gesture is a poke in one of four directions; the real chip's response to a slow or diagonal hand, and its range, are not modeled.
- The AMG8833's scene is a background and one warm spot. Its plus or minus 2.5 C accuracy and frame-to-frame noise are not modeled. It is not a fever screener.
- The UV lesson is a learning project, not a certified UV meter.
Related
Air, heat and humidity sensors, the other Intermediate sensor course on the Uno.