High-power LEDs are widely used in lighting projects, from flashlights to light strips and signal indicators. Typically, a single transistor is used to switch or dim high-power LEDs, but DriveCell, a tiny H-Bridge module which is packaged into the smallest module, can provide an alternative while handling up to 1.8A of continuous current.
In this guide, we’ll explore how DriveCell can be used to control high-power LEDs or single-color LED strips, discuss wiring configurations, and demonstrate a fading effect using its library.
DriveCell is built around the DRV8837 H-Bridge which has four transistors in the shape of an 'H' to allow bi-directional current. You only require one transistor to dim the brightness of high-power LEDs - But if you're looking for a tiny solution DriveCell can handles up to 1.8A continuous current with an easy integration with microcontrollers.
Before connecting your LED, it's essential to understand DriveCell’s electrical limitations:
Note: When it comes to lighting, DriveCell is only ideal for controlling the brightness of single-color LED strips or individual high-power LEDs.
Here’s how to wire a single LED or LED strip to DriveCell:
To adjust LED brightness dynamically, DriveCell provides a software library. Below is an example of a fading effect.
The following example demonstrates how to fade an LED in and out using DriveCell:
#include <DriveCell.h>
#define IN1_pin1 2
#define IN1_pin2 3
DriveCell LED(IN1_pin1, IN1_pin2); /* Pin2 will output the PWM signal, and Pin3 will be connected to 0V */
uint16_t led_brightness = 0;
bool led_brightness_flag = 1;
void setup() {
LED.Init(); /* Initialize the LED */
}
void loop() {
delay(10); /* Adjust this delay to change the fading speed */
if (led_brightness_flag == 1) {
if (led_brightness < 100U) {
led_brightness++;
} else {
led_brightness_flag = 0;
}
} else {
if (led_brightness > 1U) {
led_brightness--;
} else {
led_brightness_flag = 1;
}
}
LED.Drive(0, led_brightness); /* Output the new brightness level */
}
Init()
→ Initializes DriveCell and sets up the input pinsDrive(direction, brightness)
→ Controls LED brightness:
direction
→ 0
(fixed polarity for LEDs)brightness
→ Dimming level (0 to 100%)This code gradually increases and decreases the brightness of the LED, creating a smooth fading effect.
⚠ Note: The Drive() function is only compatible with ESP32 and CodeCell, as it uses a high-speed PWM timer.
Below is another example that can be used with other microcontrollers like the Arduino Uno:
#include <DriveCell.h>
#define IN1_pin1 2
#define IN1_pin2 3
DriveCell myLED(IN1_pin1, IN1_pin2);
void setup() {
myLED.Init();
}
void loop() {
myLED.Run(1000); // Blink LED on and off every 1 second
}
This example simply turns the LED on and off every second.
The tiny DriveCell module makes high-power LED control simple and easy to use! Check out the DriveCell GitHub Repository for more code examples and technical documentation!
Join our Community ~ Be the first to know about new products and get exciting deals!
© 2025 Microbots.