RGB light or mood lamp on ATtiny13. LED RGB backlight - features, types and characteristics RGB operating principle

New Year is just around the corner, festive mood, colorful lights... And of course you need to think about New Year's gifts for your loved ones. Have you already decided what to give? I thought about this for a long time and decided that the best gift is a gift made with my own hands. As a result, this design of an RGB lamp was conceived. It can be used anywhere and in any way, it is intuitive and simple, which means that anyone will like it. The function of the lamp is very simple: to illuminate the surrounding interior with various changing colors. Almost any microcontroller will do for this simple task, but I settled on the Attiny13 AVR microcontroller, since it is quite common, cheap and I have a lot of it. For the LED, I used a four-pin matte RGB LED with a common cathode.

The diagram shows the connection of an RGB LED with a common anode.

But during development I came across one problem: the Attiny13 microcontroller has only two hardware PWM outputs on timer 0 and that’s all. Oh, but you need three PWMs, for three colors... And the ambush, there is only one timer in the MK... So I decided to get creative and implemented three software PWMs on timer 0, it turned out very well, but this method is bad because the frequency This PWM turns out to be low. And so that the flickering of the LED was not visible, we had to run the microcontroller at a frequency of 9.6 MHz. I wrote the firmware in the BASCOM-AVR environment. The main thing is that everything works!

The RGB lamp is powered by two AA type pinky batteries of 1.5 volts each. The total is 3 volts, which is what the device needs. For convenient operation of the lamp, the batteries are inserted into a special compartment for them, which I purchased at a radio store. The LED needs to be used RGB with four pins, the common pin can be either the anode or the cathode, this will only change the connection of the LED according to the circuit, the board and the firmware. The Attiny13 microcontroller can be used with any letter indices, in any package (preferably in DIP so that it fits the board). To install the microcontroller, use the DIP-8 panel; this will allow you to quickly and conveniently remove the microcontroller from the board in case of replacement or firmware.

Prototype of an RGB lamp on a breadboard with mechanical contacts:

I implemented the lamp itself on a round printed circuit board with a diameter of 5 cm. The board is made on fiberglass, in order to make the board absolutely round, I first drilled it and processed it with a file along the contour of the circle. For the best quality, I recommend, first, transferring the design onto a square piece of PCB, etching it in a solution of ferric chloride or copper sulfate, and only then, along the contour of the circumference of the design, drilling and adjusting a round board. I made the drawing of the printed circuit board in the program, you can find the source files of the board below.

T13RGBA.LAY - Printed circuit board file for an LED lamp with a common anode
T13RGBK.LAY - PCB file for a lamp for an LED with a common cathode

I decided to use a small round flower pot as the body of the entire lamp; in fact, the printed circuit board was made for it.

RGB lamp without housing (board and battery compartment):

To operate the lamp, you need to flash the microcontroller with the appropriate firmware; for this you will need an AVR microcontroller programmer. Almost any programmer can be used, the main thing is that it supports ISP mode and the Attiny13 microcontroller. I wrote two versions of the firmware, one for a common anode LED and one for a common cathode LED. You can find the firmware files and sources in the environment below.

FWT13RGBA.HEX ​​- Firmware file for a lamp for an LED with a common anode

FWT13RGBK.HEX - Firmware file for a lamp for an LED with a common cathode

Regardless of the file, after flashing the firmware you need to flash the corresponding fuse bits listed below.

List of radioelements

Designation Type Denomination Quantity NoteShopMy notepad
IC1 MK AVR 8-bit

ATtiny13

1 Firmware required To notepad
HL1 RGB LED 1 To notepad
R1-R3 Resistor100 Ohm3 To notepad
R4 Resistor10 kOhm1 To notepad
C1 Electrolytic capacitor10 µF1 To notepad
C2 Ceramic capacitor0.1 µF1 To notepad
Locking button 1

We have repeatedly looked at a variety of LEDs, structure, use, etc. and so on. Today I would like to dwell on one of the types of LEDs (if you can say so) - RGB LEDs.

What is RGB LED and device


Connecting RGB diodes with Altmega8 PWM

We connect the anodes of the RGB LED to lines 1,2,3 of port B, and connect the cathodes to the minus. To obtain a variety of color palettes, we will apply a PWM signal to the anodes in a certain sequence. In this example, we specifically use software PWM, although on the Atmega8 you can easily get hardware PWM for 3 channels. Software PWM can be used in cases of timer/counter shortages and other reasons. To generate PWM of a certain frequency, we use an overflow interrupt of the 8-bit timer T0 (TIMER0_OVF_vect). Since we do not use a prescaler, the timer overflow frequency will be equal to 31250Hz. And if the variable "pwm_counter" counts up to 163, then the PWM frequency will be equal to 190 Hz. In the interrupt handler, based on the values ​​in the variables pwm_r, pwm_g, pwm_b, the pins of port B are switched. Color effects are configured using functions where the LED glow time is set. In the test program, red, green, blue, white lights up first, and then a cycle begins with color transitions.

Program code:

// Controlling the RGB LED. Software PWM

#include

#include

volatile char pwm_counter,pwm_r,pwm_g,pwm_b;

// Interrupt on T0 overflow

ISR (TIMER0_OVF_vect)

if (pwm_counter++ > 163)

pwm_counter = 0;

if (pwm_counter > pwm_r) PORTB |= (1<< PB1);

if (pwm_counter > pwm_g) PORTB |= (1<< PB2);

if (pwm_counter > pwm_b) PORTB |= (1<< PB3);

// Delay procedure in microseconds

void delay_us(unsigned char time_us)

( register unsigned char i;

for (i = 0; i< time_us; i++) // 4 цикла

( asm (" PUSH R0 "); // 2 loops

asm("POP R0"); // 2 cycles

// 8 cycles = 1 us for 8MHz

// Delay procedure in milliseconds

void delay_ms(unsigned int time_ms)

( register unsigned int i;

for (i = 0; i< time_ms; i++)

( delay_us(250);

// Red color

void red (unsigned int time)

for (char a = 0; a< 165; a++)

pwm_r = 164 - a; //increase

for (char a = 0; a< 165; a++)

pwm_r = a; //decrease

// Green color

void green (unsigned int time)

for (char a = 0; a< 165; a++)

pwm_g = 164 - a;

for (char a = 0; a< 165; a++)

// Blue color

void blue (unsigned int time)

for (char a = 0; a< 165; a++)

pwm_b = 164 - a;

for (char a = 0; a< 165; a++)

// White color

void white (unsigned int time)

for (char a = 0; a< 165; a++)

pwm_r = 164 - a;

pwm_g = 164 - a;

pwm_b = 164 - a;

for (char a = 0; a< 165; a++)

// Color transition

void rgb (unsigned int time)

for (char a = 0; a< 165; a++)

pwm_b = 164 - a;

for (char a = 0; a< 165; a++)

LED strips have long been used for local lighting and as main lighting. But in addition to monochrome (one-color) different colors, there are controllable RGB tapes (Blue, Green, Red) that can change their color. One of the manufacturers of such devices is Apeyron.

RGB technology

There are a number of features in the design and operation of the multicolor strip.

Differences from regular tape

Like a regular one, RGB tape is a printed circuit board in the form of a narrow strip along which conductive strips are applied. Unlike the standard one, on the RGB tape there are not 2, but 4 or 5 such stripes - common and one for each color.

Resistors and LEDs are installed on the board using the SMM (Surface Mounted Mevice) method, which vary depending on the type of tape:

  • Monochrome. Can be of any size and required color.
  • RGB. It uses SMD 5050 LEDs. This diode consists of three LEDs in one package. In a monochrome ribbon they are one color, in a multicolor ribbon they are different (red, green and blue). This combination allows you to change the color of the device or make it white. Black color ensures the absence of light.
  • RGBW. In addition to colored diodes, white ones are installed in the strip. This gives additional control over the brightness and color of the light.

In addition to devices in which all LEDs of the same color are controlled simultaneously, there are devices with chip diodes. They contain a chip that allows you to control each LED individually. This makes it possible to implement effects such as “running lights” or “star rain”.

Example of an RGB strip board

Benefits and uses

The advantage of such LED devices is the ability to change the color of the lighting, both manually and according to a predetermined program, as well as the organization of various lighting effects - color shifts, flickering or, when connecting the controller to a computer or music center, light music.

Such devices are used in a variety of places:

  • in the illumination of shop windows;
  • advertising signs;
  • creating a romantic atmosphere in the room;
  • lighting of the corridor or bedroom - blue light turns on at night, and bright white light in the evening or when signaled by a motion sensor;
  • aquarium lighting.

In addition to these options, many others are possible. The use of such devices is limited only by the designer’s imagination.


Multi-colored ribbons give scope for design possibilities

Tape selection

One of the questions that needs to be answered when organizing LED lighting is which strip to use.

Illumination level

First of all, you need to decide in what capacity the LED backlight will be used:

  • Decorative lighting. The functionality of the controller is of primary importance.
  • Zone lighting. This is additional lighting in the room. Its power is only a fraction of what is needed for the entire room.
  • Workplace lighting. It is difficult to find out the required power, since it is usually used in conjunction with the main lighting. Determined by selection method or using online calculators.
  • Main lighting of the entire room. The power is determined by the area of ​​the room and its purpose - in the bedroom it is 2 W/m2, in the kitchen or children's room - 3 W/m2, and in the brightest room - 3.5-4.

When drawing up the project, light loss in the diffuser or in the ceiling plinth is taken into account. They reach 50%. The option of two-zone and multi-zone illumination is possible.


An example of using zone backlighting. Such a tape will not provide illumination of the entire room, but it can highlight the desired part

LED type

The multi-color strip with LEDs contains SMD5050 crystals measuring 5 * 5 mm, consisting of three diodes and having 6 pins. In a single-color strip they are the same color, but in an RGB strip they are different (red, green, blue). A roll of such tape is 5 meters long and has a power of 144 W.

In addition to regular diodes, there are chip diodes, WS2812B and WS2812S. Outwardly, they are similar to ordinary ones, but inside they contain a PWM controller that allows you to control each LED individually. They implement a variety of effects, such as “running lights” or “star rain”. From such devices you can mount an LED screen. The disadvantage is the high price and the need to use a special controller.

Diode Density

The brightness and price of an LED strip depends not only on the size and type of diodes. The density of the crystals is no less important. In RGB tape it is 30–60 pcs/m. For greater brightness, two, three or four rows are used with a density of 120, 180, 240 pcs/m, respectively.

Ribbon color

The color of the RGB strip is adjusted by the brightness of LEDs of different colors. If the diodes turn on completely, the tape emits white light. By decreasing the brightness of one or two colors, the overall color of the tape changes. This is done using a controller.


The controller allows you to adjust the brightness and color of the tape

The RGB+WhiteRGBW LED strip is a two-row LED strip, in which one row is made of color LEDs and the second row is made of white LEDs. This makes it possible to obtain pastel colors, as well as increased brightness in normal lighting.

IP degree of protection

According to the level of protection from external conditions, devices are divided from unprotected (ip20, ip33) to partially protected (ip42, ip44) and sealed (ip67, ip68).

RGB strip power supply

The most common voltage of these devices is 12-24V. There are devices powered by 110 and even 220V, but they are not very common.

Selecting a power supply (driver) for a strip

The power supply for LED strips is selected based on the total power of the devices that will be connected to it. For example, if 5 meters with a power of 14.4 W/m and 3 meters with 7.2 W/m are connected, then the total load is 14.4*5+7.2*3=93.6 W. Considering the 20% margin (93.6+0.2x93.6= 112,32) , the power of the unit must be at least 112.32 W.

Expert opinion

Alexey Bartosh

Ask a question to an expert

Important! When connecting LED devices with long cables, larger cross-section wires are used to avoid voltage drop. Therefore, it is advisable to take several drivers instead of one and install them near the connection point.

Like the strips, power supplies come in dc12-24v as well as 110v.

How to control RGB strip light

To control the brightness of a single-color strip, you need a dimmer, but to take advantage of the full capabilities of multi-color devices, you need a controller. Otherwise, you will have to adjust each color separately, and the lighting effects will not be available.


RGB strip controller kit

Selecting a controller for RGB strip

The selection of a control device depends on three factors:

  • Power. It is calculated in the same way as the required power of a power supply unit - based on the total number of connected devices. Sometimes, as when choosing a power supply, it is advisable to purchase not one powerful RGB controller, but a smaller one and an RGB repeater.
  • The desired set of functions. There are a lot of types of control devices, but, for example, to illuminate goods in a display case or an aquarium, you do not need a device with a large number of lighting effects, and for additional lighting of the room, it is desirable to turn on a timer or light music.
  • Remote control. Just like selecting features, sometimes it's necessary and other times it's a waste of money.

When selecting, these points are taken into account so as not to purchase an overly expensive device, and at the same time its capabilities are quite sufficient.

Types of controllers

There are different types of controllers for controlling RGB LED strips: from the simplest, push-button ones, to those equipped with microprocessors and Wi-Fi.

Conventional devices can only select a specific color and provide simple lighting effects. Used to illuminate shop windows and other places.

More complex models can be programmed to change colors and effects on a timer. They can have a connector for flash memory and respond to lighting in the room and outside. There are also bluetooth controllers with a corresponding remote control.

The most complex devices can be connected to the smart home system.

Most bands have a remote control. It happens:

  • on buttons;
  • infrared;
  • on radio signals;
  • Bluetooth control;
  • Wi-Fi control.

The last two can replace an iPhone or a mobile phone with Android.


You can control the feed using your smartphone

In addition to conventional controllers, there are homemade devices that operate on the Arduino microprocessor board. Such homemade products control simple or chip LEDs and create light or color-music effects. Motion or light sensors are also connected to the Arduino-controller.

RGB controller operating modes

LED strips are installed in two types:

  • simple, controlled by changing the supply voltage simultaneously along the entire length;
  • chipped, with digital control of the color of each diode individually.

Accordingly, the controllers operate in two modes - analog and digital. These are different types of devices and are not interchangeable.

Connection methods

There are two options for connecting an RGB strip:

  • soldering;
  • connectors.

Solder connection

In order to solder the cable to the LED strip, you must:

  • Wire with a cross section of up to 0.5 mm2. A thicker one may tear off the contact pads.
  • Soldering iron with power up to 25 W. A powerful soldering iron will overheat the soldering area, and the pad will peel off from the base.
  • Solder and neutral flux.
  • Heat shrink tube 30 mm long.

Expert opinion

Alexey Bartosh

Specialist in repair and maintenance of electrical equipment and industrial electronics.

Ask a question to an expert

Attention! Active flux cannot be used. It will destroy the wire or contact strips, and also lead to a short circuit, after which the strip will have to be repaired.

Connectors for RGB LED strip

The modern connection method is connectors. These are small plastic devices with contact pads inside for connection to the tape. Their number should correspond to the number of conductive strips 2, 4 or 5.

These devices are available for various connection options:

  • with leads for power supply;
  • connecting, designed to connect two sections of strip;
  • corner, for connecting at an angle;
  • "T" or cross-shaped.

And many others. Using connectors, you can repair the device yourself.

Connecting to an RGB controller longer than its rated power

When controlling LEDs with a power exceeding the controller parameters, or when connecting devices located at a large distance, an RGB repeater is used.

The signal is sent to it from the controller via thin cables, and the device controls the glow of adjacent strips of tape.

Video review of the kit with remote control

📋 Take the test and test your knowledge


An RGB or RGBW LED strip is a lighting device consisting of several monochrome LEDs glowing in white, red, green or blue. It got its name thanks to the last three colors - the first letters of their English translation were taken (Red, Green, Blue - red, green and blue, respectively).

When it is directly connected to a DC source with a voltage of 12/24 V, it is impossible to realize the color effects for which such a tape was created. To provide a variety of colors and brightness, a special controller with a receiver for controlling the remote control (RC) is installed between the power source and the board. This receiver sets various programs according to which the RGB LED strip operates.

RGB technology

Multicolor tape was invented in the course of numerous scientific studies in which scientists tried to create a white glow from LEDs. Initially, blue phosphor diodes with a special white coating were used to produce it. Later, for these purposes, they began to use a strip with three LEDs - red, green and blue. All three are installed in one cell, and the emitted light is perceived by humans as white - this is RGBW technology.

By changing the brightness of a particular LED, you can get other colors and their shades. The number of the latter exceeds several hundred thousand. This is the main advantage of RGB technology over phosphor LED strips.

Device

Structurally, this is a flexible printed circuit board to which LEDs and resistors are attached, designed to reduce the current. Available in different widths - from 5 to 30 mm. The most popular LED strips are those with a set of six terminals, in which the LEDs are assembled inside a single housing.

LEDs are classified by size. The most common are SMD 5050 with dimensions of 5x5 mm. One linear meter of RGB strip can contain about 30 LEDs (a product with double density - 60). Power and luminous flux depend on the number of diodes and their size.

Tapes vary in degree of protection (IP00, etc.). The lower this parameter, the fewer options for using the lighting device. For example, poorly protected devices are used exclusively in dry rooms, and products in a silicone shell are not afraid of even complete immersion under water (IP68).

To place the tape on surfaces, double-sided tape is attached to its back side. You can always cut it into pieces, choosing the required length. Manufacturers of devices independently mark the places of cuts with dotted lines, and the “scissors” symbol is also depicted there. Cut the flex board in these areas, since this is the only area where the pads are installed for connecting to the power supply, followed by soldering or using connectors.

Controller for RGB strip

To take advantage of all the capabilities of the RGB strip, connect controllers to the circuit that perform a number of functions:

  • remote control control;
  • changing the brightness of LED diodes;
  • change in glow color;
  • mode selection - switching the frequency of color changes and their iridescence;
  • combination of primary colors to obtain new shades.

When choosing an RGB controller, consider two main criteria - compatibility with the connected strip and control method.

Such a controller can be controlled by:

  • via a Wi-Fi network using a tablet or smartphone;
  • remote control with infrared diodes;
  • without remote control (switch on the wall).

The last option is relevant if there is no need to frequently switch tape modes.

The main physical parameter characterizing an RGB controller is its rated power. To calculate it, take the formula Mk = Ml*L*Km, where:

  • Mk - rated power of the controller;
  • L - length of the segment in meters;
  • Ml - tape power in W/m;
  • Km is the power factor of the product.

The voltage required to power the controller must be the same as that of the RGB strip.

Amplifier for RGB strip

Another element used when connecting RGB boards is an amplifier. If the length of the tape exceeds five meters, you cannot do without it.

The product is equipped with two terminals - Input (input) and Output (output), and each of them has the same contact pads as the tape itself - R, G, B and “+”. There are terminals for connecting power - “plus” and “minus” (VDD and GND, respectively).

If there is sufficient power, 12 or 24 V is supplied from the additional unit. Connect the common ends of the tape to the Input terminals on the amplifier, then connect the Output terminal. At the end, the control unit is connected through the positive and negative terminals VDD and GND. It is very important to maintain polarity, otherwise the diodes will not light.

As a result, the connection algorithm is as follows: power supply, controller, first piece of tape, amplifier, second piece. Such an electrical circuit is controlled using one remote control.

If it is necessary to use several tapes of five meters or more in length, a second amplifier and control unit are connected to the circuit. The presence or absence of the latter is determined by the power of the glow. Parallel connection of power supplies is strictly prohibited - only using a diode bridge.

An amplifier is a bulky electrical element, so there is not always enough space for its convenient placement. If necessary, it can be replaced with a micromodel of reduced power (make sure that it is sufficient for the operation of the tape).

Important! If the power of the main amplifier is slightly lower than that required for the LED strip, purchase an additional microamplifier for the kit and connect it in series to the existing one.

power unit

LED RGB strips operate from 12 or 24 V power sources. When choosing a control unit, pay attention to several important physical conditions:

  • the voltage and power of the unit must meet the stated requirements for RGB;
  • Depending on the installation location, the device must be characterized by one or another degree of moisture protection.

Important! If you make mistakes when choosing, the unit will overheat greatly and after a short period of time will fail.

There are several types of power supplies that can be found on the market:

  • with an aluminum body, high tightness and protection against moisture penetration, but high cost;
  • mini-product in a plastic case, partially protected from moisture, at a lower cost;
  • an open unit located in a perforated housing, characterized by the largest dimensions and high power, requires additional means of protection from moisture;
  • network block - average power.

Read the instructions that came with the RGB strip. The power is indicated there for one linear meter. Multiply this value by the length of the flexible board, then increase the resulting value by 30% (there should always be a power reserve). As a result, you will find out the power of the power supply required for the selected LED strip.

Popular connection schemes

The implementation of any circuit requires a little knowledge, including an understanding of how to correctly divide an electrical product into parts.

Standard connection diagram

Observe the following installation procedure:

  1. Connect the controller to the power supply via the output (reduced) voltage terminals.
  2. Positive wires are highlighted in red, negative wires are highlighted in black.
  3. Connect the LED strip to the controller via three contact pads - R, G, B (control of three primary colors) and VDD (plus).

Option for connecting two LED strips

If you need to power two LED strips simultaneously, consider the following points:

  • you will need two power supplies and two amplifiers for RGB;
  • follow the order of connecting the wire in accordance with the color marking;
  • the circuit is suitable for supplying current to sections of boards whose length reaches 10 meters.

Basic rule: if at least two strips are connected to the circuit, their parallel connection is ensured (series will reduce the voltage power for LEDs located at the far ends from the power source and amplifier).

Connecting an RGB strip 20 meters long

When choosing a powerful power supply, you can use the “controller-amplifier-unit” connection diagram. In all other cases, two or more blocks are required.

Step-by-step installation instructions

When connecting an RGB color strip yourself, strict adherence to the algorithm is required:

  1. Finding the installation site and preparing the surface. First, decide on the installation location, and then level the surface to which the LED strip will be attached. It could be a ceiling, a door, etc. Be sure to degrease it using any solvent, otherwise the double-sided tape will come off after a short period of time. When attaching to metal surfaces, additional electrical insulation is required.
  2. Most LED RGB strips are self-adhesive - remove the protective film from the back and carefully press the product to the surface of the selected location. When making bends, their radius should be no more than 20 mm, otherwise problems may occur. Cut the tape in strictly designated places. When connecting different parts, use special connectors or a soldering iron (more about this in a separate article).
  3. Connecting the electrical circuit. Select the LED strip connection diagram from those suggested above. Combine the product with a controller, amplifier and power supply. Plug the latter into the network using an electrical plug. Connect the black wire of the unit to the V- terminal on the amplifier, the red wire to V+. Combine the LED strip wires with the contact pads of the controller in accordance with their color and designation: red - R, green - G, blue - B. The last wire is connected to the positive terminal - V+.
  4. The backlight operates from a 220 V network. Check its operation using the remote control.

Correct connection and operation of the RGB LED strip will allow you to create a unique atmosphere at home, decorate office or residential premises, or an outdoor gazebo. The presence of certain electrical products in the selected circuits depends on the length of the board, the number and standard size of the LED diodes used.

Glowing only in red - R, green - G, blue - B or white - CW, as a rule, they are connected directly to a 12 V or 24 V DC source. R G B LED strip, like monochrome ones, can also be connected to a DC power supply current by connecting terminals R, G and B to each other.

But in this case, the opportunity to implement the color lighting effects for which the tape was created will be missed. Therefore, when installing colored LED strips, an electronic controller is usually installed in the open circuit between the power supply and the strip. It allows you to automatically change the color and brightness of the tape in a dynamic mode according to a program specified from the remote control.

The photo shows an electrical diagram for connecting an R G B LED strip to a 220 V network. The power supply (adapter) converts an alternating voltage of 220 V into a direct current voltage of 12 V, which is supplied to the R G B controller through two wires, maintaining polarity. An LED strip is connected to the controller via four wires in accordance with the markings. For ease of installation and repair of LED lighting, the units are connected to each other using connectors.

Electrical circuit of LED R G B LED SMD-5050

To connect, and even more so repair, an R G B LED strip at a professional level, you need to understand how it works and know the electrical circuit and pinout of the LEDs used in the strips. The photo below shows a fragment of an R G B LED strip with a printed wiring diagram for LED crystals.

As can be seen in the diagram, the crystals in the LED are not electrically connected to each other. Three multi-colored crystals in one LED housing form a triad. Thanks to this design, by controlling the brightness of each crystal individually, you can obtain an infinite number of LED glow colors. The displays of cell phones, navigators, cameras, computer monitors, televisions and many other products are built on this principle of color management.

Technical characteristics of the SMD-5050 LED are given on the website page “Handbook of SMD LEDs”.

Electrical circuit of LED R G B strip on SMD-5050 LEDs

Having understood the design of the LED, it is easy to understand the design of the LED strip. At the top of the picture is a photograph of a working section of LED R G B strip, and at the bottom is its electrical circuit.


As can be seen from the diagram, the contact pads of the same name on the LED strip, located on its right and left sides, are electrically connected directly to each other. Thus, it is possible to supply power voltage to the tape from either end and to the next section of the tape when it is extended.

LED crystals VD1, VD2 and VD3 of the same glow color are connected in series. To limit the current, current-limiting resistors are installed in each of the color circuits. Two of them are rated 150 ohms, and one is 300 ohms, in a red crystal chain. A resistor of a larger value is installed to equalize the brightness of all colors, taking into account the intensity of radiation from the LED crystal and the different color sensitivity of the human eye to different colors.

How to cut LED strip into pieces

As you probably already understood, R G B LED strip of any length (this also applies to monochrome strips) consists of short independent segments that represent a finished product. It is enough to apply supply voltage to the contact pads and the tape will emit light. To obtain a piece of tape of the required length, elementary sections are connected to each other in accordance with the letter marking.

Typically the tape is produced in a length of five meters. If necessary, it can be shortened by cutting crosswise along a line drawn in the center of the contact pads between the markings; sometimes, in this place, a symbolic image of scissors is additionally applied. Sometimes the tape has to be cut to install at an angle. In this case, the cut contact pads of the same name are connected to each other by soldering with pieces of wire.

Ways to control glow color
R G B LED strips

There are two ways to control the color mode of an R G B LED strip, using three switches or an electronic device.

The principle of operation of the simplest controller on switches

Let's look at the operating principle of the simplest controller, based on mechanical switches. As a switch for manually controlling the glow of the R G B tape, you can use a three-key wall switch, designed to turn on chandeliers and lamps in a 220 V household network. The electrical connection diagram will then look like this.


Resistors R1-R3 serve to limit the current and can be installed anywhere in the power supply circuit for crystals of the same color. Using this scheme, you can connect R G B tapes designed for a supply voltage of both 12 V and 24 V.

As can be seen from the diagram, the positive terminal of the power supply is connected directly to the positive terminal of the LED strip, which is common to LEDs of all colors, and the negative terminal is connected to the R, G and B contacts of the strip through a switch. Using a switch of three switches, you can get seven colors of tape glow. This is the simplest, most reliable and cheapest way to control the glow colors of an R G B tape.

Operating principle of the electronic controller

To obtain an infinite number of glow colors of the R G B tape and in automatic mode dynamically change the value of the luminous flux, instead of switches, an electrical unit is used, which is called an R G B controller. It is included in the open circuit between the power supply and the R G B tape. Typically, the controller kit includes a remote control that allows you to remotely control its operating mode, and as a result, the lighting mode of the LED strip.

Since the operation of an LED strip usually requires a DC voltage of 12 V (less often 24 V), to connect it to a 220 V AC power supply, a power supply or adapter is used that converts AC voltage into DC voltage, which is connected through a detachable connection supplied to the controller unit.


Let's look at the operating principle of an RGB controller using the example of the simplest and most widely used controller, model LN-IR24. It consists of three functional units - an RGB control controller, power switches and an infrared sensor chip (IR). The controller chip is programmed with the required operating algorithm for the LED strip. The controller chip is controlled by a signal coming from the IR sensor chip. The IR sensor receives a control signal when you press buttons on the remote control.

The supply voltage to the LED strip is controlled using three field-effect transistors operating in switching mode. When a signal from the RGB control controller IC reaches the gate of the transistor, its drain-source junction opens and current begins to flow through the LEDs, causing them to emit light. The brightness of the LEDs is controlled by high-frequency changes in the pulse width of the supplied supply voltage (pulse width modulation).

Selecting a power supply and controller for R G B tape

The power supply for the RGB LED strip must be selected based on its supply voltage and current consumption. The most popular are LED strips for a DC voltage of 12 V. Current consumption in circuits R, G and B can be found from the label or determined independently using the reference data for LEDs presented in the table on the site page Reference table of parameters of popular SMD LEDs. It is customary to indicate the power consumption of a tape per meter of its length.

Let's look at an example of how to determine the power consumption of an RGB strip of an unknown type for a supply voltage of 12 V. For example, you need to select a power supply and controller for an RGB strip 5 m long. The first thing you need to do is determine the type of RGB LEDs installed on the strip. To do this, just measure the size of the sides of the LED. Let's say it turns out to be 5 mm × 5 mm. From the table we determine that this size is for an LED of the LED-RGB-SMD5050 type. Next you need to count the number of LED housings per meter of length. Let's say there are 30 pieces.

One LED crystal consumes a current of 0.02 A, three crystals are placed in one case, therefore the total current consumption of one LED will be 0.06 A. There are 30 LEDs per meter of length, multiply the current by the amount 0.06 A × 30 = 1.8 A. But the diodes are connected three in series, which means that the real current consumption of a meter of tape will be three times less, that is, 0.6 A. The length of our tape is five meters, therefore, the total current consumption will be 0.6 A × 5 m = 3 A.

Calculations have shown that to power an R G B tape five meters long, you need a power supply or network adapter with a DC output voltage of 12 V and a load current of at least 3 A. The power supply must have a current reserve, so an adapter model APO12-5075UV was selected, designed for a load current of up to 5 A. When choosing a power supply, you need to take into account that its output connector must match the R G B connector of the controller.

When choosing a controller, it is necessary to take into account that the current consumption in a single channel R, G or B will be three times less. Therefore, for our case, we need to take a controller designed for a voltage of 12 V and a maximum permissible load current per channel of at least 3 A/3=1 A.

For example, the LN-IR24B R G B controller meets these requirements. It is designed for a load current of up to 2 A (you can connect up to 10 meters of RGB tape). Allows you to turn the tape on and off, select 16 static colors and 6 dynamic modes remotely, from a distance of up to eight meters, using an elegant remote control. The supply voltage to the controller is supplied from the power supply or network adapter using a coaxial DC Jack. R G B controller LN-IR24B is lightweight and has small overall dimensions.


The appearance of the LED strip lighting kit prepared based on the calculation results is shown in the photograph. The kit includes a power supply model APO12-5075UV, R G B controller LN-IR24B with remote control and R G B LED strip.


If you need to connect several five-meter R G B strips, you will need a more powerful controller, for example, CT305R, which allows you to supply current up to 5 A to LEDs of the same color. This controller can be controlled not only using a remote control, but also via a network from a computer, thereby turning R G B lighting into color and musical accompaniment when listening to music.

It is unacceptable to connect LED strips longer than five meters in series, since the current-carrying paths of the strip itself have a small cross-section. Such a connection will lead to a decrease in the luminous flux on a section of tape exceeding a length of five meters. If you need to connect several five-meter LED strips, then the conductors of each of them are connected directly to the controller.

In powerful models of controllers, terminal blocks are used to connect external devices, in which the wires are clamped with a screw. There must be markings next to the terminals. INPUT (IN) means input; an external power supply is connected to these terminals, from which the supply voltage is supplied for the controller itself and the LED strips. Polarity is indicated by additional signs “+” and “-”. Failure to observe the correct polarity when connecting the power supply may damage the controller.

The group of terminals for connecting R G B tape is marked OUTPUT (OUT) and means output. The colors are designated by the letters R (red), G (green), B (blue) and V+ (this is the common wire of any other color). Colored wires usually come from the tape too, and it’s enough to just connect them color to color.

I note that you can successfully connect a monochrome LED strip to any RGB controller that matches the current. Then it will be possible to use the remote control to change the mode of its glow - turn it on, off, change the brightness, set a dynamic mode for changing the brightness.