WS2812B Ambient Light For TV Using Arduino

Nowadays, LED is a huge decoration factor in our daily life. It has not only made our life decorative but also reduced our electricity consumption. By keeping this factor in mind, here we are going to use a WS2812B RGB Addressable LED strip for our project Ambient Light for TV. RGB LED is a multifunctional light that can be used for various electronics projects, photography, filmmaking, gaming decoration, music VU meter and much more.

For this project, we are going to use the WS2812B RGB LED strip and an Arduino Nano to program and run the LED strip as the user’s choice. Here we use the Ambient Light Application to control the WS2812B LED strip for android TV.

Must Read DIY Ambient Light For Computer


DIY Ambient Light

Circuit Diagram

Ambient Light Circuit Diagram

Components Required

  • Arduino Nano
  • WS2812B Addressable LED Strip
  • 5V/3A Decent Power Supply

About Parts for Ambient Light


For the compact build, I choose Arduino Nano despite Arduino UNO. Arduino Nano is a small, flexible microcontroller board using an Atmega328p chip. It can also use as a substitute for UNO. All the functions are the same in these two boards. The size of its PCB is 18×45 mm. The clock speed is 16Mhz. Its input voltage is 5-12V. There are 30 pins including power pins, data pins, analog pins, and serial pins on this board.

WS2812B Addressable LED Strip

The WS2812B Addressable LED is a very cool LED light that contains a WS2812B LED controller IC and a 5050 RGB LED. The below image shows the WS2812B Addressable LED inner connection. It has four terminals inside the LED package i.e VDD, VSS, DIN and DOUT. VSS is used to power up the LED and VDD is connected to the ground. DIN control the inputted data signal as well as DOUT through the received data to the next WS2812B controller chip respectively.

PCB Design

For removing messy wiring and give a clean look, I designed a PCB prototype for this project. It is also helpful for troubleshooting that runs great without any errors. To design this PCB board, I used EasyEDA as it is too easy to use. For ordering PCB for this, I prefer PCBWay.

Gerber file for WS2812B Ambient Light Gerber.

PCB View

Ambient Light 2D View
2D View
Ambient Light 3D View
3D View

Order PCB From PCBWay

There are so many forums or communities for electronics online in today’s technical world, and one of the famous ones for PCB manufacturing is PCBWay. PCBWay is a place that brings manufacturers and customers together. They have more than a decade of experience in this field of fabrication, prototyping and assembling PCBs. PCBWay has proved its focus on its customers’ needs in terms of cost-effectiveness, delivery, and quality.

How PCB Manufacturing Process Done in PCBWay

Standard quality for any product needs to be maintained using some parameters. PCBWay gives that opportunity through quality control in designing and manufacturing. At first, they ensure the accuracy, clarity, and validity of the PCB files that we sent to them.

Then all the boards will go through the most stringent tests other than the basic visual check. They adopt most of the testing and inspecting equipment used in the industry, such as Flying Probe Tester, X-Ray Inspection Machine, and Automated Optical Inspection (AOI) Machine. PCBWay are having 50+ new engineers on the daily basis around the world using PCBs for their work, who trust for their reliable quality. They produce high-quality pink, orange, grey, and even transparent solder mask. Moreover, according to people’s needs, they can also provide Black core PCB. Check it out for a High-Quality PCB solder mask. There are some pictures below of the new colours of solder musks.

Features of PCBWay

PCB Prototyping & Manufacturing: PCBWay produces FR-4 and Aluminum boards and advanced PCBs like Rogers, HDI, and Flexible and Rigid-Flex boards, at a very reasonable price. Just check this Instant Quote to order premium PCBs for your hobby projects.

PCB Assembly: It not only offers PCB Prototyping but also offers PCB Assembly service. You can order a full PCB board with attached components by uploading your file. SMT & THT assembly starts from only 30$ including free stencil and worldwide shipping. The components can be sourced and provided by PCBWay, or by clients themselves.

Open Source Community: It not only offers PCB Prototype & Assembly service but also gives opportunities to students for sponsorships. I think this is so great. They feature their projects on the website also.

3D Printing & CNC: It also produces Rapid Prototyping like 3D printing, CNC Machining, Sheet Metal Fabrication, and Injection Molding. The quality of the product is too premium and reliable. And also the best part is that you will receive your order within a minimum of 3 days.

PCBWay Store: More boutique gift modules are waiting for you to discover, giving your creativity wings. You can order all types of electronic equipment, components and many more with exciting offers. Go with the link and buy your needs, PCBWay Store.

Services: PCBWay offers great servicing of its products. It takes only 3 to 15 days according to the courier service to deliver your products. Also, it has a live support facility. Whenever you have any problems, you can always reach a live customer service person to respond to you.

Calculation of Current Required for Drive The LED Strip

To proceed with constructing the LED first, we need to know the voltage requirement of the single 5050 RGB LEDs. Each WS2812B LED pixel has three types of LEDs i.e Red (20 mA), Green (20 mA) and Blue (20 mA). So the total current requirement is 60mA. And if we individually take 50 LEDs then the current is 3A. This is more than an Arduino can supply.

So the best way to power up the whole system is an external 5V/3A pure DC power supply that can provide enough current.

Process of Setting Up Ambient Light On The TV

Now come to the LED strip part. There you need to attach the LED strip from the left-bottom side to the left-top side, then the right-top side to the right-bottom side. We do this pattern because in the application this is the default pattern. But you can change it as your wish. Just need to define the pattern in the application that’s it.

After that connect the data pin of the LED strip with the digital pin (D4) of the Arduino and as well as VCC And ground respectively.

Attaching ws2812b led strip behind the tv

Ambient Light Application Setup for TV

First, we need to download and install the “Ambient Light Application for Android” from the playstore. It costs around rupees 240 or 3 dollars. After installation, open the application on the TV and go to settings.

  • There you need to define the total number of horizontal LEDs (choose any one part i.e., top or bottom). Similarly, specify the total number of vertical LEDs.
  • Keep the bottom gap value to zero.
  • Set LED strip direction to CW (Clock Wise)
  • Define the first LED offset to (-) of the total number of vertical LEDs.

And leave the rest of the settings as it is. For my purpose, this is the setting.

settings page of ambient light setup

Lastly back to the homescreen and select “Screen Capturing Mode” out of three modes.

Arduino Code

To compile this code you need to install this library first “FastLED.h“.

Leave a Comment