Maker.io main logo

High Brightness LED Control With Rotary Encoder | Arduino Visual

2025-10-08 | By Ron Cutts

License: General Public License Addressable LEDs LED / Display Drivers LED Holders / Lenses LED Matrix LED Segment LED Strips LEDs / Discrete / Modules Light Arduino

 

In this Visual Programming (Visuino) tutorial, we’ll use a High Brightness Lighting LED Module and a Rotary Encoder to control LED brightness and blinking modes.

  1. Rotate the encoder to smoothly adjust LED brightness from low to high (and vice versa).

  2. Press the encoder button to toggle between steady glow and blinking mode.

  3. Brightness can be adjusted in both modes for complete flexibility.

This project shows how simple it is to build interactive lighting effects with Arduino and Visual Programming (Visuino).

Note: You can use any other LED; it will work the same.

Watch the Video!

Step 1: What You Will Need

What You Will Need

What You Will Need

What You Will Need

What You Will Need

What You Will Need

  1. High Brightness Lighting LED Module

  2. Arduino (or any other board)

  3. Rotary Encoder module

  4. Jumper wires

  5. Visuino program: Download Visuino

Step 2: The Circuit

The Circuit

Rotary Encoder Module Connections

  1. Connect Encoder pin [CLK] to Arduino pin [2]

  2. Connect Encoder pin [DT] to Arduino pin [3]

  3. Connect Encoder pin [SW] to Arduino pin [4]

  4. Connect Encoder pin [+ (VCC)] to Arduino pin [5V]

  5. Connect Encoder pin [GND] to Arduino pin [GND]

  1. Connect the LED module pin [+ (VCC)] to the Arduino pin [5V]

  2. Connect the LED module pin [GND] to Arduino pin [GND]

  3. Connect the LED module pin [IN] to Arduino digital PWM pin [5]

Step 3: Start Visuino, and Select the Arduino Board Type

Start Visuino, and Select the Arduino Board Type

Start Visuino, and Select the Arduino Board Type

Start Visuino as shown in the first picture. Click on the "Tools" button on the Arduino component (Picture 1) in Visuino. When the dialog appears, select "Arduino UNO" as shown in Picture 2

Step 4: In Visuino, Add & Set Components

In Visuino Add & Set Components

In Visuino Add & Set Components

In Visuino Add & Set Components

In Visuino Add & Set Components

In Visuino Add & Set Components

In Visuino Add & Set Components

In Visuino Add & Set Components

In Visuino Add & Set Components

In Visuino Add & Set Components

In Visuino Add & Set Components

In Visuino Add & Set Components

In Visuino Add & Set Components

  1. Add "Rotary Encoder Sensor" component

  2. Add "Integer To Analog" component

  3. Add "Debounce Button" component

  4. Add "Toggle(T) Flip-Flop" component

  5. Add "Analog Multi Source" component

  6. Add "Square Analog Generator" component

  7. Add "Analog Toggle Switch" component

  1. Select "RotaryEncoderSensor1" and in the properties window:

  2. set "Max" > "Roll Over" to False

  3. set "Max" > "Value" to 0

  4. set "Min" > "Roll Over" to False

  5. set "Min" > "Value" to 0

Select "IntegerToAnalog1" and in the properties window set "Scale" to 0.05

Select "MultiSource1" and in the properties window set "Output Pins" to 3

Select "SquareAnalogGenerator1" and in the properties window select "Amplitude", click on the pin icon and select "Float SinkPin"

Select "SquareAnalogGenerator1" and in the properties window select "Offset", click on the pin icon and select "Float SinkPin"

Step 5: In Visuino Connect Components

imageimage

  1. Connect Arduino.Digital.Digital[ 3 ] OutputPin to RotaryEncoderSensor1 pin [Clock|

  2. Connect Arduino.Digital.Digital[ 2 ] OutputPin to RotaryEncoderSensor1 pin [Direction|

  3. Connect RotaryEncoderSensor1 OutputPin to IntegerToAnalog1 InputPin

  4. Connect IntegerToAnalog1 OutputPin to MultiSource1 InputPin

  5. Connect MultiSource1 OutputPins.Pin [0] to SquareAnalogGenerator1 pin [Amplitude]

  6. Connect MultiSource1 OutputPins.Pin [1] to SquareAnalogGenerator1 pin [Offset]

  7. Connect MultiSource1 OutputPins.Pin [2] to ToggleSwitch1 False InputPin

  8. Connect SquareAnalogGenerator1 OutputPin to ToggleSwitch1.True InputPin

  9. Connect Arduino.Digital.Digital[ 4 ].Output Pin to Button1 InputPin

  10. Connect Button1 OutputPin to TFlipFlop1 Clock InputPin

  11. Connect from TFlipFlop1 OutputPin to ToggleSwitch1 Select InputPin

  12. Connect ToggleSwitch1 OutputPin to Arduino.Digital.Digital[ 5 ] AnalogInputPin (PWM)

Step 6: Generate, Compile, and Upload the Arduino Code

Generate, Compile, and Upload the Arduino Code

In Visuino, at the bottom, click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Step 7: Play

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project that I created for this. You can download it and open it in Visuino: https://www.visuino.com

Download Visuino file: High-Brightness Lighting LED module.visuino

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.