Arduino for beginners. Lesson 5. Three-color LED

Conventional LEDs occupy leading positions in modern lighting systems for various purposes. Multicolor RGB devices are no less popular today. The light, colored in various shades, is ideal for decorative design of architectural elements, artistic lighting of landscape and interior items. Thanks to the ability to connect RGB LEDs to various control devices and combine them into large-scale groups, they create spectacular lighting scenarios and equally impressive moving images.

What is an RGB LED?

The device is a full-color LED element capable of reproducing the entire spectrum of rainbow colors. Unlike conventional LEDs, it has three independent light sources that emit light in three basic colors - Red, Green and Blue.

Characteristics of RGB LED

The operation of the device is based on the optical effect of creating different shades by controlled mixing of 2-3 primary colors. Combination is possible in different order and ratio. To create the desired shade, a change in the brightness of each individual crystal is used. Using the basic characteristics of RGB LEDs, you can create interesting lighting effects by mixing colors, alternately switching on individual conductors, and changing shades in the desired sequence. When all 3 semiconductors are operating at full power, the diode emits white light.

Soldering characteristics of SMD 5050

Very often the question arises among amateurs, “how to properly solder SMD 5050 diodes.” For me there is nothing complicated about this anymore. But to complete the picture, I will give a number of theses that need to be followed in order to get a high-quality result quickly, without rework.

  • SMD 5050 should be soldered no more than once
  • Don't put too much pressure on your body
  • Do not turn the circuit board over until the solder has cooled completely.
  • Use only low-temperature solder paste in your work.
  • In manual mode, the temperature of the soldering iron should not exceed 300 degrees Celsius
  • The maximum soldering time is no more than 2-3 seconds

How multicolor LEDs work

RGB LED modules have a characteristic design - three color diodes installed on one matrix and covered with a single optical lens. A flexible tape or a rigid matrix with a three-layer structure is used as a base. Each crystal has a separate connection to the power supply. Accordingly, the RGB LED has 4 contacts - one common and one per semiconductor.

Principle of operation

Such devices are created and operate using COB technology. They have several identical pn junctions. When voltage is applied to one crystal, charge recombination results in a glow of a certain color. When 2-3 elements are turned on simultaneously at a certain power, a secondary glow of the phosphor appears with the formation of various shades. So, when the red and green crystals are turned on in pairs, the RGB LED will produce yellow light. Simultaneous activation of blue and green will produce a turquoise tint.

How does a bi-color LED work?

The name bicolor LED does not come from the fact that the device is colored in a special way, but because it can glow in two colors.

They are turned on separately. For example, if we are talking about a red-green lamp, at first only red lights up, then the red goes out and the green lights up. This feature is related to the design of the device.

All two-color LEDs are made with two leads. The color changes depending on which direction the current flows through the lamp. The diagram of such a device is quite clear. It contains a resistor and two diodes connected towards each other. The diodes are connected in parallel. When current flows in the forward direction, one diode is locked and does not light up. When the current is directed in the opposite direction, everything repeats exactly the opposite.

LEDs have a limited range of pure colors. With great effort, scientists have managed to create crystals that generate colors similar to those of the rainbow. There is:

  • red;
  • orange (amber);
  • yellow;
  • green;
  • blue

And how many more shades. White, like millions of other tones, is the result of their combination.

Kinds

RGB LEDs are available in various designs, which allows you to choose the optimal device for various purposes. The device can be equipped with a transparent or frosted lens. These devices also have different housing designs - a standard round one, a high-power Emitter model and a Piranha format module.

The main classification of RGB LEDs is based on the type of crystal connection inside:

  • with a common cathode (CA) - control is carried out by applying a signal of positive polarity to the anode;
  • with a common anode (CC) - changing operating modes is carried out by applying a negative pulse to the cathode;
  • with independent elements - each crystal has its own pair of contacts (6 pins in total), suitable for switching in various ways.

Varieties

The variety of applications of multicolor LED light sources determines the main types of external design of RGB LEDs:

  • low-power products are produced in standard round cases with a spherical lens and leads for conventional soldering;
  • low-power RGB LEDs in surface-mount SMD packages are widely used in LED strips or large-area full-color LED screens;
  • in Emitter-type housings they produce powerful RGB light sources with independent control of each LED crystal;
  • Super bright LEDs in Piranha packages do not require heat dissipation and are easily mounted on printed circuit boards.

To simplify light control systems, control chips are built into the housings of some series of multicolor LED light sources.

RGBW LEDs

Creating a pure white glow using a standard three-color module is quite difficult. This requires precise balancing of the power supply for each individual crystal. And even with successful adjustment, the color turns out dull. To simplify the process of creating white backlighting, four-color LEDs - RGBW - were created. In addition to the three elements of basic colors, they have an additional white chip (RGB + White). Its presence significantly increases the quality of color rendering, expands the palette of reproduced shades and reduces the load on the controller.

Areas of application

Multicolor LEDs are actively used to create original lighting designs for objects and decorative lighting of various elements. Using strips and other devices with RGB modules, you can create interesting lighting effects for various purposes:

  • design of advertising structures and objects;
  • visual special effects during public events;
  • decoration of building facades and entrances;
  • decorative lighting of fountains, bridges and other structures;
  • design of residential interiors.

How to control RGB LEDs

This type of device is difficult to install. To power RGB LEDs, a constant voltage of 12V or 24V is required. Direct connection to a 220V network is not allowed!

Connection

To use the full capabilities of the multi-color LED module, it is attached to the controller. For example, a universal Arduino block. The connection diagram of an RGB diode depends on the type of connection of its crystals:

  • The common terminal of the module with independent elements is connected to the “Gnd” contact, and the other three are connected to the corresponding points.
  • Modules with a common anode are connected to the negative “Gnd” contact, which is located in the same row as the cathodes.
  • Devices with a common cathode are connected to the positive contact “Gnd”, which is located in the opposite row.

In all cases, each contact of the RGB LED must have a current-limiting resistor. Direct soldering is strictly prohibited.

control circuit for two-color LEDs up to 1A


Control circuit for two-color LEDs on the controller
The control circuit for two-color LEDs is built on a TA7291P chip with two OUT outputs and two IN inputs. We connect two diodes or one two-color diode with a power of at least 1A to the output. If the logic at the inputs is the same, then the output potentials are equal, and accordingly the LED does not light up.

At different logical levels at the inputs, the microcircuit operates as follows. If one of the inputs, for example, IN1, has a low logical level, then the output OUT1 is connected to the common wire. The cathode of LED HL2 is also connected to the common wire through resistor R2. The voltage at the OUT2 output (if there is a logical one at the IN2 input) in this case depends on the voltage at the V_ref input, which allows you to adjust the brightness of the HL2 LED.

In this case, the voltage V_ref is obtained from PWM pulses from the microcontroller using the integrating chain R1C1, which regulates the brightness of the LED connected to the output. The microcontroller also controls the inputs IN1 and IN2, which allows you to obtain a wide variety of shades of light and LED control algorithms. The resistance of resistor R2 is calculated based on the maximum permissible current of the LEDs.

How the color of the glow changes

In normal mode, the RGB LED produces only a static glow. However, the multicolor backlight looks most impressive in dynamic mode. The ability to conveniently control colors and scenarios is provided by the Arduino microcontroller. It changes the brightness of the crystals using pulse width modulation (PWM). The device provides automatic playback of scenarios, and their configuration and activation is carried out manually by the user using the remote control.

Also, other methods can be used to control an RGB LED - a system of built-in drivers or special circuits based on transistors.

LED size 5050

All dimensions are given in millimeters, measurement accuracy is +- 0.1mm. During production of diodes, dimensions may change very slightly.

The lens used in production is transparent. The chip is based on InGaN. Typically, the lens consists of a silicone compound. The case itself is made of heat-resistant plastic.

LEDs of this brand are supplied in coils.

Well, that seems to be all... I tried to describe the SMD 5050 as fully as possible. It turned out to be a lot of buffoonery, but at a quick glance, I didn’t seem to have missed anything. If something is wrong, don't kick it too hard. Ready for constructive communication))) Lastly, for those who are not too tired, you can watch a video about proper installation and soldering of SMD 5050.

Pros and cons of RGB LEDs

The main disadvantage of three-color LEDs is the inability to create high-quality white light. This imposes significant restrictions on the use of RGB as the main lighting source. However, this disadvantage is offset by the presence on the market of four-color RGBW modules with an additional white chip.

The advantages of multicolor LEDs include all the advantages of LED devices:

  • affordable price;
  • minimal energy consumption;
  • long service life;
  • environmental friendliness and fire safety;
  • high quality of emitted light.

Application

Despite their not very wide emission spectrum, two-color LEDs find their own niche in instrument making.

They are used for light signaling, in room decoration, and in advertising. Two-color LEDs are indicators of rotation of the DC motor. They show in which direction the rotation occurs.

Three-color LEDs operating on two crystals find similar applications. Their advantage over three-crystal lamps is their relatively low cost. At the same time, the capabilities of the devices are quite wide.

The operation of such an LED is well illustrated by the indicator light of the charger of our cameras, phones, tablets and many other devices. When the battery is low it glows red, and when fully charged it lights up green.

Rating
( 2 ratings, average 4.5 out of 5 )
Did you like the article? Share with friends:
For any suggestions regarding the site: [email protected]
Для любых предложений по сайту: [email protected]