Quick & Easy RGB-LED Tester

9,038

34

25

About: I am an electronic artist living in Brooklyn, NY. I work with LEDs, microcontrollers, and analog electronics to create objects that I find beautiful.


Have you ever built a project with a lot of LEDs, and found out that one of the LEDs was defective? Although it's somewhat rare, there are some defective LEDs when you go through hundreds of them. I found that RGB-LED have high defect rate, most likely due to the fact that each of them has three LEDs (R,G,B) in them.

I have had a few situations where one of the RGB LEDs was not working fully, and having to desolder to remove it. Here because RGB LEDs have four leads instead of two, desoldering is difficult.

So here's the quick & easy RGB-LED test that I build on a breadboard. You can build this in less than 15 minutes and save a big hassle later!


Step 1: Putting It Together

Here's the part list:

1x Breadboard (small one is fine)
1x PIC16F627, 628A or 648A
1x 0.1 uF capacitor
1x 20 k ohm resistor
3x 220 ohm resistors
3x 470 ohm resistors
3x 120 ohm resistors
some jumper wires
1x 5V regulated power supply or 4x NiMH batteries in a holder

You'll also need a programmer capable of programming PIC microcontrollers, such as MPLAB ICD or PICKit.

As you can see, the circuit & construction is very simple. Once you have the parts, just put them on a breadboard in 5 minutes! Use the picture as the reference.

Then fire up your programmer and you are ready to go.

This unit is made to test common cathode type RGB LEDs, however, it's very easy to change the firmware to test common anode types. (No hardware change needed.) (See the update below)

Schematic and source code (assembly) are provided for those who are interested, but no need to look if you just want to get going with your LED testing...

Update: Source code has been updated to be able to switch between common Cathode and common Anode type LEDs. Change the following line in the source:

COM_ANODE    equ    0

to:

COM_ANODE    equ    1

to make it common Anode tester.



Step 2: Put It to Work!

That's it! Connect some RGB LEDs - they will go through all 7 combination of colors.

See it in action.



Share

    Recommendations

    • Make it Glow Contest 2018

      Make it Glow Contest 2018
    • Big and Small Contest

      Big and Small Contest
    • First Time Author

      First Time Author

    25 Discussions

    0
    None
    ruguberto

    4 years ago

    Hello i will be glad if i can have your code i drive a PIC 16 F 886 that only has one module but i am really courious how you change the colors thanks in advice

    0
    None
    ledartisthoney buster

    Reply 6 years ago on Introduction

    I'm sure you can. THe change to the code should be very minor - like changing the header file, and possibly changing the pin assignments.

    0
    None
    ledartistblinkyblinky

    Reply 7 years ago on Step 2


    The PIC has a PWM module, so you can use it. But to fade many LEDs can be hard, and that lead me to develop Aurora 9x18...

    Aki

    0
    None
    iwoodinspire

    7 years ago on Introduction

    Thanks! Your instructable just helped me to understand a great deal about how to write a simple program and actually programming a PIC. I had to look up and research the datasheets and other guides to learn how to program. I had to learn about the MCLR function. I had to learn to navigate the PIC software I was using and the process involved there.

    This simple project inspired me to learn way more than you would have guessed. I hope I learn enough to be half as good as your skill level. Thanks again. If I wore a hat I'd tip it to you. You'll be seeing my LED projects with a little more flair from now on.

    DSC08862.JPG
    1 reply
    0
    None
    ledartistiwoodinspire

    Reply 7 years ago on Introduction

    Great! I'm glad that it worked. Thank you for showing me the result.

    Working with actual projects is the best way to learn. Looking forward to seeing your future instructables.

    Aki

    0
    None
    iwoodinspire

    7 years ago on Introduction

    Okay, the LEDs were my problem. I just got them from radioshack, and they did not say, but a comment for them says that they are common anode, not common cathode. I wouldn't be able to ask you how to change the firmware to common anode, could I? That would be awesome, because I admit very little knowledge of software writing.

    4 replies
    0
    None
    ledartistiwoodinspire

    Reply 7 years ago on Introduction

    The change is pretty straightforward. Just reverse the polarity of the LED pins.
    I will change the code and upload it here when I have the time...

    Aki

    0
    None
    iwoodinspireledartist

    Reply 7 years ago on Introduction

    Awesome. You are a gentleman and a scholar. I look forward to see the code changes so I know how it's done. btw, I'm reading an output off the pic16 of about .5 V on each pin the LED would plug into. Hopefully this is what it is supposed to be :)

    Sorry to pester you. As I have mentioned before, this is a big hurdle for me to jump, so I appreciate your time very much. Thanks.

    Dustin

    0
    None
    ledartistiwoodinspire

    Reply 7 years ago on Introduction

    I suspect that the device configurations are not correct. The new source has the config bits in, so should fix the problem.

    Aki

    0
    None
    ledartistiwoodinspire

    Reply 7 years ago on Introduction

    Ok. I uploaded the revised source file. Download and edit the source.
    Change the following line in the source:

        COM_ANODE equ 0
    to:
        COM_ANODE equ 1

    Then make/rebuild and program the PIC.

    Aki

    0
    None
    ledartist

    7 years ago on Introduction

    Check the 20k ohm resistor. It goes between +5V and MCLR (5) pin. My photo is not too clear that the resistor is going a bit diagonal.

    Otherwise, you might want to color code the wires a bit. It's way too easy to make mistakes, and too hard for others to check the connections.

    Aki

    0
    None
    iwoodinspire

    7 years ago on Introduction

    Hey bud I just built this circuit, but have never programmed before. I have a PICkit 2, and imported your hex file into MPLAB software. It appears it took, the hex file shows and everything. BUT, nothing happens otherwise. I have 5 volts at pin 14. I am using a PIC16F628a. Would that mean some small changes for the asm file and hex file?

    If I get this working it will be a huge hurdle for me in my attempts to learn to program

    0
    None
    iwoodinspire

    7 years ago on Introduction

    I may be asking a common knowledge question, but what's the .1 uF capacitor for?

    The RGBs I have say typical forward voltage is 3.2 for the green and blue and only 2 V for the red. Does it just depend?

    I have a 12V power supply handy, so obviously I will have to change the resistor values and it made me worry what the cap is for and if the PIC chip has a voltage drop I need to worry about.

    2 replies
    0
    None
    ledartistiwoodinspire

    Reply 7 years ago on Introduction

    0.1uF capacitor is for decoupling for the microcontroller. Most digital ICs need decoupling capacitor to stabilize the oparation.

    The voltages are correct as you say - I designed this circuit using LEDs with 3.2V for blue/green, and 2V for red. I adjusted the resistors to make R,G, and B to have visually the same brightness. (within the safe limit)

    The microcontroller can only take up to 5V of supply voltage. You will need to use regulator or something to reduce the voltage to 5V. (Over 5.5V can damage the microcontroller)



    0
    None
    iwoodinspireledartist

    Reply 7 years ago on Introduction

    great this is very helpful. I noticed the brightness of the three were very different on the datasheet so now I understand the differing resistor values. Thanks again!