Example Code for Arduino-LED Strip Brightness
Last revision 2025/12/27
The article guides on controlling LED strip brightness using Arduino with FireBeetle 2 ESP32-E and DAC module, including hardware and software setup, wiring instructions, and code example.
Hardware Preparation
- FireBeetle 2 ESP32-E IoT Microcontroller (SKU: DFR0654) ×1
- 2-Channel I2C to 0-10V DAC Module (SKU: DFR0971) ×1
- 5V LED Strip (SKU: FIT0841) ×1
- LED Dimmer ×1
- M-M/F-M/F-F Jumper wires
Software Preparation
- Download Arduino IDE: Click to download Arduino IDE.
- Install SDK: click to enter FireBeetle ESP32-E IoT Microcontroller Wiki for SDK installation tutorial.
- Download and install the DFRobot_GP8403
- For Arduino IDE V1.8.19 (or earlier), install the library manually: How to Add a Library?
- For Arduino IDE V2.0.0 (or later), directly search for the "DFRobot_GP8403" in the Library Manager and install it.
Wiring Diagram

Wring Description
FireBeetle 2: 3V3 to DAC module: +
FireBeetle 2: GND to DAC module: -
FireBeetle 2: SCL to DAC module: SCL
FireBeetle 2: SDA to DAC module: SDA
The DAC module: VOUT0 to LED dimmer (0-10V): V+
The DAC module: GND to LED dimmer (0-10V): V-
The LED dimmer (LOAD): V+ to 5V LED Strip: +
The LED dimmer (LOAD): V- to 5V LED Strip: -
The LED dimmer (POWER): V+ to 5V-24V power input: 5V +
The LED dimmer (POWER): V- to 5V-24V power input: 5V -
Sample Code
Initialize GP8403 DAC, set OUT0 to 3.5V and save.
#include "DFRobot_GP8403.h"
DFRobot_GP8403 dac(&Wire,0x58);
void setup() {
Serial.begin(115200);
while(dac.begin()!=0){
Serial.println("init error");
delay(1000);
}
Serial.println("init succeed");
dac.setDACOutRange(dac.eOutputRange10V);//Set the output range as 0-10V
dac.setDACOutVoltage(1433,0);//The DAC value for 3.5V output in OUT0 channel
delay(1000);
dac.store(); //Save the set 3.5V voltage inside the chip
}
void loop(){
}
Result
After downloading the code, the strip was lit, and at this time, the output voltage of channel 0 measured by a multimeter is 3.5V.
Was this article helpful?
