[No soldering] RGB Ambient Lighting: Arduino + WS2812B no soldering build

Come along, no time to waste. It’s almost 2 am here, and I want to document this build immediately. Spoiler warning, it took me 8 months to complete this blog.

While thinking about this blog, I tried to consider what my writing style should be. I haven’t documented my hardware builds before. So, I thought I would document my build on how it went and what links helped me. No point reinventing the wheel and explaining common concepts again. Please feel free to skip sections as and when you feel things are going dull. This build has been a meticulous learning process of over 8 months filled with procrastination and the inability to get any work done until the mental plan was complete. As with all posts on Mixster, feel free to pop your questions down in the comments. So, here we go.

I started with basics

  1. Adafruit’s guide to working with LEDs and Arduino Uno are great for getting started.
  2. Googling about LED strips and learning about the types also helped.
  3. Create a mental picture of how the setup should look like.
  4. Did research to fact-check my mental picture and start working towards making it a reality.

After this blog, adding ambient lighting to my setup looked something like this.


Talk is cheap, getting the hardware needed

For the build, here’s what I used

  1. I got an Arduino Uno. You can use any Arduino model you have. Nano. Mega.
  2. Got a 5-volt WS2812B individually addressable RGB LED strip having 3pin JST-SM connectors. These Protium strips worked out great for me. The 5V strip is important because that’s the voltage your power supply should supply.
  3. A 5V power supply for the strip. I spliced an existing RPi power supply rated for 5V, 2.5 Amps
  4. USB A male to USB B Male cable to connect and power the Arduino
  5. (Optional) LED strip connector for 5050 LED
  6. Jumper wires for connections.
  7. Some double-sided tape.

This is a mess, but it’s what I used for this project, more or less

Figuring out hardware: Getting comfortable with Arduino

The Arduino Uno is an open-source microcontroller board based on the Microchip ATmega328P microcontroller. It’s also an absolute unit of a microcontroller for someone to get started with tons of guides and helpful forums to help you get through. Here’s how I got acquainted with it.

  1. I connected my Arduino to my laptop and started off with some basic programs on Arduino IDE like blink, and figuring out the GPIO header.
  2. Once that was done, I connected my LED strip to the Arduino’s 5V output and tried out the fastLED library. The practice was easier when using the fastLED examples. I tried blinking and changing LED colors. I would recommend starting slow and learning by breaking x tweaking the examples.
  3. I had issues making the port /dev/ttyACM0 available on Arduino in Linux. The iniarduino project solves most of those issues. Highly recommend.
  4. Once I was comfortable, the adalight project came in handy. The project is deprecated but the core component still works using Hyperion (The software that will run the Ambilight project)

Time to do some maths: How many LED’s can be used?

So, I have bought the LEDs, figured out how to use the Arduino, and even made some LEDs blink. Happy life right? This is where things get a little complicated. I needed to figure out, how many LEDs one can power on with their setup. There are also data considerations but I didn’t need to worry about that when using Uno. Thankfully, I happen to find this great cheatsheet in this blog (that doesn’t exist now but thanks to the Wayback machine) to answer your questions.

Here’s what I calculated.

  1. My Raspberry Pi power supply can only do 5V, 2.5 amps. In an ideal scenario, each LED takes 60mA per LED which means I can only run 41 LEDs from my power supply.
  2. According to my monitor’s width and the LEDs per meter of the strip that I used. I will be using about 89 LEDs for 100% coverage of the perimeter. Double the LEDs my power supply can accomodate.
  3. With all this in consideration. I decided to go the risky route by running with 77 LEDs instead to cover 86% of the monitor’s back panel. I was able to do this by running the LEDs at 80% brightness.

Hence, at the highest load (white light at full brightness) each LED in my setup can receive about 32.4 mA max current. Which was something I can live with at least I don’t have to buy a new power supply. With the LEDs calculated and the strip now cut and tested, everything seems to be working. Let’s start with the software end of this setup.


Figuring out the software: Running Hyperion

Disclaimer: This is the easier part of our project.

  1. Install Hyperion and run it on your system. Hyperion is an open-source ambient light software supported by many devices. This runs a server on localhost that does screen capturing to calculate color values, management of light effects, and even above and beyond to create your own effects. Hyperion is essentially the one instruction the Arduino what signals to send and to which LEDs.
  2. For me, Hyperion runs with the command hyperiond on Linux which starts the server on localhost port 8090. This is where you will find the Hyperion dashboard. Head to the LED output button in the sidebar of the dashboard and select the controller type as Adalight. Adalight is how I ran the project with Hyperion.
Do make sure to explore Hyperion in your own time, it’s very cool.

3. After selecting the Adalight Controller type, and filling in the fields on the dashboard. I configured my LED setup using the LED layout tab. This was really helpful in figuring out the arrangement of LEDs in software and provides you with a checklist to get it right. This did require some tinkering but with the virtual screen feature, I was able to get it right for my setup after a few tries.

4. In order to test my setup, I configured the Arduino to accept the signals provided by Hyperion and light the LEDs as per the images shown on the monitor. To get the Arduino working, I pick this code, compiled it on the Arduino IDE, and uploaded it to my Arduino. Tip: It should instantly work out but if it doesn’t then tweak the values provided in the configuration to match the values present in the code. There are docs on Hyperion as well. Adding in some testing photos where I checked if it actually works.

5. Looking around, I configured my capturing source to be my monitor. Since I run a multi-screen setup with a 27-inch monitor + a 14-inch ThinkPad. Hence, some configuration is needed to pick the right screen for image capture which would then be used for ambient light colors. USB capture can also be used but will require additional capturing hardware.


Here’s how the setup looks

I made a quick sketch with Fritzing, this is how the circuit looks overall.

Here’s what it actually looks like at the back of my monitor. The definition of jank.


Sticking the LED’s and some cable management

After testing everything works and all LEDs are fine, this is the sticky part of the project. I started sticking the LED to only 3 sides of the monitor since I couldn’t power all the LEDs needed for the perimeter. This was a consideration I made beforehand which was the best I could come up with right now. The monitor’s back panel is also curved, so I only put could put LED on the flat surface for easier sticking.

I decided to not cut the LED strip since I would be upgrading this setup later with a better power supply and didn’t want to go through the hassle of soldering together LED strips. Hence, I hung the excess LED strip spool on the monitor stand. As I concluded before, yes I am all about that jank setup.

Now you might ask. Vipul, why is that Arduino hanging for its dear life? To that I say, I didn’t bother sticking it up to the back of my monitor. So, yeah all the wires are kinda hidden behind my monitor with the Arduino hanging mid-air getting power from the monitor’s USB hub.


It’s Showtime!!

And, I was done, and here’s the final result.

Check out the journey of this build on Twitter

https://platform.twitter.com/widgets.js

This post has spent more time as a draft than anything else I have worked on in the past. Glad to have finally found some motivation to work on publishing it. Always be documenting – that’s what I like to do here. Hopefully, I will continue working on ideas like this in the future. Thanks for letting me borrow your eyeballs and live in the mix, folks.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s