RGB Lights with SKR

I have an RGB light strip, not addressable just strictly RGB, and I would like to be able to control it with my SKR Pro V1.2. If I understand how the strip works (and color in general) it makes the different colors based off of the strength of each the R G and B. So am I correct to think that if apply 100% R and 100% B that I will get purple? I think so. But if I want it more of a blueish-purple than I could do 100% B and 50% R or whatever combination I want. With that assumption (correct me if I am wrong) can I just use 3 different PWM pins on the board and send GCODE commands to each color by pin assignment?

If so, what are the most accessible available PWM pins left open typically? This is for my Repeat V4 printer so I am using the fan pins, heating pins, and a few endstop pins already.

The rgb leds are often 12V and if there are a lot, they can take multiple amps. A regular PWM pin can source 20 mA or so max, which is not enough for anything more than one dim led.

You could use the FAN outputs, which are pwm, and have a mosfet ready to boost your current and voltage.

You can also use something like a ULN2003 too boost the voltage and current.

Programmable RGB steps are actually easier in that way. They get power straight from the psu, and the data line doesn’t source any current. The gotcha is that the firmware needs to send the right signal to control them.

1 Like

I know it’s another thing, but I power 60 LEDs behind my monitor including an Arduino Nano with the USB cable alone.

Not to hijack the thread…but what pin can you use on the SKR Pro and what needs to be changed in the firmware? i would really like to run a strip of LEDs under my LR3 gantry and having it change the color based on the print job would be cool. i have several strips of WS2815 12v strips so those would be what i would use. And my gantry is 1450mm if that matters.

1 Like

It looks like it should be easy. But I suspect it actually isn’t trivial.

My main concern is that it is using the adafruit library, which may not work for the st mcu in the skrs. After a little googling, I find a few guides:

And they do change which led library it is using. YMMV.

2 Likes

Thank you! i will for sure take a look. I have never had much luck when it comes to compiling firmware so i may reach out to you again when the time comes lol

If you haven’t already, follow the instructions at: platformio and start with a clean copy of the firmware from MarlinBuilder releases. I know that firmware builds. Start there and then add whatever changes one at a time. That will really limit where to look for changes when something breaks.

1 Like

would those LED colors then be selectable by custom gcodes or is it a preset color per mode that is user selectable and all handled under the hood?

I have 1x strip 120 Neopixel leds.
How do I make the first 40 leds blue, next 40 white, next 40 red for example? What’s the configuration for this example in the configuration file?

If you are running the neopixels from marlin there is Gcode to set that up. Ive never tried it but i know its possible,

Yeah i had a look at that…
Im assuming [I<pixel>] is the ID.
Would this work as a range, So in my above example would it be:
M150 B100 I0-40 <---- 0 to 40 led to be Blue
M150 W100 I41-80 <—41 to 80 to be White <----- Would white work even if my neopixel is RGB (no White). or would i have to do this for RGB setup M150 R100 G100 B100 I41-80
M150 R100 I81-120 <—81 to 120 to be Red

Im honestly not sure as Ive never tried it. Once you get it wired up you can try sending Gcode from the terminal on the TFT and see what happens. Might also be able to find some youtube videos for LEDs on a 3d printer with marlin. Will be the same gcode

1 Like

I highly doubt it. The gcode parser is very particular and it isn’t documented. So I would be surprised if the answer was yes.

ok then what about this as a option:
#define NEOPIXEL_LED
#if ENABLED(NEOPIXEL_LED)
#define NEOPIXEL_TYPE NEO_GRBW
#define NEOPIXEL_PIN PE4
#define NEOPIXEL2_TYPE NEOPIXEL_TYPE
#define NEOPIXEL2_PIN PE2
#define NEOPIXEL3_TYPE NEOPIXEL_TYPE
#define NEOPIXEL3_PIN PF8
#define NEOPIXEL_PIXELS 20
#define NEOPIXEL_IS_SEQUENTIAL
#define NEOPIXEL_BRIGHTNESS 127
#define NEOPIXEL_STARTUP_TEST

#define NEOPIXEL2_SEPARATE
#if ENABLED(NEOPIXEL2_SEPARATE)
#define NEOPIXEL2_PIXELS 20
#define NEOPIXEL2_BRIGHTNESS 127
#define NEOPIXEL2_STARTUP_TEST
#else
//#define NEOPIXEL2_INSERIES
#endif

#define NEOPIXEL3_SEPARATE
#if ENABLED(NEOPIXEL3_SEPARATE)
#define NEOPIXEL3_PIXELS 20
#define NEOPIXEL3_BRIGHTNESS 127
#define NEOPIXEL3_STARTUP_TEST
#else
//#define NEOPIXEL3_INSERIES
#endif

Adding the Neopixel3 as the 3rd Adafruit Neopixel, Would this then be controlled using M150 S2?

The above compiled/build ok. question is would the NEOPIXEL3_SEPARATE even work as to have an additional led strip?