DIY-Beleuchtung mit WLED: Smarte Lichtsteuerung einfach umgesetzt - Teil 2 - AZ-Delivery

After im first part In this article we consider possible uses and expand the control with hardware components. In addition to the control of LED rings, LED stripes or matrices can also be used, which, thanks to their flexibility in length/size, enable a variety of creative light installations.

Power supply

To ensure stable and even lighting, the choice of the right power supply is crucial. Especially with longer LED strips, it is important to use a power supply that provides enough power. In addition, feed points should be strategically set along the stripes in order to avoid voltage waste that could otherwise lead to differences in brightness.
To find a suitable power supply, you can either use the required power in the WLED settings (under LED PREFERENCES after setting the correct LED number), or detailed information from the official WLED PowerCalculator page receive.
Two variants are available for the power supply:

  1. Use of a 5V switching power supply, e.g. 10a power supply
  2. Use of an old laptop power supply

Many newer laptops are loaded via USB-C, while old laptops mostly used plug-in power supplies in different variants. Since the WS2812 LED require a voltage of 5V, we regulate this higher voltage with a step-down converter to 5V. Since the output power minus a low loss of the input power corresponds, LED stripes with 5V and 5A can be operated on a 12V 2.2A (26W) laptop power supply.
The following modules are suitable for this:

Module name

Maximum current

LM2596S

2a


XL4015

5a (cooling recommended)


XL4016

4a


XH-M401

8a


XL4016E1

12a


Since the values ​​mentioned above are the maximum current strength, it is advisable to plan some tolerance and possibly incorporate a controller with a higher maximum current.

The second method is a little more inefficient because the voltage is regulated twice and more power is lost. However, it is much cheaper and existing old power supplies can be reused.

Feed -in

With a high number of LEDs, so-called feed-in in the LED stripe should be made in order to compensate for the loss over the route and thus prevent the LEDs from glowing or do not function properly. For example, on long stripes connect an additional power supply to the end (the overall current can be divided into the two power supplies). If there are still problems with the power supply, a feed -in in the middle can also be connected.

To avoid problems for larger projects, use as short cables as possible (both for the power supply and the data line).

Matrix with WLED

So far we have concentrated on the control of an LED ring or stripes, whereby all effects were only shown in a dimension. With the use of an LED matrix that works in two dimensions, however, completely new design options open up. Instead of just creating light animations along a line or a ring, complex patterns and effects can now be displayed in an area.

The following panels are suitable for this:

name

Number of LED

Power supply


8x8

64

2.5a


16x16

256

10.5a

8x32

256

10.5a


To configure the matrix, the board doesn't have to be new flashy become, but only connected the matrix module instead of the ring and in the settings under 2D configuration The setting of 1d stripe on 2D matrix to be changed. As a result, completely new setting points open:

  1. The Matrix generator is a tool to integrate several panels.
  2. Alternatively to the Matrix generator the number of panels can also be entered manually.
  3. The LED arrangement is set on the last point. The top point defines the position of the first LED. The next two the order of the LED (horizontal/vertical straight/pre-moving). After that, only the number of LEDs and the offset for several modules must be set. (The LED number is automatically adopted in the LED Preferences))

In the screenshot above you can see the configuration for the 8x32 matrix.

After a suitable power supply (10a to the medium feed) was connected to the module, you can on the user interface under effects Play the special matrix effects. You can recognize this by the grid symbol behind the name.
Is a particularly interesting effect Scrolling text. The current time and the date are displayed here in the standard configuration. However, if you change the name of the segment, you can display this title. With the effect sliders, the speed, the text size and much more can be set.

Due to the high LED density, the WLED matrix is ​​ideally suited both as a creative decoration element, but also because of the enormous brightness as lighting.

LED watch

After you have already got to know a decorative and creative application by connecting an LED matrix, which enables impressive lighting effects to be presented, we will next look at a functional expansion: an LED clock in the analog style. This shows the hours in the form of a red LED, the minutes in green and seconds in blue. You can do the LED ring from the first part reuse, to reflect the appearance of a typical watch. Alternatively, the matrix can also be used again, creating a modern watch.

To configure the clock, open in the settings Time & Macros. KOn the time here, so that it matches its local time (Germany: UTC+ 3600s or summer time: UTC+ 7200S)

In the menu item below, click on Analog clock overlay. DYou can set the first and last LED. Furthermore, there is also the possibility to display a countdown to a certain time on a set day.

Ir control

After the application was discussed as a decoration in the previous sections, it is now about the control. In many commercial LED controls, infrared remote controls are used to control the light. Since these are cheap and intuitive to use, we want to expand our DIY lighting with the control via such a remote control.

For this we need:
Remote control
Ir receiver

Connect the receiver to a GPIO pin of the board as follows:

Ky-022

ESP8266

Left pin (-)

Gnd

Medium pin (+)

3V3

Right pin (s)

D8

To configure, open the LED PREFERENCES. At the end of the Hardware setup Find the drop-down IR-GPIO: In the first point, select the GPIO PIN (in the example GPIO15 (D8)) above and in the second the remote control (in the example 44 key).

If there are problems with the control via the infrared remote control, you can load the following program to an ESP8266 board. (Since the memory is deleted when the board flashes, it is advisable not to load the test program on the WLED board used in the project!)

#include <Irroteesp8266.h>
#include <Irrecv.h>
#include <Irutils.h>
 
Irrecv irrecv(5);
decode_results results;
 
void set up() {
  Serial.Begin(115200);
  irrecv.enableirin();
}
 
void loop() {
  IF (irrecv.decode(&results)) {
    serialprintuint64(results.value, Hex);
    Serial.print("");
    irrecv.resume();
  }
  delay(100);
}

To compile the code in the Arduino IDE, you have to install this in the board administrator if you first use the ESP8266 board

  1. At File> Preferences http://arduino.esp8266.com/stable/package_ESP8266COM_index.json insert into the Additional Board Manager Urls
  2. In the board administrator ESP8266 install.

In addition, the Irroteesp8266 Library can be installed as usual via the integrated Library Manager.

After the upload, the data received on the serial monitor are output in the hex format. The data should be constant and the corresponding correct information should be44 keys) contain.

If you want to use a different infrared remote control, select in the settings Json Remote out of. Then you have to upload your own JSON file. The file can be created in any text editor. Instructions for how this configuration file is written can be found in the documentation.

Conclusion

The control via infrared remote control is inexpensive, but it also brings disadvantages, such as the limited distance and that the recipient must always be visible. That is why you will get to know other control options of this versatile LED control software in the next part.

Have fun recovery :)

Esp-8266Projekte für anfänger

Laat een reactie achter

Alle opmerkingen worden voor publicatie gecontroleerd door een moderator

Aanbevolen blogberichten

  1. ESP32 jetzt über den Boardverwalter installieren - AZ-Delivery
  2. Internet-Radio mit dem ESP32 - UPDATE - AZ-Delivery
  3. Arduino IDE - Programmieren für Einsteiger - Teil 1 - AZ-Delivery
  4. ESP32 - das Multitalent - AZ-Delivery