Beautiful Rainbow Dome

Photo of vin-vout-io

Made by vin-vout-io / Art / Lights

About the project

A cool low cost rgb led

Project info

Difficulty: Easy

Platforms: Microchip

Estimated time: 1 hour

License: GNU General Public License, version 3 or later (GPL3+)

Items used in this project

Hardware components

ISP programmer/dev board which can act as ISP programmer *(eg: Arduino) ISP programmer/dev board which can act as ISP programmer *(eg: Arduino) x 1
lm7805 voltage regulator lm7805 voltage regulator x 1
4.7uf capacitor 4.7uf capacitor x 1
1uf capacitor 1uf capacitor x 1
0.1uf capacitor 0.1uf capacitor x 1
breadboard breadboard x 1
connecting wires connecting wires x 1
DC female power jack DC female power jack x 1
Microchip ATtiny85 Microchip ATtiny85 x 1
Piezoelectric Piezoelectric x 1
RGB LED RGB LED x 1
Through Hole Resistor, 1 Mohm Through Hole Resistor, 1 Mohm x 1
Resistor 220 ohm Resistor 220 ohm x 3

View all

Software apps and online services

Arduino IDE Arduino IDE

Story

Introduction

The RGB Dome is a mood lamp powered by the ATtiny85 microcontroller. This compact lamp features cool light effects by altering the power on each RGB channel (red, green, and blue) to create various color mixes. By using pulse width modulation (PWM), we can control the brightness of each color and produce the desired hue. While this sounds straightforward, the small size of the ATtiny85 introduces unique challenges and solutions.

The Challenge

The ATtiny85 has only two PWM-supported pins. When I initially uploaded the code, it worked, but the colors flickered constantly, which was unsatisfactory. The solution was to implement software PWM—a technique for generating PWM output signals without needing a dedicated PWM hardware module within the microcontroller.


Implementing Software PWM

After researching, I found that software PWM could be implemented on the ATtiny85, allowing for smooth color mixing and gradient changes. The result was beautiful, but I wanted to add more features, such as changing to a specific color upon receiving an input or functioning as an RGB mood lamp. A piezo sensor seemed like a handy addition to enable color changes by clapping.

Troubleshooting the Piezo Sensor

Initially, the piezo sensor didn't work as expected. The colors wouldn't change due to a small bug in the code. After debugging and making necessary adjustments, the sensor functioned correctly.

Programming the ATtiny85

I used an Arduino as an ISP programmer to upload the code to the ATtiny85. If you're unfamiliar with this process, check out this

video tutorial

for guidance. Once programmed, place the ATtiny85 back into the circuit, connect a 12-volt adapter, and enjoy your RGB Dome lamp. The connections are made as shown in the schematic. The diffuser I am using here is from an old bulb.

1 / 2

Power Supply Setup

A DC 12V adapter is connected to a female DC power jack. The input passes through a voltage regulator and some decoupling capacitors to ensure a stable operating voltage between 1.8V and 5.5V for the ATtiny85.

Conclusion

The RGB Dome mood lamp project showcases the versatility of the ATtiny85 microcontroller despite its limitations. By implementing software PWM and adding a piezo sensor for interactive color changes, you can create a small yet functional and visually pleasing mood lamp. Enjoy the vibrant colors and smooth gradients of your custom RGB Dome lamp!


Code

Code and Schematics

The schematic is at the comment section

Credits

Leave your feedback...