Under desk RGB LED strip lighting

I bought a 1 meter Flexible RGB LED Strip
Flexible RGB LED Strip (aka NeoPixel, WS2812, SK6812) – 144 pixels per metre (pimoroni.com)
It’s connected to a Plasma Stick
Plasma Stick 2040 W (Pico W Aboard) (pimoroni.com)
I want to use it for desk lighting. I have it mounted under the section of my desk that my monitors sit on. It’s pointing down to light up my keyboard and trackball that are on the main desktop. Right now it’s mounted using double sided sticky (carpet) tape. I have removed the flexible silicone waterproof sleeve. The sticky tape didn’t want to stick to it, plus it makes it a lot lighter. With the LED’s lit up at half brightness it started to unstick from the wood shelf. Turned everything off and reattached the small spots that let go, I’m assuming because the LED’s got warm? They weren’t hot. Right now its staying in place. Will leave it be overnight. If it’s still stuck in place I’ll do some more testing.

Has anybody else tried something similar?

How do Alpha,

I have mine on a stip of trunking that acts as a bit of a barrier, and or a heatsink. The “L” shaped stuff worked best for me.

Some kind of adhesive strip will hold them on well, a bit of trial and error however on what maybe affected by mild heat.

HTH

I used what I had on hand, which is just your basic double sided carpet tape. I’m thinking a trip to the hardware store for some 3M stuff, or Gorilla tape may be in order. They both make double sided sticky tape for indoor and outdoor. And stuff that is heat resistant / tolerant.

Mine is the strip from the final day of the original Pi Hut Advent Calendar (hopefully our beloved pirates won’t mind me linking to it ;) ).

Connected to a pico WH (not the one from the calendar) and run both via a button and via MQTT.
It’s still mounted (upside down) in the breadboard from the calendar, and uses a button from it too.
Indeed a chunk of the code came from there too, enhanced with an MQTT set-up.

Mine’s currently stuck there via a mix of velcro and electrical tape, and so far hasn’t fallen off too often.

I do have both their newer “Let it glow” version and also a Mote Phat (on a Pi Zero 2) with 4 sticks, but have yet to decide whether to replace the original with either of those as the first one works well enough.

Round two. I went and bought a roll of 3M double sided foam sticky tap. What I got was the perfect width for my RGB LED String. It’s good for up to 15 lbs, and for just about any surface. Just finished attaching it. I’ll let it stick for a while before I light it up.

It looks like my sticky situation is solved. No signs of it letting go of the desk or the LED strip. =)

Also having a lot of fun with this. I’m using an Encoder Wheel as my controller.
RGB Encoder Wheel Breakout (pimoroni.com)

Wired it up with a USB cable I had from a dead mouse. It has the required 4 wires, and is shielded. The wire colors worked out great too, red, black, green and white. I soldered it to the Pico, using the same pins the QWICC connector on the Plasma Stick uses. This way I can use the QWICC connector without any fancy i2c coding.

I use the buttons on the Encoder Wheel to select the color, and the wheel to adjust the brightness. Basic functionality for now. Eventually the buttons will pick patterns, mostly for just showing off, lol. ;)

Getting the wheel to adjust the brightness was a challenge. Had to go the HSV route, and use V for the brightness value.

The LED ring mimics the color of the strip, with added colored markers showing what color that button selects when pressed. Center button is off. It’s basically a second smaller LED strip. I use the same V value for it so it tracks the brightness of the main strip.

3 Likes

I have one pattern added, took it from the rainbow example.
Pressing Up gets me White, Left is RED, Right is Blue, and Down is Rainbow (was originally Green). Center Button turns all the LED’s off.
Took me a while but I even got the brightness to adjust on the fly while the pattern is running.

import time
import plasma
import machine
import micropython

from plasma import plasma_stick
from pimoroni_i2c import PimoroniI2C
from pimoroni import BREAKOUT_GARDEN_I2C_PINS  # or PICO_EXPLORER_I2C_PINS or HEADER_I2C_PINS
from breakout_encoder_wheel import BreakoutEncoderWheel, UP, DOWN, LEFT, RIGHT, CENTRE, NUM_BUTTONS, NUM_LEDS

BUTTON_NAMES = ["Up", "Down", "Left", "Right", "Centre"]

i2c = PimoroniI2C(plasma_stick.SDA, plasma_stick.SCL)

wheel = BreakoutEncoderWheel(i2c)
last_pressed = [False] * NUM_BUTTONS
pressed = [False] * NUM_BUTTONS

STRIP_LEDS = 144
SPEED = 20
UPDATES = 60

# WS2812 / NeoPixel™ LEDs
led_strip = plasma.WS2812(STRIP_LEDS, 0, 0, plasma_stick.DAT, color_order=plasma.COLOR_ORDER_GRB)
led_strip.start()

offset = 0.0

brightness = (0.5)

pattern = 0

red = (1 / 360)
green = (130 / 360)
blue = (250 / 360)
yellow = (60 / 360)
orange = (30 / 360)
white = (1.0)

while True:
    
    # Read all of the encoder wheel's buttons
    for b in range(NUM_BUTTONS):
        pressed[b] = wheel.pressed(b)
        if pressed[b] != last_pressed[b]:
            print(BUTTON_NAMES[b], "Pressed" if pressed[b] else "Released")
        last_pressed[b] = pressed[b]

    if pressed[UP]:
        pattern = 0
        wheel.clear()
        for i in range(NUM_LEDS):
            wheel.set_hsv(i, 1, 0, brightness)
        for s in range(STRIP_LEDS):
            led_strip.set_hsv(s, 1, 0, brightness)
        wheel.set_hsv(0, 1.0, 0, 1.0)
        wheel.set_hsv(6, blue, 1.0, 1.0)
        wheel.set_hsv(11, blue, 1.0, 1.0)
        wheel.set_hsv(12, green, 1.0, 1.0)
        wheel.set_hsv(13, red, 1.0, 1.0)
        wheel.set_hsv(18, red, 1.0, 1.0)
        color = white

    if pressed[RIGHT]:
        pattern = 0
        wheel.clear()
        for i in range(NUM_LEDS):
            wheel.set_hsv(i, blue, 1.0, brightness)
        for s in range(STRIP_LEDS):
            led_strip.set_hsv(s, blue,  1.0, brightness) 
        wheel.set_hsv(0, 1.0, 0, 1.0)
        wheel.set_hsv(6, blue, 1.0, 1.0)
        wheel.set_hsv(11, blue, 1.0, 1.0)
        wheel.set_hsv(12, green, 1.0, 1.0)
        wheel.set_hsv(13, red, 1.0, 1.0)
        wheel.set_hsv(18, red, 1.0, 1.0)
        color = blue
        
    if pressed[DOWN]:
        pattern = 1
        wheel.clear()
        '''
        for i in range(NUM_LEDS):
            wheel.set_hsv(i, green, 1.0, brightness)
        for s in range(STRIP_LEDS):
            led_strip.set_hsv(s, green,  1.0, brightness)
            
        wheel.set_hsv(0, 1.0, 0, 1.0)
        wheel.set_hsv(6, blue, 1.0, 1.0)
        wheel.set_hsv(11, blue, 1.0, 1.0)
        wheel.set_hsv(12, green, 1.0, 1.0)
        wheel.set_hsv(13, red, 1.0, 1.0)
        wheel.set_hsv(18, red, 1.0, 1.0)
        '''
        
    if pressed[LEFT]:
        pattern = 0
        wheel.clear()
        for i in range(NUM_LEDS):
            wheel.set_hsv(i, red, 1.0, brightness)
        for s in range(STRIP_LEDS):
            led_strip.set_hsv(s, red,  1.0, brightness)         
        wheel.set_hsv(0, 1.0, 0, 1.0)
        wheel.set_hsv(6, blue, 1.0, 1.0)
        wheel.set_hsv(11, blue, 1.0, 1.0)
        wheel.set_hsv(12, green, 1.0, 1.0)
        wheel.set_hsv(13, red, 1.0, 1.0)
        wheel.set_hsv(18, red, 1.0, 1.0)
        color = red
        
    if pressed[CENTRE]:
        pattern = 0
        wheel.clear()
        for s in range(STRIP_LEDS):
            led_strip.set_hsv(s, 0, 0, 0)              

        
    # Has the dial been turned since the last time we checked?
    change = wheel.delta()
    if change != 0:
        # Print out the direction the dial was turned, and the count
        if change > 0:
            print("Clockwise, Count =", wheel.count())
        else:
            print("Counter Clockwise, Count =", wheel.count())

        position = wheel.count()
        
        brightness = ((position + 25) / 50)
        
        if brightness < 0:
            brightness = 0
            
        if brightness > 1:
            brightness = 1
        
        print ("Brightness =", brightness)
        
        wheel.clear()
        
        if pattern == 0:
        
            if color == white:
                for i in range(NUM_LEDS):
                    wheel.set_hsv(i, 1.0, 0, brightness)
                for s in range(STRIP_LEDS):
                    led_strip.set_hsv(s, 1.0,  0, brightness)         

            else:
                for i in range(NUM_LEDS):
                    wheel.set_hsv(i, color, 1.0, brightness)
                for s in range(STRIP_LEDS):
                    led_strip.set_hsv(s, color,  1.0, brightness)         

            wheel.set_hsv(0, 1.0, 0, 1.0)
            wheel.set_hsv(6, blue, 1.0, 1.0)
            wheel.set_hsv(11, blue, 1.0, 1.0)
            wheel.set_hsv(12, green, 1.0, 1.0)
            wheel.set_hsv(13, red, 1.0, 1.0)
            wheel.set_hsv(18, red, 1.0, 1.0)
            
    if pattern == 1:
        SPEED = min(255, max(1, SPEED))
        offset += float(SPEED) / 2000.0
        offset %= 1
        
        for s in range(STRIP_LEDS):
            hue = (offset + float(s) / STRIP_LEDS) % 1
            led_strip.set_hsv(s, hue + offset, 1.0, brightness)
        for i in range(NUM_LEDS):
            wheel.set_hsv(i, hue + offset, 1.0, brightness)            
            
        time.sleep(1.0 / UPDATES)        

    wheel.show()