Close

Adding auto-brightness feature

A project log for Linear RGB LED Clock

A unique way to display time. Designed to be easily readable. Just count the colored dots!

janJan 03/05/2017 at 11:420 Comments

My recent version of the software does not support auto-brightness. The clocks' LEDs light up at value 64 of a possible 255. This is what I found suitable in a quite bright room, plus you can set the brightness +/- with the buttons on the back.

So, that's not very user-friendly at all. I don't want to manually walk up to the clock, set the brightness to be able to read the time and then be annoyed by the bright, colorful light later at night...

So, I added a LDR/resistor-divider to "control" the LEDs. It's really just four settings:

  1. midnight
  2. dim room
  3. "normal" day, a bit overcast
  4. bright, sunny day

The LDR is a A905014 type, the resistor is a 5% 11K type. The sensor is mounted in the back of the clock because I don't want it to be visible. This means the value has some offset because it's always more or less "in the shade": no problem at all.

Implementation is straight-forward. NO smoothing of the sensor-value, the routine just looks if the value is within one of the four value ranges. Interval is set to 5 seconds, so bright/sudden changes of light won't trigger a brightness-change. There is a hysteresis anyway. It checks if the recent value is at least "amount x" lower/higher than the last reading. All values were found by trial and error. I found the LDR datasheet of no real use. The stated values are all widely spread.

The sensor is glued in and covered with black tape to make sure that no light from the strip or Arduino LEDs gets to it...

Discussions