Power Pic RGB with voltage control



Power Pic RGB with voltage control is a circuit that generates many colors using a RGB LED and those colors can be changed using two independent voltages, supplied by some external device, in order to select the color (Hue) and its intensity (Value)!

The idea originally came from Artur Grycuk who wanted to interface his Theremin Music Controller with RGB Leds. The controller has two output voltages, one for volume and another for pitch, ranging from 0 to 4 and 0 to 5 volts respectively.



Unlike the previous Power Pic RGB with infrared remote control and Power Pic RGB project, this one is designed to be a development version, without any PCB.

Here's the concept diagram:

The microcontroller in this circuit is similar to the one used in the other Pic RGB projects. The software is compiled only for a PIC 12F675 because this model includes an ADC but may be easily changed to another pic12F*, as long as it has an ADC and a free timer to generate the PWM. 



The schematic is also very similar to the others, except that it now contains two pins configured as analog inputs.

At the left side is the 5V power supply. The pic 12F675 microcontroller is in the middle and the LED driver at the right. This driver consists of three mosfets that will drive the LED. Click on the image to enlarge it.


As stated on all other Pic Rgb circuits, 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 LEDs (red, green and blue) currents we get a maximum of 900mA not counting the current consumed by the PIC, which should be some 3 or 4 mA. The 7805 in the power supply is able to supply 1A of current with a proper Heat sink.

The two analog input pins will receive a voltage from 0 to 5 volts. When driving the Hue pin from 0V to 5V the pic will select colors rotating counter-clockwise on the color spectrum.

Driving the Value pin from 0V to 5V will change the intensity of the color from pitch black to full intensity.



List of Components

Amount Part Description
1 D1 1N4001 Rectifier diode or similar
1 C1 2200uF/25V capacitor
2 C3,C5 100nF capacitor
1 IC2 7805 regulator
1 IC1 PIC 12F675
3 Q1,Q2,Q3 BS170 mosfet
2 VIN0, VIN1 Molex 2 pin male 90 degrees PCB connector
2 VIN0 cap,
VIN1 cap

Molex 2 pin female cap

1 R1, R2 22 Ohm 1/4W resistor
2 R3 5.6 Ohm /1W resistor
1 J1 Molex 4 pin male 90 degrees PCB connector
1 J1 cap Molex 4 pin female
1 J2 Power connector for PCB
4 - wires to connect the molex to the LED
1 LED Prolight 3W RGB LED with common anode
1 - Heat sink for the LED or some aluminum piece large enough to remove the heat
1 - TO-220 Heat sink for the 7805 regulator
1 - AC/DC power supply capable of delivering 1A
("wall wart" or similar)
2 - M3 bolts, nuts and some washers
1 R4 4K7



I didn't produce any PCB because this is a development project and was tested in a white circuit board.

If you wish to create a PCB and don't know which software to use, I recommend Eagle from CadSoft, because it is very easy to learn and there are lots of information and component templates available online.



The software is written in C and consists of a triple PWM modulator, a 0..5V two channel ADC and a HSV to RGB converter.

The color is selected by applying a voltage from 0V to 5V on the Hue pin. Applying 0V should produce red, 1.7V should produce green and 3.4V should produce blue. Colors are obtained rotating counter-clockwise in the top circle of the image.

The Value pin controls the intensity of the light. For maximum brightness it should always be at 5V. Inferior voltages will produce less light.

The PWM modulator is designed as device driver and is fully interrupt driven. This way the main loop of the program is dedicated to do the remaining task of sampling the two analog inputs.


The firmware for pic12F675 is available for download below.


Final considerations

The LED and the 7805 regulator both require heat sinks otherwise degradation will be accelerated and their lives reduced.

These images were captured from a Power Pic RGB with infrared remote control circuit. This project produces the same colors, except that they are selected with a voltage signal and not an infrared remote controller.


Inside the globe



Files available for download:

The firmware includes source code.


  1. Pic RGB
  2. Power Pic RGB
  3. Power Pic RGB with infrared remote control
  4. HSL and HSV definitions by Wikipedia
  5. Adventures in HSV Space, July 2001, Darrin Cardani (local copy)


Published on Tuesday 2010/07/27, last modified on Sunday 2013/04/28