Advertisement
rgb led circuit

Layman’s RGB LED Module Circuit

rgb led layout

Layman’s RGB LED module is an ultra-simple project realized without any microcontrollers. An RGB LED can be driven with a cmos presettable up/down counter. This is accomplished by connecting the three source outputs (Q1 to Q3) from a CD4029 cmos chip and configuring the device as a presettable counter. The solution presented here is intended to drive red, green, and blue LEDs in a common anode configuration. Color pattern (and intensity balance) is then controlled with the help of an external clock signal generator circuitry.

The CD4029 IC

CD4029 IC consists of a four-stage binary or BCD-decade up/ down counter with provisions for lookahead carry in both counting modes. The inputs consist of a single CLOCK, CARRY-IN (CLOCK ENABLE), BINARY/DECADE, UP/DOWN, PRESET ENABLE, and four individual JAM signals. Q1, Q2, Q3, Q4 and a CARRY OUT signal are provided as outputs. Binary counting is accomplished when the BINARY/DECADE input is high; the counter counts in the decade mode when the BINARY/DECADE input is low. The counter counts up when the UP/DOWN input is high, and down when the UP/DOWN input is low.

cd4029

The RGB LED

With an RGB (Red-Green-Blue) LED, literally you will be able to produce any color. At first glance, a 5mm RGB LED looks just like the regular 5mm LEDs, however, inside the standard package, there are actually three LEDs; one red, one green and yes, one blue. By controlling the brightness of each of the individual LEDs you can mix pretty much any color you want. A common anode RGB LED is the most popular type, and it is nothing more complicated than three one colour LEDs (one red, one green, and one blue) housed in a single package. However, rather than having 6 leads (cathode and anode for each LEDs) it has only 4 leads; one cathode for each colour (RGB), and the common anode (CA). Usually, the common anode of the LED package is the second pin from the flat side of the LED package. It is also the longest of the four leads. This lead will be treated as the “common” pin of the RGB LED.

rgb led pins

The RGB LED Module

As said, the circuit is built around CD 4029 IC and a few other external components. The finished module can be powered from any “clean” 5-Volt dc supply source for driving the RGB LED connected at the output of the circuit. In addition, the module calls for a suitable clock pulse at its input which can be supplied from a suitable clock generator wired around discrete components, or from a microcontroller based circuitry. Needless to say, this inputted clock signal determines the color pattern and intensity balance of the RGB LED’s aesthetic visual output. Refer the following application circuit:

rgb led circuit

RGB LEDs have differing forward voltages (VF) for the red, green, and blue LEDs. When drived by a 20mA per LED current, the red LED element of the RGB LED used here has a forward voltage of about 2V. The green and blue LEDs have forward voltage levels of about 2.4V and 3.6V respectively. Note that the forward voltage drop for each LED within the RGB LED need to be well-equalized in order to match LED performance over the operating range. These ballast resistors are used in the prototype; RR = 150R , RG = 120R, RB = 68R.

The Clock (CLK) Signal

Since the CARRY-IN (CI/pin 5) and PRE-SET ENABLE (PE/pin1) inputs of IC1 (CD4029BE) are held at low level, the counter is advanced one count at the positive transition of clock signal fed through the clock input (CLK/pin 15). Advancement is inhibited when PRESET ENABLE input (pin1) is pulled to a high-level (here by Q4 output of IC1). Based on this, we can feed a suitable clock signal to the module (through J1) for driving the onboard RGB LED as per our requirement. For testing your finished circuit, just try out an external clock pulse generator centered around the single most useful integrated circuit in history, the 555 timer chip. Refer the following sample application circuit:

555 clock signal

Here, when wipers of P1 and P2 are bolted at their mid-travel (ie. 5K value), output from NE555 is about 0.952 Hertz (frequency) @ 67 % (duty cycle). However, adding a 1N4148 diode between pins 7 and 6 of NE555 ( its anode to pin 7 & cathode to pin 6), this will changes to near 1.429 Hertz @ 50 %.

Hooked to CD4029?

Recently we published an “Improved Impulse detector” circuit based on the same chip CD4029. At that time CD4029 was wired as an upward counting decade counter. But now the same CD4029 works as a binary counter whose outputs continuously count in a binary progression between 1 to 7. These outputs drive the 2N3904 transistors (T1, T2 and T3) which, in turn, control each of the three colours of the RGB LED. Now it’s your turn; refer the CD4029 datasheet, and carefully walk through both circuits to find out the typical configuraton tricks used by us!

7 Comments

Join the conversation!

Error! Please fill all fields.
  • V.Sambath kumar

    Hi Hareendran,

    You have guided me in the right channel and was really useful,
    Thank you very much for your feedback.

    Regards V.Sambath kumar.

  • V.Sambath kumar

    Hi Hareendran,
    Thanks for sharing your idea,i worked in a company where they were
    manufacturing OT lights (operation table lights ) the BIS spec for the
    product was prepared by me,leds used were helmet leds mostly 8 or 10mm
    3v separate RGB groups each group light is manually adjustable to any
    side, and each group light can be merged and focused over the other to get pure a pure white light, in your case i think mech adj can be reduced
    and if you can compensate the color mixing to produce white light by merging the RGB group by controlling the freq of each group,i dont know
    whether the intensity of led will be sufficient search on the net for ot spec if it works out you can make lot of money by supplying to hospitals.
    since mech adj is less the result will be better it is an idea which came
    into my mind i am sharing ,also pl see the attachment .For adj focus the
    light on the ot table top.

    Good luck.

    Cheers V. Sambath kumar

  • Martin

    Thank you for sharing this article about the RGB LED, and presenting a simple circuit for driving the RGB LED. This a very good starting point to many other applications involving to need to vary colours using LEDs such as parties, celebrations, Christmas light shows, backyard gatherings, etc..
    It would be interesting to figure out how to tie the colours to music and time different colours to the beat of the music and/or low/high frequencies – probably using an Arduino I guess? But that’s for another project article.
    Thanks.

    • T.K.Hareendran

      @Krokkenoster: Thanks…

      Your “nostalgic” comment reminds me about the good old days!

    • KROKKENOSTER

      You bring back memories of about fifty years ago when we built this kind of circuits using triacs and transistors driving mains lamps. Some guys wanted to be fancy and did try to get away with the one transformer and paid dearly for that saving as there got mains onto the speaker wires of their sound systems!!

    • T.K.Hareendran

      I am pleased to note your fascinating circuit suggestion on “music-to-light modulation”. Recently I designed such a circuit without microcontrollers (using low-pass and high-pass filter circuits at its front-end) to drive RGB LEDs. Since I think it needs some more tweaks, experiments re-started right now. Sure, I will publish the circuit here when finished,followed by an Arduino circuit (not tried yet). Thanks for your attention,interest, and valuable suggestions dear @Martin!

Looking for the latest from TI?