RGB Driver
The RGB driver in unicontrol operates as an independent routine,
serving as a controller for standard RGB or RGBW LED strips with various built-in color programs.
Each instance of unicontrol can control two independent RGB or RGBW LED strips
(with the exception of the 4s programs, where the channels are partially independent on each other, thus controlling up to 8 separate PWM channels).
The output is provided continuously, provided at least one of the Red
, Green
, or Blue
channels is defined as Hardware
in the Peripheral menu. Once set, the corresponding RGB driver program's playback begins.
3.3V
and 12mA
power rating, the ESP8266 GPIO pins cannot power any LED strip directly.
Users are expected to use these RGBW pins to control the Base of a transistor or the Gate of a MOSFET.
The LED strip should have its own power supply with compatible voltage and maximum current ratings.
The RGB driver can be controlled in several ways:
- Manually, via the user interface's edit menu,
- Automatically or remotely, via process output, or
- Remotely, via built-in HTTP API and MQTT API.
Furthermore, control can be exerted:
- Directly, by accessing the driver's active parameters, or
- Indirectly, by saving the process variables and controlling the underlying process.
Parameters
Each RGB driver program consists of four key parameters:
- Mode - The primary parameter that selects the program.
- Color - An auxiliary parameter that defines the rendered Color, if applicable.
- Speed - An auxiliary parameter that defines the animation Speed, if applicable.
- Brightness - A global modifier that reduces the overall Brightness.
One set of these parameters is always active, and controlling the driver involves dynamic overwriting of these active parameters with alternative values coming either from external commands or the processes.
Parameter | Active Variable | Process Variables** |
---|---|---|
Mode |
rgbmod1 rgbmod2 | outrgbmod |
Color |
rgbcolor1 rgbcolor2 | outcolor |
Speed |
rgbspd1 rgbspd2 | outval1 |
Brightness |
rgbbrt1 rgbbrt2 | outval2 |
Process ID | Does not apply | Applies |
**In Process Variables the RGB channel is determined by the Primary output
Mode
The current RGB driver supports 11 built-in program Modes that can be rendered by the attached LED strip. The tables below provide a detailed description of each mode and summarize the relevance of the auxiliary Color, Speed, and Brightness parameters:
Showcase | [VALUE] | Mode | Description |
---|---|---|---|
0 | Off | All channels off. | |
1 | Static color | Displays a predefined static color until changed. | |
2 | Rainbow | Loops through all rainbow colors for a predefined duration of a single loop. | |
3 | Warm Rainbow | Loops through warm colors (red channel always on) for a predefined duration of a single loop. | |
4 | Cool Rainbow | Loops through cool colors (blue channel always on) for a predefined duration of a single loop. | |
5 | Candlelight | Simulates the flickering of a common candle with predetermined color and flicker speed. | |
6 | Thunderstorm | Simulates natural lightning flashes with predetermined color and pauses between lightning clusters. | |
7 | Strobe | Flashes rapidly with predetermined color and short pauses between individual flashes. | |
8 | Sunrise | Simulates a natural Sunrise/Sunset with a color and brightness progression, running for a predetermined time. Sunrise ends with full brightness on all channels, while Sunset ends with all channels turned off. | |
9 | Sunset | ||
21 | Thunderstorm (4s) | Simulates natural lightning flashes on four independent channels with predetermined pauses between lightning clusters. |
Relevance of the Color, Speed, and Brightness parameters:
[VALUE] | Mode | Color | Speed | Brightness |
---|---|---|---|---|
0 | Off | - | - | - |
1 | Static color | ✓ | ✓ | |
2 | Rainbow | - | ✓ | |
3 | Warm Rainbow | |||
4 | Cool Rainbow | |||
5 | Candlelight | ✓ | ||
6 | Thunderstorm | |||
7 | Strobe | |||
8 | Sunrise | - | ||
9 | Sunset | |||
21 | Thunderstorm (4s) |
Color
Determines the base Color for the RGB program, denoted using the standard 6-digit (non-abbreviated) RGB Hex code (web color), #RRGGBB
.
For further reference on web colors, please visit here.
This setting is only effective for relevant programs, as detailed in the table above.
Speed
The Speed of the RGB program is denoted as a non-dimensional unit. Its exact interpretation differs among these programs as detailed in the table below:
# | Mode | Speed effect | Min (0) | Max (100) |
---|---|---|---|---|
1 | Static color | none | - | - |
2 | Rainbow | duration of the cycle (linear) | 5 minutes | 5 seconds |
3 | Warm Rainbow | 3 minutes | 3 seconds | |
4 | Cool Rainbow | |||
5 | Candlelight | number of movements per second (non-linear) | 10 | 1000 |
6 | Thunderstorm | time between lightning clusters (linear) | 10-30 seconds | 0-2 seconds |
21 | Thunderstorm (4s) | |||
7 | Strobe | time between individual flashes (linear) | 0.5-1 seconds | 0-10 milliseconds |
8 | Sunrise | duration (non-linear) | 1 hour | 10 seconds |
9 | Sunset |
Brightness
Determines the maximum Brightness of the RGB program, represented as a percentage of the LED's maximum power output. It is used for a linear reduction of the LED's output duty cycle.
White channel
The White
LED channel has a unique role within the RGB driver.
Its use is fully optional and has no impact on the main color channels. As long as all four channels are defined in the Peripheral menu,
the output of the White
channel is set equal to the lowest value of the Red
, Green
, and Blue
channels.
White
LED channel to enhance the intensity of white light without interfering with the primary colors.
Processes
Although the RGB driver operates as an independent routine not reliant on being controlled by the Processes, these still play two significant roles:
- Automation - Despite being independent, the RGB driver is fully integrated in terms of being controllable by the processes. Thus, it inherits all the benefits of automation and remote control that the processes offer.
- Saved presets - Each process can store all four parameters needed by the RGB driver, allowing it to serve as a set of saved presets for the driver.
The exact behavior of the RGB driver when being controlled by a process is as follows:
- On - When turning
ON
a process withRGB
selected as the Primary output, all four RGB driver-related process variables (Mode, Color, Speed, and Brightness) are saved into their active counterparts and the playback with these properties begins immediately. - Off - When turning
OFF
a process withRGB
selected as the Primary output, the active Mode is changed to0
(Off) and the LEDs fade out.