In this project, we will demonstrate how to make a colorful, king-sized decorative piece from a coconut tree (5 feet) using a digital RGB LED strip.
The RGB LED strip is cut and arranged in the shape of a coconut tree. The ATMega328 microcontroller is used to control the LED strip, generating various blinking, fading and flashing LED effects. Much like a light show, over 15 different multicolored effects will play continuously.
The structure
To build the tree frame, we will use 1-inch diameter PVC pipes as well as L and T joints. These joints are used for the base of the tree. The sheets are made of medium thickness 1mm 2 copper wire.
We will also use a circuit box and a 12V@2A adapter. Also, to put everything together you need a hot glue gun and clear tape.
The steps
1. To prepare the base of the tree, which has four legs, use four L-joints and three T-joints. Two L-joints and one T-joint form one side of the support (then repeat). There are two sides (about 30-35cm high) as shown in the pictures above.
2. Rubber brackets must be attached to the four legs to ensure stable grip.
3. Join the two sides of the bracket using one of the T-joints in the center.
4. Add the main tube (150 cm) to the center T-joint.
5. Using a hot glue gun, carefully attach four of the 1mm 2 pieces of copper wire (about 30-35cm long) to the top of the main tube. Once secure, bend the wire to create a coconut leaf shape for the tree.
6 . Using clear tape, stick the RGB LED strip to the main tube and pieces of copper wire.
7. Attach a small circuit box to the tree base support and connect the LED to the circuit using the 3-pin connector (provided in the box).
8. Carefully connect a 12V@2A adapter to the circuit box. It powers the circuit and the LED strip.
After creating the tree-like structure, we will need to build the circuit.
Circuit Diagram
The circuit requires just a few components. It uses the ATMega328 microcontroller, LM7805 voltage regulator chip, a 16 MHz crystal, a 10K resistor, two 22pf capacitors and a micro button.
- Connect the 16 MHz crystal to input pins 8 and 9 of the ATMega328 external crystal.
- Connect the two 22pf capacitors with both pins to provide stability to the crystal oscillator.
- Connect the button between ATMega328 reset input pin 1 and ground, with the 10K pull-up resistor.
- Note: the LM7805 receives 12V input from the adapter. Its 5V output must be connected to the VCC pin (7) and AVcc pin (20) of the ATMega328.
- The digital RGB LED strip has three interface pins: VCC, DIN and GND. The strip operates at 12V, so the VCC pin receives 12V from the adapter. Make sure the GND pin is connected to circuit ground. The DIN pin (data input) must be connected to pin 4 of the ATMega328. It receives the data input signal from this pin.
Circuit operation
The operation of the circuit is simple. The ATMega328 microcontroller generates different multi-color lighting effects on the LED strip. This includes blinking, fading, and chasing effects from the bottom to top and top to bottom of the LED strip.
The microcontroller provides data input from pin 4 to the LED strip to generate different colors and effects, such as two-color flashing, multi-color flashing, double and multi-color fading, multi-color chasing from bottom to top, and vice versa, and so on. against.
There are about 15 multi-color LED effects that work continuously one after another.
The operation of the circuit works thanks to the software program. It is downloaded into the ATMega328's internal FLASH memory. The program handles the complete operation of the circuit.
The software
The software program is written in C/C++ language and edited and compiled using Arduino IDE software. It is downloaded to the ATMega328's internal FLASH memory using the Arduino UNO board and Arduino IDE.
This program uses the flashLED.h library to control the RGB LED strip. This library is specifically for WS2811 type RGB LED strips. By using this library it is possible to generate different colors from the LED strip and control different lighting effects.
YouTube video link: