How to build an ambilight system for your monitor
July 23, 2021
In this article I'll explain how to build your own ambilight system for your pc monitor, you can do this cheaply with parts ordered from Amazon or Aliexpress.
Bill of materials
- Mini USB cable
- WS2812b Leds 60/m
- Corner connectors (Optional)
- Arduino Nano
- LED connectors (optional)
- Power Connector (Optional)
Other Equipment
- Soldering Iron
- Tape
- Optional Hot Glue Gun
Software
- Unofficial Prismatik Fork
- Arduino IDE
- Adalight WS2812
- FastLED Arduino library
/** Arduino interface for the use of WS2812 strip LEDs* Uses Adalight protocol and is compatible with Boblight, Prismatik etc...* "Magic Word" for synchronisation is 'Ada' followed by LED High, Low and Checksum* @author: Wifsimster <wifsimster@gmail.com>* @library: FastLED v3.001* @date: 11/22/2015*/#include "FastLED.h"#define NUM_LEDS 111#define DATA_PIN 5// Baudrate, higher rate allows faster refresh rate and more LEDs (defined in /etc/boblight.conf)#define serialRate 115200// Adalight sends a "Magic Word" (defined in /etc/boblight.conf) before sending the pixel datauint8_t prefix[] = {'A', 'd', 'a'}, hi, lo, chk, i;// Initialise LED-arrayCRGB leds[NUM_LEDS];void setup() {// Use NEOPIXEL to keep true colorsFastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);// Initial RGB flashLEDS.showColor(CRGB(255, 0, 0));delay(500);LEDS.showColor(CRGB(0, 255, 0));delay(500);LEDS.showColor(CRGB(0, 0, 255));delay(500);LEDS.showColor(CRGB(0, 0, 0));Serial.begin(serialRate);// Send "Magic Word" string to hostSerial.print("Ada\n");}void loop() {// Wait for first byte of Magic Wordfor(i = 0; i < sizeof prefix; ++i) {waitLoop: while (!Serial.available()) ;;// Check next byte in Magic Wordif(prefix[i] == Serial.read()) continue;// otherwise, start overi = 0;goto waitLoop;}// Hi, Lo, Checksumwhile (!Serial.available()) ;;hi=Serial.read();while (!Serial.available()) ;;lo=Serial.read();while (!Serial.available()) ;;chk=Serial.read();// If checksum does not match go back to waitif (chk != (hi ^ lo ^ 0x55)) {i=0;goto waitLoop;}memset(leds, 0, NUM_LEDS * sizeof(struct CRGB));// Read the transmission data and set LED valuesfor (uint8_t i = 0; i < NUM_LEDS; i++) {byte r, g, b;while(!Serial.available());r = Serial.read();while(!Serial.available());g = Serial.read();while(!Serial.available());b = Serial.read();leds[i].r = r;leds[i].g = g;leds[i].b = b;}// Shows new valuesFastLED.show();}
Step 1
Start by measuring out the required lengths of LED strips along the back of your monitor and cut to size making sure to cut only along the marked cut points on the LED strip and ensuring that the same number of LEDs are on each side strip and each bottom strip
Step 2
Once you have the LEDs cut assemble them away from your monitor using the corner connectors or some small pieces of wire (make sure you follow the direction arrows on the LED strip, otherwise the LEDs wont all work). If using the corner connectors you'll want to solder the LED strips to the connectors (even though they are sold as solderless - they give a poor connection without soldering)