Introduction: Game Cabinet Lighting With Neopixels
I put together some ikea cube shelving and wanted a place to keep my game consoles while also displaying them. I started with 3d printing some vertical stands for the PS4, WiiU, XboxOne along with some controller hangers and riser shelves. I then added puck lights to the surrounding shelves, but wanted special lighting for the game shelves.
This is how to make color changing lights based on which system or systems are powered.
Note: The octopart links find inventory from multiple distributions. Pick whichever one you like.
Note: We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.
Trinket 5V - https://amzn.to/3gpQX6z #ad
NeoPixel Ring 16 RGB - https://amzn.to/34wuUcn #ad
Wired Under Cabinet Puck Lights - https://amzn.to/2YssTdl #ad
Backpack PCB - https://oshpark.com/shared_projects/CATpwF4r
10k resistors - https://octopart.com/search?q=RC0603FR-0710KL
Energy Saving Power Strip - https://amzn.to/3lDlC3T #ad
Potentiometer (optional) - https://octopart.com/search?q=3362U-1-103LF
Step 1: Solder Backpack PCB
In the schematic you can see three inputs into the Trinket. I use diodes so each input is both isolated and can power the trinket.
- Solder the 10k resistors and diodes to the backpack, then wire into the trinket.
I ordered a PCB from oshpark. For a flat $5, OSHPark will sell you three PCBs with free shipping and a turnaround of about 2 weeks. You don't have to order the PCB to make this circuit, but it does makes things cleaner.
Note: On the PCB, there is a RGB LED and three 220 ohm resistors on the backback pcb for debugging and not included in the parts list, leave them unpopulated.
Not all pins on the Trinket are equal. Be sure to read Adafruit's help pages https://learn.adafruit.com/introducing-trinket/pinouts Pins 3 and 4 should not be used as inputs and will conflict with talking to a PC for programming.
- GPIO #0 - Red Input, Attach to +5V wire from the first USB cable
- GPIO #1 - Blue Input, Attach to +5V wire from the second USB cable
- GPIO #2 - Green Input, Attach to +5V wire from the third USB cable
- GPIO #3 - Neopixel Data
- GPIO #4 - Potentiometer (optional)
Not shown in the schematic is the potentiometer on GPIO #4, that is optional if you want to change the colors after assembling. Is a pretty neat feature, I recommend the potentiometer if you plan on using my arduino code unmodified.
I also added a quick disconnect to Pin 4 so when I wanted to connect to the PC, I could remove the potentiometer without soldering.
Step 2: Wiring Assembly
If you have access to a 3d printer, an enclosure stl is provided. Thread the cables through the enclosure sides before soldering.
- Strip the USB cables and identify the 5V and Ground wires. Use a multimeter to be sure, but the 5V and Ground wires can also be identified by thickness. The power wires should be thicker than the data wires.
- Take apart the puck light and remove the PCB. Recycling the wiring that came with the puck light to wire into your neopixel rings.
- Use hot glue or epoxy to add the neopixel ring behind the puck light's diffuser.
Step 3: Programming
Use the arduino ide and adafruit neopixel library and adafruit trinket board package. Be sure to read Adafruit's help pages for each module.
If you followed my pin assignments, you can use the code without modification. After you get the neopixels to light up and changing based on which USB cable is powered. You can explore modifying the colors and animations.
Step 4: Usage, Testing, and Setting Colors
After initial programming, when you plug in each of the three USB cables you should see the ring light up red or blue or green. Combinations are allowed.
If you installed the optional potentiometer, you can change the color selected by a USB cable without reprogramming using a PC. There are 16 colors preprogrammed to select from.
Changing Color Programming without PC
- You will need two USB power ports to plug into.
- Connect the Micro USB on the trinket so power remains on while the other USBs are unplugged. Leave this plugged in throughout these steps.
- Take the USB cable you want to configure and plug it into your power block.
- Wait 5 seconds (or just wait for the animation to complete)
- Rapidly unplug and plug the cable in four times, ending with the USB plugged in.
- You must complete this four times, before the spinning animation ends.
- If you do it right, the animations will stop and you will see a steady light.
- If you mess up, wait 5 seconds before trying again.
Step 5: Additional Notes
I used the NeoPixel ring and Trinket I listed above because that is what I had extra. If I were to make one from scratch, I would use the RGBW Neopixel Rings and Arduino NANO 33 IoT instead. So I could use the Puck Light for normal lighting with commands to Alexa to change colors too!
Xbox One needs a workaround
Unlike my PS4 and WiiU that can be configured to turn off USB ports to save power when off, the xbox has no setting. Plugging in the xbox, the light is always green.
The workaround is the same trick I use to switch power lights and amps on/off in my arcade machine builds. I use something called Smart Strip. Capable of auto switching AC outlets off when the main device is off. Credit for the idea here.
Using the smart spike strip, I can power a USB power brick only when the xbox is actually on. Here is the one I am using: https://amzn.to/3lDlC3T #ad