Labs / Bipes + MicroPython / 8 Actuators (Outputs / Actuators)

8.3 Want an Ultra-Bright Desk Lamp? Drive High-Power LEDs to Emit Light! β€”β€” High-Power Single-Die LED Module Based on OC7140

Author: Li Zisheng Β· Source: FreakStudio open documentation Β· License: CC BY 4.0

Contents

Young makers, today let's unlock an "ultra-bright high-power LED bulb"πŸ’‘!

We've played with the compact Piranha LED before, and today this high-power single-LED module based on the OC7140 delivers even higher brightness β€” it can illuminate your desk just like a small table lamp. What's more, its brightness can be precisely adjusted via PWM, making it a perfect pick for building a "dimmable mini table lamp" ✨!

1. Module Introduction

Regular LEDs don’t have sufficient brightness. What if you want to make a small desk lamp that can light up your desktop? This high-power LED module is exactly the solution you need!

It is a high-power lighting output module that is centrally equipped with the OC7140 driver chip: since the current required by high-power LEDs is far greater than what a development board pin can supply, the OC7140 acts as a "current manager" that can stably power the LEDs, protecting the development board while enabling the LEDs to operate safely at high brightness. It also supports PWM dimming, which allows the LED to transition continuously from dim to bright for fine-grained brightness adjustment.

Compared with conventional low-power LEDs, it boasts the following features:

In graphical programming, these blocks are commonly used for high-power LEDs:

In practical projects, it is often used for the following purposes:

Quick Science: What is PWM Dimming?

PWM stands for "Pulse Width Modulation". Simply put, it makes the LED rapidly cycle between "on β†’ off β†’ on β†’ off", and adjusts the brightness by modifying the "proportion of on-time"(duty cycle). For example, at a 10% duty cycle, the LED is off for most of the time and appears very dim; at a 100% duty cycle, the LED stays on continuously and reaches maximum brightness. Since the switching speed is extremely fast (e. g., 1000 times per second), the human eye cannot detect the flickering at all, and only perceives a change in brightness.

2. Wiring Instructions

To get high-power LEDs to "light up", the very first step remains β€”β€” connect the module correctly!

8.3 Want an Ultra-Bright Desk Lamp? Drive High-Power LEDs to Emit Light! β€”β€” High-Power Single-Die LED Module Based on OC7140

We will connect the high-power single-LED module based on OC7140 to the digital interface DIO0 of the development board, and the corresponding relationship is as follows:

Development Board Pins

Module Pins

Description

Pin 6

DOUT

PWM output / level output pins on the MCU

Pin 7

NC

-

πŸ“Œ Note

3. Example: Adjusting LED Brightness via PWM (Gradual Transition from Dim to Bright)

Experiment Objective: Make the LED gradually fade slowly from off to full brightness, and meanwhile print the duty cycle value of the current brightness on the terminal to intuitively experience the effect of PWM dimming.

Everyday Insight: The dimmable table lamp at home can adjust its brightness via a , which relies on PWM for Technology Implementation. Now let's make an "auto-dimming mini table lamp" ourselves!

The graphical program is as follows:

8.3 Want an Ultra-Bright Desk Lamp? Drive High-Power LEDs to Emit Light! β€”β€” High-Power Single-Die LED Module Based on OC7140

Building Block Assembly Steps:

  1. Generate brightness gradient values
    • Drag the count with i from 0 to 8000 by 200 block in;
    • Let the variable i start from 0, increment by 200 each time until it reaches 8000, to simulate the brightness change from 0 to the maximum.
  2. Configure PWM output
    • Drag the PWM #6 block into the loop;
    • Selected Pin: Pin 9 / GPIO6;
    • Set Frequency to 1000 (1000 switches per second, no flicker perceived by the human eye);
    • Set Duty to i (use variable i to control the duty cycle so as to achieve brightness variation).
  3. Print the brightness value
    • Add the print i block to display the current duty cycle value in the terminal.
  4. control the rate of change
    • Drag in the delay block and set it to 0.5 seconds β†’ this makes the brightness change smoother and easier to observe.

Experimental Effect:

Graphical blocks will be automatically converted into MicroPython code, and the running result will be displayed:

8.3 Want an Ultra-Bright Desk Lamp? Drive High-Power LEDs to Emit Light! β€”β€” High-Power Single-Die LED Module Based on OC7140

Directly importable building blocks:

High-power LED.xml 3 KB

Tips

  1. If the LED does not light up:
    • Check if the correct pin is selected (Pin 9 / GPIO6) and whether the wiring is secure;
    • Confirm that the module power supply is normal and the heat sink is properly installed (to avoid overheat protection);
  2. What should I do if the brightness is insufficient?
    • You can increase the maximum value of count with from 8000 to a larger number (e. g., 10000) to increase the duty cycle;
  3. Advanced Gameplay:
    • Pair it with a sliding rheostat module, use the resistance value of the rheostat to control the PWM duty cycle, and implement a "manual dimming table lamp";
    • Add conditional judgment to automatically brighten the LED when the ambient light is dim, making it an "auto-sensing desk lamp".

✨ Interactive Quick Question

  1. Think about it: Why use PWM dimming instead of directly adjusting the voltage of the LED?
  2. Try this: change the count with parameter from by 200 to by 400, and see whether the brightness changes faster or slower?

Summary

  1. The high-power single-chip LED module based on OC7140 is a high-power lighting output module that relies on the OC7140 chip to stably drive the LED;
  2. It supports PWM dimming, which enables continuous brightness transition from dim to bright, making it ideal for projects such as dimmable desk lamps and ambient lighting fixtures.
  3. The basic usage is to realize automatic gradient through "loop + PWM", while the advanced usage is to realize intelligent dimming in combination with sensors;
  4. It is an excellent module for learning PWM technology and experiencing high-power lighting.