Introduction: Build a Better RGB LED Controller.
This RGB LED controller kit is somewhat different to other offerings on the 'net. Whereas most others use a single button to step through short pre-programmed loops this controller is intelligent enough to understand different colour palletes and generate colours in real time using a huge 8 million bit randomiser. It lets you choose a colour pallete from sharp vivid colours to soft pastels and the speed and way it will move between them. It also has a selection of other effects thrown in just for good measure, and remembers it's current settings when the power is turned off.
The fact that this kit does the equivalent of thousands of dollars worth of architectural lighting equipment means it's widely used in theme parks, cruise ships, trucks, architectural installations, techno-art and many other applications. It's also perfect for mood lighting in your workshop, games room, garden and home.
The unit is shown here with a selection of RGB panels connected to it for demonstration purposes. Almost any common anode (common positive) array can be used with suitable resistors. In the picture you can see a strip of Dioder LED lighting from IKEA http://www.ikea.com/, a round MR16 sized panel as featured at http://www.bigclive.com/happy.htm and a large floodlight panel as featured at http://www.bigclive.com/flud.htm.
The finished module will run an any voltage between about 8V to 30V and is capable of switching up to about 5A (5000mA) per colour without need for heatsinks on the MOSFETs.
This kit has been around for many years and the software has been steadily refined. I do a complete kit of parts including the PCB on my website at:-
This kit is also a great base module for writing your own code for any application that requires a couple of button inputs and three high current outputs.
The module uses the following colour palletes:-
Full spectrum - over 16 million colours ranging from black through all colors to white.
Bright - a large array of bright colours ranging from saturated primaries to intense pastels.
Vibrant - (my favourite) super saturated colours from deep purples to brilliant turquoises.
Primary - a small selection of hard primary colours.
Here are the programs included in the controller kit. You use the program button to step through them, and the option button to change speed/colour etc.
1. Morph and hold with vibrant colours.
2. Morph and hold with bright colours.
3. Morph and hold with full spectrum colours.
4. Red marker to show where you are in the program list.
5. Sweep continually between vibrant colours.
6. Sweep continually between bright colours.
7. Sweep continually between full spectrum colours.
8. Green marker.
9. Indie dim full spectrum.
10. Indie dim pastels.
11. Blue marker.
12. Rainbow that can be stopped and started with the option button.
13. Rainbow with variable speed.
14. Black marker
Programs below here can be "locked out" if required to avoid flashy effects in an architectural application.
To lock or unlock them, just hold both buttons in for 15 seconds until the output changes from blue to either red (locked out) or green (unlocked). You can do this as many times as you like.
15. Colour burst with vibrant colours.
16. Colour burst with bright colours.
17. Colour burst with full spectrum colours.
18. Cyan marker.
19. Color plasma lightning. (variable speed)
20. White plasma lightning. (variable speed)
21. Colour strobe with variable speed (vibrant colours).
22. Windswept flames. Each channel wavers like a flame with variable speed.
23. Subtle flames. Much softer waver effect.
24. Rainbow trail. (variable speed).
25. Jewel fountain. (variable speed).
26. X-fader. The classic two channel cross fader with variable speed.
27. Peppers Ghost with variable delay.
28. Juddermeister. Just completely psychedelic! Variable speed.
29. Hazard. For controlling two channels of LED hazard warning lights. Variable reps and styles.
30. Random static full colour. A new one is picked at random when you press the option button.
31. Random full spectrum colour. Option button selects a new random one.
32. White marker.
Morph and hold programs sweep to a random colour, then hold it for an adjustable delay selected by the option button in 3 second increments.
Sweep programs continually fade between random colours.
In indie dim modes each channel does its own thing, fading between random intensities.
Colour burst steps between random colours with variable speed.
Peppers ghost is an optical illusion where two images alternate via their reflection on a piece of glass. Look it up on the 'net. This is ideal for Halloween FX. The option button can be used to increase the hold time between fades in multiples of 3 seconds.
Rainbow trail and Jewel fountain whizz through hundreds of colours a second to leave a trail of colours on any moving object. If you get the angle right this looks amazing with fountains, since the water droplets sparkle with different colours. Also looks great on any high speed moving object. Experiment!
The hazard mode could be used to control banks of yellow LEDs for use as highway hazard lights or red and blue for police/fire applications.
Step 1: Starting Construction.
When I design PCBs I always try to make them single sided with big chunky pads and tracks. This makes them much easier to build, modify and repair. The downside to this is that sometimes links are needed, but with a bit of care you can minimise the number required.
The two links on this board carry the full current of the red and green channels, so they should be fairly thick links. You can use a bit of solid wire or component lead off-cuts. I like to use off-cut leads from diodes because they are nice and thick.
I strongly recommend the use of traditional lead-tin based solder for my projects. The modern lead-free stuff is nowhere near as easy to use or as good as the lead based stuff. Lead has effectively been banned from mass produced consumer products for safety reasons but it's still perfectly acceptable to use it for DIY stuff like this.
Step 2: The Diode.
Now comes the diode. This is a polarity sensitive device that limits the direction electricity can flow. It's function in this kit is to protect the circuitry from damage if power is applied to the unit with the wrong polarity.
The diode has a band round one end and should be inserted into the PCB so that it matches the graphic.
The module can use just about any diode in the 1N400X range.
Step 3: Adding the Resistors.
There are four resistors to install and to keep things simple they are all the same value - 1000 ohms.
They are not polarity sensitive, so can be inserted any way round. Perfectionists might like to make the colour bands all read in the same direction.
The group of three resistors in parallel are for the MOSFET control, while the one that sits at the bottom of the PCB on its own is to limit current through the power indicator LED to a few mA.
The colour code on each resistor reads as follows. Brown (1), Black (0), Red (2), Gold (5%). The resistor value is worked out as 1, 0 and a multiplier of 2 which means two more zeros. Therefore it is 1000 ohms. The gold band indicates that the measured value has a tolerance of plus or minus 5%.
Step 4: Adding the Decoupling Capacitors.
The decoupling capacitors are 100nF ceramic capacitors. Their function is to help suppress any spikes or transients that might find their way onto the power supply. There is one on either side of the voltage regulator.
These capacitors are not polarity sensitive, so they can be put in any way round.
Step 5: The Power Indicator LED.
The power indicator LED will only light if it is installed the correct way round, so note that the PCB position has a "+" symbol to indicate the long lead (the anode). LEDs generally have a longer positive lead and a small flat surface on the negative side of the resin package. If you look through the LED you will see that one of the electrodes is anvil shaped inside and holds the chip, while the other electrode is quite thin and just goes up the side of the anvil. Generally speaking the anvil is on the negative lead (but not always).
The power indicator LED is a simple but very useful addition to any control module. It makes troubleshooting so much easier if you can see that your unit is powered up and the 5V supply is healthy.
Step 6: Adding the Voltage Regulator.
The voltage regulator is an incredibly neat little component that takes any voltage between about 8 and 32V in at one side and regulates it down to 5V at the other side. It must be installed the correct way round, and as such the PCB graphic shows the outline of the plastic case.
Step 7: Adding the Electrolytic Capacitor.
The purpose of the electrolytic capacitor is to smooth out any ripple or glitches on the power supply. The circuitry derives it's own 5V supply from the main power supply and it's useful to have a small reservoir to ride out any dips or glitches that may be caused by the switching of large loads.
This component is polarity sensitive and MUST be installed the correct way round to avoid damaging it. The PCB graphic has one side marked with a "+" symbol and the side of the capacitor with the longest lead goes to that side. The negative side of the capacitor is usually marked with a stripe with a "-" symbol on it.
Refer to the picture if in doubt.
Step 8: Installing the Control Buttons.
There are two control buttons that are used to step through the different programs and change option settings like speed or colour.
The leads have little kinks in them which makes them a snug fit in the PCB to hold them in place while you solder them.
Step 9: Installing the Terminal Block.
This is one of the most expensive components on the PCB. It is a rugged industrial rated connection block for attaching wires easily to the module. This particular one has what are called rising clamp terminals which makes them very easy to put wires into.
It solders into the PCB with the wire ports facing out to allow easy insertion of wires.
Step 10: Preparing the MOSFET Leads.
The MOSFET pads and tracks on the PCB are chunky to allow them to handle the high current controlled by the MOSFETs. To allow for this the MOSFET leads are bent to be a bit wider. I recommend gripping them with a pair of long nosed pliers, and carefully bending the leads as shown in the picture.
Step 11: Installing the Power MOSFETs.
The MOSFETs are soldered in with their metal tabs facing the side of the PCB with the diode as shown. It helps to solder the middle lead of each, then carefully line them all up before soldering the other leads.
Step 12: Fitting the Processor.
The PIC is the chip that basically does all the work. It will normally be supplied pre-plugged into a good quality turned pin socket to protect it from damage during shipping. You can either solder the whole chip and socket assembly in as supplied, or unplug the chip, solder in the socket and then plug the chip back into it again.
The chip is polarity sensitive and the indent at one end must go in the direction shown on the PCB. The socket also has a matching indent.
This chip is what makes the whole module work. It's a PIC microcontroller programmed to full capacity with lean and efficient machine code (assembler). Using machine code was the only way that it was possible to give 16 million colour resolution while keeping the PWM (Pulse Width Modulation) fast enough to prevent flicker. It was also the only way to give the chip the intelligence to understand colour and be able to generate random colours in different palletes in real time.
It took me a long time to perfect the software to it's current level. All the colour generation and morphing algorithms are quite seriously interwoven to make them as lean and fast as possible and still leave room for some more frivolous and fun effects.
Step 13: The Mounting Hardware.
I like to make my kits as complete as possible, so this one even comes with four mounting pillars and screws to let you attach it to a panel or mount it into an enclosure. Even if you intend to leave it out on your bench I'd recommend at least clipping the plastic spacers into the PCB as shown. This will help keep the bottom of the PCB clear of any conductive bits lying on your workbench.
Step 14: Wiring Up LEDs to the Controller.
In most instances you will use a 12V supply for your LED arrays and wire the LEDs in series groups of three with a suitable resistor in series. If you use existing LED strips designed for 12V or the modules I sell on my website at http://www.bigclive.com then they will either already have the LEDs and resistors built in, or will have suitable circuitry present to accommodate the LEDs and resistors.
The power supply is connected with it's positive and negative going to the "+" and "-" connections as shown. The two "+" connections are already commoned on the PCB, and the top one is the common for your LEDs. It;s best to use a regulated supply to help ensure that the LEDs don't get over-driven. A cheap and readily available plug-in regulated 12V power supply is ideal.
If you're hard wiring LEDs or making your own RGB panels then they are connected as shown in the image. The resistors are chosen to suit the forward voltage of the LEDs, but in most cases an average value can be used. Typically this would be:-
150 ohms for green or blue LEDs.
270 ohms for red LEDs.
For premade panels you just connect the common positive to the top positive connection and the switched RGB connections to R,G & B respectively.
Step 15: Adding More LEDs.
To connect more LEDs or panels you just parallel them up as shown in the image.