Menu
Microbots
0
  • Learn
  • Shop
    • Maker-Modules
    • Maker-Packs
    • Tools & Gears
    • Robots & Displays
    • All Products
  • Community
    • Education
    • Software
  • About
    • Our Story
    • Reach Out
    • FAQs
  • English
  • Your Cart is Empty
Microbots
  • Learn
  • Shop
    • Maker-Modules
    • Maker-Packs
    • Tools & Gears
    • Robots & Displays
    • All Products
  • Community
    • Education
    • Software
  • About
    • Our Story
    • Reach Out
    • FAQs
  • Language

  • 0 0

Using DriveCell to Control High-Power LEDs

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.

Why Use DriveCell for High-Power LEDs?

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.

DriveCell Specifications for High-Power LED Control

Before connecting your LED, it's essential to understand DriveCell’s electrical limitations:

  • Operating Voltage: 1.8V to 5V (suitable for LED applications)
  • Maximum Continuous Current: 1.8A (sufficient for most high-power LEDs or small LED strips)
  • Built-in Protections: Overcurrent, undervoltage lockout, and thermal shutdown

Note: When it comes to lighting, DriveCell is only ideal for controlling the brightness of single-color LED strips or individual high-power LEDs.

Wiring a High-Power LED to DriveCell

Basic Connection for One LED

Here’s how to wire a single LED or LED strip to DriveCell:

  1. Connect DriveCell Output Pins to the LED:
    • LED Positive (+) → OUT1
    • LED Negative (-) → Connect to Ground or OUT2 (while forcing it to ground with the input pin)
  2. Connect DriveCell Input Pins to the Microcontroller:
    • IN1 → Connect to your Microcontroller (any digital PWM-capable pin)
    • IN2 → Connect to your Microcontroller (any digital PWM-capable pin)
  3. Power Connections:
    • VCC → LED Voltage (e.g. 5V)
    • GND → Common ground with the Microcontroller

Controlling LED Brightness with DriveCell

To adjust LED brightness dynamically, DriveCell provides a software library. Below is an example of a fading effect.

1. Installing the Library

  1. Open Arduino IDE
  2. Go to Library Manager
  3. Search for DriveCell and install it

2. Code Example for LED Brightness Control

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 */
}

3. Understanding the Code

  • Init() → Initializes DriveCell and sets up the input pins
  • Drive(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.

Conclusion

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!

  • Share:


Also in DriveCell

Using DriveCell to Control Buzzing
Using DriveCell to Control Buzzing

Read More

Using DriveCell to Control Magnetic Actuators
Using DriveCell to Control Magnetic Actuators

Read More

Using DriveCell to Control DC Motors
Using DriveCell to Control DC Motors

Read More

Follow

Github

  • About
  • Software
  • Education
  • Contact
  • FAQs
  • Terms
  • Refund Policy
  • Privacy Policy

Join our Community ~ Be the first to know about new products and get exciting deals!

© 2025 Microbots.