PIC RGB Power Board



Power Pic RGB is a circuit that generates random RGB colors using a powerful 3W RGB LED and fades between them.

The initial project goal was to develop the fading algorithm which was successfully achieved. This time the idea was to drive a Prolight 3 Watt RGB LED and place it inside a nice white globe! On the right is a picture of the first prototype board eith a small board attached that doesn't belong to this project.


Design and Implementation

The circuit is basically the same with the addition of 3 BS170 mosfet transistors to drive the LED and a powerful 5V regulator. The PIC is the same but the code has a small big difference, explained below!


From left to right we can see the power supply based on a 7805 5V 1A regulator, the microcontroller and finally on the right the three mosfets that will drive the LED. Click the image to enlarge.


Each mosfet can drive a maximum 600mA through its drain but according to Prolight each LED (red, green and blue) can only sustain 300mA which makes this mosfet perfect for the job.

Summing the 3 LED currents we get 900mA not counting the current consumed by the PIC and the 7805 itself which should be around 3 or 4 mA. The 7805 is able to supply 1A of current with a proper Heatsink.

List of Components

Amount Part Description
1 D1 1N4001 Rectifier diode or similar
1 C1 2200uF/25V capacitor
3 C3, C4, C5 100nF capacitor
2 R4, R5 4k7 resistor
1 LED1 LED 3mm
1 IC2 7805 regulator
1 IC1 PIC 12F629
1 S1 Push button N/O similar to omron 10-xx switches
3 Q1, Q2, Q3 BS170 mosfet
2 R1, R2 22 Ohm/1/4W resistor
1 R3 5.6 Ohm /1W resistor
1 J1 Molex 4 pin male 90 degrees PCB connector
1   Molex 4 pin female
4   wires to connect the molex to the LED
1   Prolight 3W RGB LED with common anode
1   Heatsink for the LED or some aluminium piece large enough to remove the heat
1   TO-220 Heatsink for the 7805 regulator



The PCB and Schematic were created using Eagle from Cadsoft. Click the images to see bigger versions.

The 4 pin molex connector is the output to the LED. The pin order is as follows:

The resistors have been calculated acording to the datasheet of the LED. They make the 3 internal RGB LEDs emit the same amount of luminous flux. Ideally R3 should be 5 Ohm but 5.6 is also ok. C1 voltage should be above the input voltage of the circuit. The input diode can be any rectifier capable of driving 1A of current and the 7805 really requires a heatsink.



The software is written in C and consists on a random number generator, an intensity fading function and a triple PWM modulator. All three color components have 256 levels of intensity.

This board runs with the same software of PicRGB but with its output pins inverted because of the mosfets. It includes the random mode and the new sequence mode that can be activated by pressing the push-button S1. The sequence is Green, Green/Blue, Blue, Blue/Red, Red, Red/Green and starts overs.



Finally some pictures! On the left, running inside a round globe and on the right on a newer fixture I found at a local supermarket. The globe is running flawlessly since December 2007.


Newer light fixture






  1. PIC RGB
  2. TinyRGB 
  3. PIC12f675/12F629 datasheet from Microchip  
  4. BS170 datasheet
  5. 7805 datasheet

Published on Sunday 2009/02/08, last modified on Sunday 2013/04/28