How to light and program LED strips with Arduino easily

0
98

The idea of ​​programming LED strips with Arduino has been growing over time due to the massive increase in the use of LED lighting. This radical change in the use of Led strips or lighting that involves these lights is the product of production factors; since they are cheaper to produce and also consume less energy.

So, the use of Led lights guarantees energy savings, greater safety, economic accessibility and excellent performance with wide scopes in its lighting. That is why programming Led strips with Arduino for any function is important today to strengthen the development of a project; either on a professional or personal level.

Connection to turn on and program Led strips with Arduino

At first, to carry out the programming of Led strips with Arduino, you must know the definition of Arduino and its usefulness. This device was created to facilitate the interactive use of any electronic base for the development of projects at basic levels for any programmer; as students or professionals implemented in the labor field.

An Arduino is characterized by being an open source board capable of being programmed through its own software developed for this device. Enter its official page to download the Arduino Ide software and start programming Led strips with Arduino by following these steps:

Connection

As a first step to program LED strips with Arduino, the pertinent physical connection between the Arduino and the LED strips to be used must be made. These strips have 3 pins marked with the following indicators:

  • 5V
  • GND
  • Din (Data Pins)

It is important to take into account the number of LED strips that you want to connect, since the power consumption of each strip is about 60 mA; where it contains 3 white LEDs that at full brightness individually consume 20 mA, so with an Arduino you can light 5 LED strips; since this device delivers a 5 V supply and supplies about 300 mA.

These Arduinos require an external 5V supply, which is usually obtained by connecting the USB cable to the computer. With it we guarantee the power supply for both the Arduino and the LED strip circuit where a cable will be connected; from the 5V Pin of the Arduino to the 5V Pin of the led strip, this action is repeated for the GND pin of the Arduino to the GND Pin of the led strip.

Once the pertinent connection has been made for the power supply of the LED strips to be programmed, a third cable will be connected with a 470 Ω resistor inserted; that will represent the data Pin which will be in charge of sending information between the Arduino and the Led strip so that by programming Led strips it fulfills the objective of turning them on.

Programming to turn on Led strips with Arduino

Considered as a microprocessor as an alternative to control devices, the Arduino has the necessary characteristics to control an electronic circuit; whose main objective is to manage a system of actuators to put them into operation, as is the case with Led strips.

There are also devices such as the Raspberry pi as a powerful tool to replace the Arduino that has more advanced features, ideal for more demanding projects. But, for this particular case we will focus on programming Led strips with Arduino and we will carry out this work in the following way:

example of arduino board connection with leds on protoboard

  • Download and open the Arduino IDE software on your computer to program the device.
  • There are libraries that help a lot with the task of programming LED strips, better known as Adafruit’s neopixel library, which is very easy to use even for beginners.
  • With this library, you should only load the examples it contains and you will be able to observe the lighting effects.
  • To load a library in the IDE software, the following must be done:
  1. Go to the “Program” menu
  2. Click on the option “Include library”
  3. Then click on the “Manage Library” option.
  4. A window will open where the library will be searched to program the Led strips to finally load them into the software.
  • The library has the following programming:

programming code view for arduino board

  • The initial code cannot be used even until you configure the number of Leds in your strip, this is modified in the line:
  1. #define PIXEL_COUNT 16 (in this example it is set to 16 Led)
  2. Then configure the data Pin to use in the Arduino to program the Led strips in the following line:
  3. #define PIXEL_PIN 6 (for this example it is configured to use Arduino Pin 6)

Completing these simple steps, you will already have at your disposal a functional system of led strips which can be completed by adding a button if desired; to vary the lighting effect with each pulse through the button.

Previous articleHow to know if the model of a television is HD, Full HD or UHD 4K easily and quickly Where do you see the resolution?
Next articleFord F-150 Lightning test: is this electric pick-up that Antonio Banderas liked a heresy?