在这个小型项目中,我们将制作一棵涂有颜色的椰子树。
它具有两个3W RGB LED,它们会产生多色闪光效果。此外,一个微小的8针微控制器Attiny85产生醒目的彩色LED捕获效果。它是电池经营的,电池可充电,因此不需要通过电线进行电源连接。它可以放置在任何地方,并且可以将其带到任何地方(完全移动和便携式)。它也很容易构建和娱乐,包括电路制作,布线,焊接,制作,切割,水彩绘画,模型制作等。
First, we shall start with the circuit diagram, followed by circuit connections and working/operations, and finally, we will see how to prepare the complete model and outlook of a showpiece.
原理图,示意图
完整的电路仅使用四到五个组件,一个模块和一个电池单元。有两个3W RGB LED,两个330E电流限制电阻,一个微控制器Attiny85,一个SPDT开关开关和一个锂离子电池充电模块TP4056。
电路连接
RGB LED has 3 LEDs – Red, Green, and Blue. The anode terminals of all 3 LEDs are shorted and connected to +Ve output through a current limiting resistor. The cathode terminals are connected to pins 5, 6, and 7 of ATtiny85, as shown. Cross connections for R, G, and B LEDs are made in between 2 LEDs to generate two different colors at the same time from both RGB LEDs
电路is given power through a3.7[email protected]mah li-ion电池电池。TP4056模块用于通过任何USB充电器为电池充电。该单元在B+和B端子之间连接。它的外部 +和外部端子通过开关连接到电路的 + VE电源和GND。
An SPDT type ON-OFF switch is connected between out+ and circuit supply to on/off power to the circuit.
Circuit working and operation
The microcontroller ATtiny85 turns ON and OFF Red, Green, and Blue LEDs one by one in a different sequence and generates different colors like Yellow, Orange, Magenta, Cyan, etc. Please refer to the table given below.
As the table shows, when any pin is given logic 0, it turns ON any one LED (red, green, or blue) in both RGB LEDs and generates two different colors. When two pins are low — two LEDs are turned ON, and that will generate combined colors (Yellow, Magenta, Cyan). RGB LEDs generate two colors simultaneously because of cross connections in R, G, and B inputs.
All three red, green, and blue LEDs are turned ON and OFF randomly at different rates (at different delays) so that it can generate the eye-catching multicolor chasing effect.
将软件程序下载到Attiny85的内部闪光灯中,以打开/关闭所有三个红色,绿色和蓝色LED(以后讨论了编程部分)。
TP4056模块通过锂离子电池为电路提供了动力。当电池放电时,模块使用USB充电器为电池充电(可以使用任何手机充电器)。TP4056模块上有两个LED,红色和蓝色。红色LED表示电池充电,蓝色LED表示电池充满电。
Now let’s see how these circuits, battery cells, charging modules, etc. all, are housed inside the box and how the complete item is prepared.
As shown in the figure, the battery cell, circuit, and charging module are all packed inside a housing box of cardboard. The housing is painted using watercolor to look at a seashore. Three holes (openings) are provided — one for micro-USB connectors and two for two RGB LEDs. Two semi-transparent glue sticks are fixed precisely over the top of the LEDs so the LED light will fade through them. Plastic cut-outs like coconut tree leaves are fixed on the top of glue sticks using Fevicol glue to give them a coconut tree-like look. Then, you simply charge the Li-ion cell using any mobile USB charger through the TP4056 module, and when it is fully charged (indicated by the blue LED on the module), switch on the showpiece and enjoy a flashing colorful effect.
Software program
The program for the ATtiny85 microcontroller is written and compiled in Arduino IDE. The Arduino IDE supports the ATtiny85 microcontroller also. To see how to download the program into the internal flash memory of ATtiny85, please go through my tutorial article series onATtiny85.
这是使用Arduino IDE编译的Attiny85的程序。
.gist-data {高度:250px;//任何高度溢出:自动;
}
文章的YouTube链接
RGB LED decorative tree using ATtiny85 – YouTube
You may also like:
提交以下:Arduino,1Manbetx
与本文有关的问题?
Ask and discuss onedaboard.com和Electro-Tech-online.com论坛。
告诉我们你的想法!!
You must be登录发表评论。