Eye care and night mode - sblantipodi/firefly_luciferin GitHub Wiki

Night Mode

Luciferin offers several eye care features, starting with Night Mode, which can be enabled directly from the Misc tab.

By setting a percentage above 0%, Night Mode becomes active and gradually reduces brightness within the configured time interval, based on the selected percentage.

Eye Care Dialog

By clicking the button, you can access the Eye Care dialog, where additional eye care features can be enabled.

The Eye Care dialog provides the following features:

  • Night light: Uses warmer colors to reduce blue light exposure. Increasing the level blocks more blue light. The Auto option synchronizes with your operating system’s night light setting.
  • Luminosity threshold: Prevents LEDs from turning completely off during black scenes, using a soft and gentle light instead.
  • Peak brightness limit: Limits peak brightness without affecting low-brightness scenes.
  • Light Dependent Resistor (LDR): Automatically adjusts LED brightness based on ambient light using an external sensor.
    The following options require an LDR sensor:
    • Room brightness: Current brightness level detected by the LDR.
    • LDR reading interval: Time interval (in minutes) between brightness readings.
    • Turn off LEDs during readings: Temporarily turns off LEDs during LDR readings, useful when the sensor is close to the LEDs.
    • Minimum LED brightness: Ensures a minimum brightness level when the room is very dark.
    • Calibrate LDR: Uses the current room brightness as the maximum reference level for brightness adjustment. Calibration takes up to 5 seconds.

Automatic Brightness Control Using LDR

A photoresistor, also known as a Light Dependent Resistor (LDR), is a passive component whose resistance decreases as the amount of incoming light increases.

Luciferin can use this inexpensive component to automatically adjust LED strip brightness based on the ambient light level in the room.

This feature is optional but requires an LDR paired with a 10 kΩ resistor.
The GL5516 LDR is a good choice for this purpose.

Wiring

If you are using the Luciferin Official PCB, simply connect:

  • the LDR to the R5 silkscreen
  • the 10 kΩ resistor to the R4 silkscreen

Once automatic brightness control is enabled, manual brightness adjustment is disabled.

If your room is not particularly bright and you want to use the current ambient light as the maximum brightness reference, you can calibrate the LDR by clicking the button.
The current room brightness will then be used as the maximum reference level for LED brightness adjustment.

NOTE: If your microcontroller supports an ADC (Analog-to-Digital Converter) on the pin where you connect the LDR resistor, you will get very accurate readings, with up to 4096 distinct levels. If the pin you use for the LDR does not support ADC, then you will only get two possible readings: high brightness or low brightness.

Learn more about how to change the GPIO in use for LDR.


If you want to reduce eye strain even further, take a look at the
Smoothing feature using Linear Interpolation with Frame Insertion.