This project creates a mesmerizing effect, displaying a gradual transition of glowing RGB lights from one color to another. The microcontroller systematically cycles through randomly generated values for red, green, and blue shades of light, resulting in a delightful array of colors. The software implemented on the controller smoothly transitions between different shades, treating each color channel independently. Light intensity is regulated using pulse width modulation (PWM) for each color. To avoid flickering, a high frequency of around 60 Hz is utilized to adjust the light intensity.
One significant challenge faced in this project was addressing the uneven brightness of the LEDs used. This inconsistency led to one specific color overpowering the overall hue. It was observed that blue LEDs appeared to have the highest intensity, while green LEDs had the lowest intensity.
To address this issue, a workaround involved using a higher resistor value for blue and a lower resistor for green. Additionally, two green diodes were connected in series to enhance the intensity of the green color. Fine-tuning the resistor values might be necessary to achieve the best balance in color intensity. To create a diffused glow, the lenses of the ultra-bright LEDs were trimmed, and a ping pong ball was used as a basic diffuser. Despite its simplicity, this project is perfect for a rainy day and can be assembled within a couple of hours, producing an intriguing and luminous effect.
Multiple units of this project can be constructed, and they will emit various colors randomly. The source code and hex files for the PIC12F675 device are available for free download (#080419-11.zip) on the Elektor website. The code was developed using CCS C and is compatible with the PIC12F675, an 8-Bit CMOS Microcontroller created by MICROCHIP TECHNOLOGY, based on high-performance RISC architecture. This microcontroller is highly popular among hobbyists and engineers due to its affordability and compact size.
- 128 bytes of EEPROM data memory
- Programmable pull-up resistors
- 4 oscillator selections including a 4 MHz RC oscillator with programmable calibration and Power-On Reset.