Prologue: Testing the New Sensor and Tasting Success!

A project log for Making Work-From-Home Lighting Work-For-Me

A modular system to dynamically monitor and replicate outdoor lighting color temperature indoors while maintaining a stable light level.

JonJon 06/18/2021 at 23:120 Comments

My project has barely begun, but before I got too far I wanted to ensure that the sensors selected were up to the job. I am happy to report that initial tests are positive.

This entry is a bit of a prologue to more formal project updates. However, if you're seeking some insight into my source of inspiration for this year's project I'd simply point you to the project I constructed last year titled Lighting Color Control with Commodity Lamps. In that project I was able to validate that AC controlled commodity lamps were a simple, stable, accessible, and inexpensive way to produce a wide gamut of color temperatures. My project this year seeks to exploit capability as part of a system that uses commodity lamps regulated through a simple feedback control loop.

Although I had a lot of fun studying the spectrum of light output by various commodity LED lamps under AC control, I faced some difficulty in relying upon the illuminance and color temperature data returned by the sensors I selected. This year I have selected an Adafruit board built around the well documented ams TCS34725 color sensor to provide both light level (illuminance or lux) and color temperature data. I hooked up one of my sensors to a SparkFun RedBoard using some mini grabbers attached to Qwiic jumper leads. Disabling the onboard LED did require that I connect the LED via to ground, which explains the purpose of the loop you may notice being created with the white and orange mini grabbers.

Right away the default sketch was able to begin reporting meaningful illuminance and color temperature readings for my home office. I was able to switch on light sources, open and close windows, and notice expected results from the serial monitor (my artificial lighting was warm and would increase illuminance readings while lowering color temperature; opening the blinds significantly increased illuminance readings while also increasing the color temperature readings).

I was able to overwhelm the sensor's default sketch by walking outside, but a switch to the autoranging sketch proved more than capable of handling a full range of lighting conditions. I was able to take the sensor inside an unlit closet and then walk outside and see the gain and integration times adjust accordingly to produce reasonable lux and color temperature readings.

Inside the unlit closet illuminance measured less than 1 lux, lit only by the cool ambient light provided by my laptop screen

Gain:60x Time:614ms (0x0)
Raw R:13 G:57 B:18 C:90
IR:0 CRATIO:0.00 Sat:65535 Sat75:65535 
CPL:118.84 Max lux:183.82
Compensated R:13 G:57 B:18 C:90
Lux:0.43 CT:6666.38K

Turning on the dim closet lights produced color temperature and illuminance readings in line with a dim (if sufficient) 2700K warm white light:

Gain:60x Time:153ms (0xC0)
Raw R:9759 G:5952 B:3164 C:19223
IR:0 CRATIO:0.00 Sat:65535 Sat75:65535 
CPL:29.61 Max lux:737.69
Compensated R:9759 G:5952 B:3164 C:19223
Lux:198.37 CT:2626.25K

The home office with its mix of warm white lights and blinds-filtered daylight proved brighter and cooler in color temperature:

Gain:60x Time:153ms (0xC0)
Raw R:12161 G:12836 B:11319 C:34682
IR:817 CRATIO:0.02 Sat:65535 Sat75:65535 
CPL:29.61 Max lux:737.69
Compensated R:11344 G:12019 B:10502 C:33865
Lux:300.51 CT:4918.21K

And walking outside produced a result reasonable for later afternoon/early evening in the 10k lux range but with color temperature around 5000K:

Gain:4x Time:153ms (0xC0)
Raw R:27643 G:25799 B:26190 C:58621
IR:0 CRATIO:0.00 Sat:65535 Sat75:65535
CPL:1.97 Max lux:11065.28
Compensated R:27643 G:25799 B:26190 C:58621
Lux:9082.24 CT:5000.73K

This is a promising start for what I hope will be a design that is modular and dynamic enough to work with a range of lighting choices while coming together in the kind of package I may use on a regular basis to enhance my home office lighting scheme. Thanks for joining me in this latest project journey!


P.S. -Note that the ams TCS34725 has been discontinued and not recommended for new designs after this year. Unfortunately it was not clear what part would make an exact replacement. Given my early results, I will continue to incorporate this solution given its strong fit, but I would certainly appreciate any guidance on a replacement part (and would encourage hobbyist suppliers to investigate that solution ASAP).