Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

RGB LED decorative, tabletop coconut tree

By Ashutosh Bhatt April 11, 2023

In this mini-DIY project, we will make a color-flashing coconut tree.

Fig. 1: The image shows the RGB LED coconut tree flashing light

It has two 3W RGB LEDs using, which generate multicolor flashing effects. Also, a tiny 8-pin microcontroller ATtiny85 generates eye-catching colorful LED-chasing effects. It is battery-operated, and the battery is rechargeable so it does not require a power connection through wires. It can be placed anywhere and can be taken anywhere (fully mobile and portable). It is also easy to build and fun, including circuit making, wiring, soldering, crafting, cutting, watercolor painting, model making, etc.

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.

Schematic diagram

Fig. 2: Complete circuit schematics of the project with ATtiny85

The complete circuit uses only four to five components, one module, and a battery cell. There are two 3W RGB LEDs, two 330E current limiting resistors, a microcontroller ATtiny85, an SPDT ON-OFF switch, and an LI-Ion battery charging module TP4056.

Circuit connections
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

The circuit is given power through a 3.7 V@2000 mAh Li-Ion battery cell. TP4056 module is used to charge the cell through any USB charger. The cell is connected between B+ and B- terminals. Its out+ and out- terminals are connected to the +ve supply and gnd of the circuit through the switch.

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.

The software program is downloaded into the internal FLASH of ATtiny85 to turn ON/OFF all three red, green, and blue LEDs (the programming part is discussed afterward).

TP4056 module provides power to the circuit through a Li-Ion cell. When the cell discharges, the module charges the cell using a USB charger (any mobile phone charger can be used). There are two LEDs, red and blue, on the TP4056 module. Red LED indicates the charging of the cell, and a blue LED indicates the cell is fully charged.

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.

Fig.3: Complete prototype of RGB coconut flashing Module

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 on ATtiny85.

Here is the program for ATtiny85 compiled using Arduino IDE.

.gist-data{ height:250px; // Any height overflow: auto;
}

Youtube link for the article

RGB LED decorative tree using ATtiny85 – YouTube

You may also like:


  • ATtiny85 microcontroller tutorials, Part 5: LED intensity control using ATtiny85

  • ATtiny85 microcontroller tutorials, Part 6: LED intensity control using potentiometer…

  • Tutorial 7: DC motor speed control using ATtiny85
  • ATtiny85
    Tutorial 8: RGB LED interfacing with ATtiny85

  • Tutorial 9: Device control using smart phone’s Bluetooth and ATtiny85

  • ATtiny85 microcontroller tutorials, Part 4: LED chaser using ATtiny85

Filed Under: Arduino Projects, Electronic Projects

 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: 5G Technology
This Tech Toolbox covers the basics of 5G technology plus a story about how engineers designed and built a prototype DSL router mostly from old cellphone parts. Download this first 5G/wired/wireless communications Tech Toolbox to learn more!

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • Thermal modelling of repetitive power pulse
  • Redundant XORs
  • No Output Voltage from Voltage Doubler Circuit in Ansys Nexxim (Harmonic Balance Simulation)
  • Discrete IrDA receiver circuit
  • ISL8117 buck converter blowing up

RSS Electro-Tech-Online.com Discussions

  • using a RTC in SF basic
  • Can I make two inputs from one??
  • Help with finding unique wire lug(s)
  • Simple LED Analog Clock Idea
  • Kawai KDP 80 Electronic Piano Dead

Featured – LoRa/LoRaWan Series

  • What is the LoRaWAN network and how does it work?
  • Understanding LoRa architecture: nodes, gateways, and servers
  • Revolutionizing RF: LoRa applications and advantages
  • How to build a LoRa gateway using Raspberry Pi
  • How LoRa enables long-range communication
  • How communication works between two LoRa end-node devices

Recent Articles

  • RPi Python Programming 21: The SIM900A AT commands
  • RPi Python Programming 22: Calls & SMS using a SIM900A GSM-GPRS modem
  • RPi Python Programming 23: Interfacing a NEO-6MV2 GPS module with Raspberry Pi
  • RPi Python Programming 24: I2C explained
  • RPi Python Programming 25 – Synchronous serial communication in Raspberry Pi using I2C protocol

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe