Organize and Share your Electronics the way you want. Sign-Up for a free account now. It takes only 30 seconds!

Fading RGB LED

Fading RGB LED

An RGB LED is a LED which has three LED is integrated in one packaging. These LED is have the colors red, green, and blue. Such a LED costs about 1 Euro. With these three colours you can mix to any colour.
When using 8-bit PWM a number of 256 * 256 * 256 combinations can be made, thus the LED can show 16.777 million colours, and 256 different brightnesses. When all the three LED’s are at full brightness the color will be white.When they are all off the color will be ‘black’ in the dark ;).

The RGB LED used here has four leads, one for each color an one for the common cathode(ground). The Red LED operates on a voltage of 2 V, Green needs 3.5 V, and the Blue LED needs also 3.5 V. Each LED draws 20mA current, so the maximum current consumption is 60mA.

The circuit is very simple.The RGB LED is hooked up to the PWM outputs on PORTB1, PORTB2 and PORTB3 of the ATMega8. There is also a resistor between theb LED and the ATM8 to limit the current to 20mA. There is also a link to the datasheet of the RGB LED that is used in this project

The code for the fading LED is written in assembler with the AVR Studio 4. In this example the LEDs will fade in and out one by one. The PWM timers of the ATMega8 are used to let the LED’s fade in and out. To use the PWM timers you first need to initialize the timers at the begin of the program code. The speed of the fading in and out can be changed with changing the clock speed of the ATM8.You can copy and paste the textfile into the AVR Studio 4

Visit Here for more.

 

More Articles to Read

1968 Princeton Reverb Repairs
1968 Princeton Reverb Repairs
Skill Sunday: Power Over Ethernet for Arduino
Skill Sunday: Power Over Ethernet for Arduino
More on Color TFT Displays ~ The Big Ones — 240 X 320
More on Color TFT Displays ~ The Big Ones — 240 X 320
Vertical Pole Climbing Robot
Vertical Pole Climbing Robot
ESP8266 Weather Station Projects
ESP8266 Weather Station Projects
Single tube Lethal Nixie clock
Single tube Lethal Nixie clock
How to make a simple 1 watt audio amplifier (LM386 based)
How to make a simple 1 watt audio amplifier (LM386 based)
Flashing Binaries to DRA7xx Factory Boards Using Device Firmware Upgrade
Flashing Binaries to DRA7xx Factory Boards Using Device Firmware Upgrade
Dot² isn’t your typical coffee table
Dot² isn’t your typical coffee table
Debugging ARM Cortex-M0+ HardFaults
Debugging ARM Cortex-M0+ HardFaults

Top




Shares