Skip to content

mrcodetastic/ESP32-PWM-MatrixPanel-DMA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 

Repository files navigation

Overview of PWM (and GCLK) Based LED Panel vs Shift Register Based LED Matrix Panel

LED panels, whether based on PWM (Pulse Width Modulation) or shift registers, are used to display images or videos by controlling the state of each individual LED in a matrix layout. The main difference between these two types of panels lies in how they control the LEDs and update the image data.


PWM (and GCLK) Based LED Panels:

Implementation / Code

This repository has an example implementations (for the ESP32-S2 and ESP32-S3) for a MBI5153 based LED PWM panel. It has been tested and is working. This can be used as a base for potentially other panels that use the GLCK + PWM approach.

Pulse Width Modulation (PWM):

PWM is a technique where the brightness of each LED is controlled by varying the duty cycle of a signal that drives the LED. This method allows for fine control over the brightness levels of each LED. The pulse width (or duty cycle) determines how long the LED is on within a given time frame (usually measured in microseconds or milliseconds). By adjusting the duty cycle, the LED can be dimmed or brightened.

  • How it Works:
    • Each LED has a specific driving signal that is modulated with a PWM signal to adjust the brightness.
    • The signal typically involves controlling the voltage to the LED, effectively turning it on and off very quickly.
    • The greater the "on" duration in each cycle (duty cycle), the brighter the LED appears to be.
    • LEDs are often driven by dedicated drivers capable of handling multiple LEDs, using PWM to control the brightness.

GCLK (Global Clock):

  • A Global Clock (GCLK) refers to a time reference used in PWM-driven LED panels to synchronize the timing of operations across all LEDs.
  • This clock ensures that the PWM signals are generated in a synchronized manner, allowing multiple LEDs to change their brightness levels at the same time in a coordinated fashion.

Advantages of PWM/GCLK:

  • Smooth brightness control: PWM allows fine control over the brightness of individual LEDs, leading to smoother transitions and better image quality.
  • Low power consumption: Since the LED is not constantly on (it is pulsed), PWM allows for efficient energy usage.
  • High-quality image display: Because each LED can be dimmed to a precise level, more nuanced images can be displayed with smoother gradients and better color transitions.

Key Difference from Shift Register Panels:

  • In PWM panels, the primary control is over the intensity of the light emitted by each individual LED, not just its on/off state.
  • GCLK ensures that all PWM signals are generated at consistent intervals, resulting in more uniform control of the LED panel's brightness and image quality.

Shift Register-Based LED Matrix Panels:

Implementation / Code

Refer to: https://github.com/mrcodetastic/ESP32-HUB75-MatrixPanel-DMA

How it Works:

  • A shift register is used to control the LEDs, and each row or column of the LED matrix is addressed sequentially. Shift registers convert serial data into parallel data, allowing individual LEDs to be addressed with a single signal.
  • In a shift register-based system, data (which can include color and brightness information) is shifted through the registers one bit at a time. This data is typically stored in latches or registers, which control the state of the LEDs (on or off).

Persistence of Vision (POV):

  • Since LEDs are addressed in a line-by-line (or row-by-row) fashion, each row of LEDs is lit up briefly. The human eye perceives the image due to persistence of vision, where the display is refreshed quickly enough (usually within a few milliseconds) to create the illusion of a full, continuous image.
  • The process of constantly refreshing rows creates a "scan" effect, where only one row of LEDs is lit at a time, but this is done at a high speed to make the entire display appear as though all LEDs are illuminated at once.

Advantages of Shift Register Panels:

  • Simplicity: The shift register method is relatively simple and cost-effective.
  • Lower component count: Shift registers reduce the number of required wiring and control circuitry compared to a fully independent PWM system.
  • Easy to scale: By daisy-chaining shift registers, you can easily expand the size of the panel.

Key Differences from PWM/GCLK Panels:

  • Shift register-based panels often require continuous line addressing, where the data for each row is shifted in sequence and displayed sequentially.
  • These systems often rely on persistence of vision to display a complete image, which can lead to flickering if the refresh rate isn't high enough.

Comparison:

Aspect PWM/GCLK-Based LED Panel Shift Register-Based LED Panel
Control Method PWM controls brightness; GCLK synchronizes timing. Shift registers control LED states in rows/columns.
Brightness Control Fine control over brightness for each LED. Limited control over brightness, often just on/off.
Image Quality Higher image quality, smoother gradients, more vibrant colors. Limited by PWM (or simple on/off states) and persistence of vision.
Power Efficiency More power-efficient due to on/off modulation. Power usage is more constant depending on brightness.
Complexity More complex due to synchronization and PWM control. Simpler, but requires line-by-line addressing and faster refresh rates.
Scan Method Simultaneous control of LEDs via synchronized PWM signals. Row-by-row sequential addressing with persistence of vision.
Scaling Can be harder to scale due to increased complexity. Easy to scale by adding more shift registers.

Conclusion:

A PWM-based LED panel with GCLK synchronization is typically used for higher quality displays, allowing fine-grained control of the brightness and color of each LED, which results in smoother, higher-quality images. It also benefits from synchronized operation, reducing flickering and improving the overall visual experience.

On the other hand, a shift register-based LED panel is simpler and more cost-effective but relies on continuous line addressing with persistence of vision to create the illusion of a full image. While this can work well for many applications, it often results in less precise control over brightness and color, and may exhibit flickering or lower quality at lower refresh rates.

About

Sketch to drive a bunch of eWaste GCLK & PWM based panels.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published