Colorful Lantern

by chai0402 in Circuits > Arduino

384 Views, 4 Favorites, 0 Comments

Colorful Lantern

c0e8bee3817a22fad69490e4b377965.jpg

The exterior of this colorful lotus lamp is a 3D printed lotus-shaped frame, and the internal light-emitting system is made of a strip LED strip (16 cm, 10 LEDs) and an Arduino Nano. This solution allows the use of different color schemes to produce several different light modes, so that the light strip emits multiple colors of light at a certain frequency. The exterior of this colorful lotus lamp is a 3D printed lotus-shaped frame, and the internal light-emitting system is made of a strip LED strip (16 cm, 10 LEDs) and an Arduino Nano. This solution allows the use of different color schemes to produce several different light modes, so that the light strip emits multiple colors of light at a certain frequency.

Supplies

88465f99963e1802f7234cf0778ad1d.jpg
e04ea1e4625f27126b1bab94143b3e2.jpg

Sulfuric acid paper, 3D printing model, LED light strip, Arduino circuit board

Working Principle of WS2812B Full-color Bar LED

92e69a2355e97a23d89c4ca568e2391.jpg

An IC chip controls an LED lamp bead to form a loop, and the controller controls the lamp circuit on the FCPB circuit board through the IC chip to achieve different effects of the LEDs. Here, the effect of flashing water can be realized. Cutting and welding are convenient and free; each LED can form a loop, which can be cut and welded arbitrarily along the upper cutting line to meet the needs of different lengths.

Based on the intensities of the three separate red, green and blue LEDs, any color we want can be simulated.

The great thing about these LEDs is that even one pin on our Arduino board can be used to control the entire LED strip.

There are three connectors on each end of each LED, two for power supply and one for data. The arrows indicate the direction of data flow. The data output pad of the previous LED is connected to the data input pad of the next LED. We can cut the light bar to any size we want, or use some wires to separate the LEDs.

They work under 5V DC, and each red, green and blue LED consumes about 20mA, or the total current of each LED at full brightness is 60mA.

If the Arduino is powered by USB, the 5V pin can only handle about 400 mA, and when the barrel power connector is used for power supply, the 5V pin can handle about 900 mA. Therefore, if you use more LEDs and the amount of current they consume exceeds the above limit, you must use a separate 5V power supply. In this case, you also need to connect the two ground wires to each other. In addition, it is recommended to use a resistor of approximately 330 ohms between the Arduino and the LED strip data pins to reduce noise on the line, and a capacitor of approximately 100uF between 5V and ground to smooth the power supply.





Circuit Wiring

FM5TGF8JREU4099.jpg

The wiring scheme for connecting Arduino nano to the WS2812B addressable LED strip is very simple. This model requires soldering wires or pin headers, I use pin headers for testing, but for actual projects, you should consider soldering wires. The WS2812B addressable bar LED has 3 pads on each side. +5V (red wire in the scheme) is connected to +5V of Arduino; GND (black wire in the scheme) is connected to GND of Arduino; DIN (green wire in the scheme) is connected to Arduino PIN 5 (for data) through a 330 ohm resistor .

Code Setup

I use Arduino IDE with FAST LED library

First, we need to include the FastLED library, define the pins to which the LED strip data is connected, define the number of LEDs, and define the array of CRGB types. This type includes LEDs, with three single-byte data members for each of the three red, green, and blue color channels.

In the setting part, we only need to initialize FastLED with the parameters defined above. Now is the main loop, we can control the LED as we want. Using the CRGB function, we can set any LED to any color using the three parameters of red, green and blue. In order to change the LED, we need to call the function FastLED.show().

The FastLED library has many other functions that can be used to make very interesting animations and light shows, so making your next LED project shine depends entirely on your imagination.

My code includes several different LED modes, otherwise the standard RGB LED strip would not be possible. The mode can be modified or called as a single subroutine in the void loop() section.

My code runs through the variants of each pattern and provides you with a starting point for modifying the code to meet your needs.

Code in my GitHub:

Flower-shaped Shell

e04ea1e4625f27126b1bab94143b3e2.jpg
7d02f9c8f608c22774e2c017a13f222.jpg

Step 4: Flower-shaped shell

Our shell is 3D printed flower-like shell made of white resin. The size of my model is shown in the picture below.

My model file is in the following file: flower lamp—chai.zip

Assemble Parts

88465f99963e1802f7234cf0778ad1d.jpg