Skip to content

Instantly share code, notes, and snippets.

@tusing
Last active January 23, 2024 18:25
Show Gist options
  • Save tusing/b9e58480d67a9f3e5932ba27096643c6 to your computer and use it in GitHub Desktop.
Save tusing/b9e58480d67a9f3e5932ba27096643c6 to your computer and use it in GitHub Desktop.
A guide detailing how to enable underglow on the Zeal60 with WS2812 LEDs.

RGB Underglow Strip on the Zeal60: A Guide

A. Connecting the strip

You might find the full PCB image helpful. Ignore the red boxes!

  1. Connect V+ to the receiving end of the thermistor labeled F1; connect GND to the board's GND pin. (Avoid connecting +V to the board's +5V pin - you will likely overload the thermistor, and you will limit your maximum brightness.)

  2. Connect DI to PB0.

  3. Should look something like this when finished:

B. Enabling the strip

  1. If it is not present already, add the following to your keymap's Makefile:

    RGBLIGHT_ENABLE = yes
    AUDIO_ENABLE = no     #Underglow animations cannot be used with audio.
  2. If it is not present already, add the following to your keymap's config.h:

    #define RGBLIGHT_ANIMATIONS    // Underglow animations. 
    #define RGB_DI_PIN B0          // The pin your RGB strip is wired to
    #define RGBLED_NUM 35          // Number of LEDs
    #define RGBLIGHT_HUE_STEP 5    // How much each press of rgb_hue changes hue
    #define RGBLIGHT_SAT_STEP 10   // How much each press of rgb_sat changes sat
    #define RGBLIGHT_VAL_STEP 10   // How much each press of rgb_val changes val
  3. If they are not present already, add the following keycodes to your keymap to control the RGB strip: RGB_TOG (on/off), RGB_MOD (step through modes), RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD (HSV increase/decrease). Add these to your keymap.

C. Dealing with current limits

USB 2.0 ports on laptops provide up to 500mA max, but USB 3.0 ports can provide up to 900mA; USB 3.1 up to 1.5A; and powered USB hubs even more. We can run our keyboard at a higher brightness if we draw more power. The Zeal60 uses 500mA at max brightness. This means that you have about 400mA remaining for the strip to use on a USB 3.0 port; 1000mA free on a USB 3.1 port, so on and so forth.

Warning: This means you will need to turn off your RGB strip before connecting to a USB 2.0 port, as USB 2.0 cannot sustain the current necessary!

  1. If not present already, add the following to your keymap's config.h. Change variable definitions based on your needs.

    // Current limiting.
    #define USB_MAX_POWER_CONSUMPTION 900     // Limit device max power consumption.
    #define RGBSTRIP_CURRENT_LIMIT 400        // Strip current limit in mA.
    #define RGBSTRIP_MAX_CURRENT_PER_LIGHT 60 // mA per light when at max brightness.
  2. Toggle on the LED strip (RGB_TOG) and step through animations (RGB_MOD) to test it out!

D. Troubleshooting

Issue: Keymap compile errors/flickering underglow
Solution: The Zeal60 firmware as changed quite a bit in the 2 years since I wrote this guide. Check out my qmk-firmware repository instead of the official one or Wilba's. Then try compiling from either the zeal60 branch or the zeal60-personal-old branch after applying the changes as described above.

E. Sources and resources

A. Connecting the strip.

B. Enabling the strip.

C. Dealing with current limits.

@wetseng
Copy link

wetseng commented Sep 24, 2017

when I tried to run make, I keep getting the "../../Makefile:490: recipe for target 'zeal60-allsp-allkm' failed
make: *** [zeal60-allsp-allkm] Error 1"

Any idea why? Thanks

@Nerd162
Copy link

Nerd162 commented Dec 6, 2018

What rgb strip is that? I need one just like that for my zeal60 link if possible pls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment