DDC
  • Welcome
    • Introduction
    • Supported hardware
  • 1: Project planning
    • Switch inputs
      • Switch table
      • Direct
      • Shift register
      • Port expander
    • Analog inputs
      • External ADC
    • RGB LED
    • Digital outputs
    • PWM / Circuit control
    • EEPROM
    • Processing and memory
  • 2. Wiring
    • Switch inputs
      • Matrix
      • Direct
      • Shift register
      • Port expander
    • Analog
      • Analog switches
      • External ADC
    • RGB LED
    • Digital outputs
    • PWM / Circuit control
    • EEPROM
  • 3. Coding
    • Essentials
      • 02_Board.ino
      • 08_Joystick
      • 10_TableAndAnalog.ino
        • Switch table
        • Analog channels
      • 30_Switches.ino
    • Peripherals
      • RGB LED
        • Firmware control
          • LED functions
          • Color
          • Brightness
          • Presets
        • SimHub control
      • Digital outputs
        • Setup
        • SimHub control
        • Firmware control
      • PWM / Circuit control
        • Setup
        • Calibrate
        • Switch control
        • Trigger control
      • Shift register
      • I2C devices
        • ADS1115
        • PCA9555
        • CAT24C512
    • Advanced
      • Analog inject
      • Conditional coding
        • Triggers
        • Editors
      • Field placement
      • Presets
        • 31_RunningPresets.ino
        • 32_Presets.ino
        • Example
    • Upload
    • Naming the controller
  • 4. Connect to SimHub
    • LED control
    • Controller settings and properties
      • How to connect?
      • How does it work?
      • How to control it?
      • Property list
  • Switch library
    • Pushbutton
    • Function switches
    • Toggle switches
    • Hat switches
    • Car control functions
      • QuickSwitch
      • BrakeMagic
      • ThrottleHold
      • Handbrake
    • Pedals & paddles
      • Brake/throttle
      • Clutch
      • Bite point & launch
      • Filtered curves
      • Shifter
    • Funky switch
      • Directional
      • Center push
    • Encoders
      • rotary2Bit
      • rotary4Bit
      • funkyRotary
      • wildEncoder
      • E18
      • rotaryPulse
      • PEC11
    • Rotary switches
      • rotaryAnalog
      • quickRotary
      • SW1
      • Editing functions
    • Multiswitch complexes
      • Hybrid rotary
      • Multifunction rotary
      • Modded encoder
      • Stacked encoder
    • Preset
    • DDS
    • RGB LED control
    • PWM / Circuit control
    • Utility
  • Fast DDC
    • Buttons and LED
    • 4 encoders, buttons and LED
    • Dual clutches, 4 encoders, buttons and LED
    • Dual clutches, 6 encoders, button matrix and LED
  • CB1
    • Ordering
      • Order together
      • Order yourself
        • 1. Open in EasyEDA
        • 2. Export files
        • 3. Edit Pick&Place
        • 4. Pin headers and jumper
        • 5. Order from JLCPCB
    • Wiring
    • Code
      • Essentials
      • Complete project
      • Settings
    • Circuit
    • Shields
      • Robin
  • Collaboration
Powered by GitBook
On this page
  1. 2. Wiring

RGB LED

PreviousExternal ADCNextDigital outputs

Last updated 9 months ago

The LEDs supported are the ones supported by the Most commonly used are WS2812, also knows as Neopixel.

Common for adressable RGB LEDs is that you daisy-chain them. Each LED needs power, ground and a signal in. If the chain is going to continue, you pass the signal on from this LED to the next.

It is common to add a 100 nF capacitor between VCC and GND next to each LED, but it is not needed for all types of LEDs. Some of them have them built-in, check the datasheet for the LEDs you're using. It is also common to add a small resistor on the data line.

The last LED in the chain does not need its OUT pin wired to anything.

Some will use LED strips that are already wired together. These can usually be chained together as well, just wired the whole strip as you would a single LED.

3.3V Boards

Boards with 3.3V logic (such as RP2040-based boards) are generally outside the voltage demands of addressable RGB LEDs. There are a few solutions:

Fark it, I'll go 3.3V anyways

This will probably work with a small amount of LEDs on a board with little voltage drop (few things going on) and brightness not set very high. Power the LEDs with 3.3V and use a data pin directly from the controller to controll the LEDs.

Cheap pullup-resistor trick

  • Power the LEDs with 5V from USB, use a pullup resistor on the LED data pin from microcontroller to pull the signal up to 5V. Though RP2040 is not rated for 5V on its GPIO pins, this has been tested with good results over time. I still wouldn't recommend this for a final design, it works well for testing/prototyping.

Level shifter

  • The proper way to do it is using a level shifter. An inexpensive IC that changes to voltage of the data line to whatever to put into it.

The circuit above will take the 3.3V data line and increase the voltage to 5V. "LED5" is the lead that will connect to the first LED in the chain. The resistor R13 is the recommended resistor on the data line before the first LED in the chain. Here at 33 ohm. Recommended for WS2812 is 330-500 ohm, but less will work well.

Adafruit Neopixel library.