Schematic and Build

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.

mood lamp sch


The circuit is very simple.The RGB LED is hooked up to the PWM outputs on PORTB1, PORTB2 and PORTB3 of the ATTiny2313. There is also a resistor between the LED's and the ATTiny to limit the current to 20mA. The RGB LED is placed on a breadboard and connected to the ATTiny2313 board.

RGB LED color mixer

You can buy the Attiny2313 board at