1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Electronics Custom RGB LED

Discussion in 'Modding' started by m_ridd, 20 Sep 2005.

  1. m_ridd

    m_ridd What's a Dremel?

    Joined:
    12 Sep 2005
    Posts:
    3
    Likes Received:
    0
    I've been advised in another forum ( :eeek: ) to try and get hold of a 16F84 series PIC.

    I am completely new to PICs and programmers, so I would need a kit that would start me off. I'm looking to program a PIC to control RGB LEDs.

    I have been told a need to use Pulse Width Modulation so that I can fade each colour of the LED to produce any colour I want.

    Basically, I would like to use visual basic code to control the serial port to output a command somthing along the lines of "RGB[rrr],[ggg],[bbb]" (where [rrr], [ggg] and [bbb] are three digit values [from 0 - 255] for the colours red, green and blue) and the PIC decode it and powers the LEDs.

    I wanted to use a PIC so that I could detach the circuit from the computer and the LEDs would stay the same colour.

    Could anyone recommend me the things that I would need to produce a PIC/circuit capable of this.

    (I know there are things similar to this on the forum and Google, but they just fade through colours, I would like to be able to set the colour using a serial command)

    Thanks,
    Martin.
     
  2. shotgunefx

    shotgunefx What's a Dremel?

    Joined:
    4 Feb 2004
    Posts:
    449
    Likes Received:
    0
    The easy way I think would be to grab a Olimex PIC-P18 board. It's got the crystal, voltage regulator and MAX232 for serial communications all set up. You only have to wire Tx, Rx to the right pins.

    For a programmer, they have several at the above site, I'd probably go with the PIC-PG2C or the PIC-PG1 if you use the development board and want to do it in-circuit. You can find tons of plans to make your own programmer, but these are pretty cheap and you dont' have to worry if you're having problems if it's the circuit or the programmer.


    If you are more comfortable using C than assembler, then make sure you get a PIC that is supported in the free version of HiTech C.
     
  3. specialk

    specialk What's a Dremel?

    Joined:
    5 Feb 2002
    Posts:
    68
    Likes Received:
    1
  4. Starbuck3733T

    Starbuck3733T Look out sugar, here it comes

    Joined:
    16 Sep 2002
    Posts:
    920
    Likes Received:
    0
    http://www.dvarchive.org/RGBLED/ is pretty cool if you're good with super small surfacem mount stuff. (and I mean small like QSOP, makes a modchip install look like a walk in the park IMHO.)
     
  5. Buddabing

    Buddabing What's a Dremel?

    Joined:
    21 Sep 2005
    Posts:
    1
    Likes Received:
    0
    Hello,

    I've designed a board which will control up to 40 LEDs through the parallel port.

    The board is designed around the MAX6956 chip from Maxim.

    PM me if you would like more details.

    Regards,
    Buddabing
     
  6. m_ridd

    m_ridd What's a Dremel?

    Joined:
    12 Sep 2005
    Posts:
    3
    Likes Received:
    0
    I've came up with this using opto-isolators to protect the PC:

    [​IMG]
    (notes about this image: resistors need to be before the opto-isolator and the PC, i forgot to put a power source on the right-hand side)

    I just need to make Visual Basic output to the paralell port at 50hz. I've made a program already to create a steady(ish) 50hz(ish) output, I just need to get the opto-isolators to test it!!
     
  7. cpemma

    cpemma Ecky thump

    Joined:
    27 Nov 2001
    Posts:
    12,328
    Likes Received:
    55
    A cheaper and simpler way is a ULN2803A, 8 darlington switches, 500mA per channel and base resistors built-in... ;)
     
  8. roboBOT

    roboBOT What's a Dremel?

    Joined:
    29 Aug 2005
    Posts:
    23
    Likes Received:
    0
    That optoisolator thing won't work. Optoisolators don't produce current. They are actually an LED and a photodiode/phototransistor in a box. It works like a relay but uses less power.
     
  9. shotgunefx

    shotgunefx What's a Dremel?

    Joined:
    4 Feb 2004
    Posts:
    449
    Likes Received:
    0
    Actually optoisolators do produce current, just not much. The keyword here is Darlington. Using one transistor to switch another for lot's of current.


    cpemma, nice. Haven't seen these before. Have to pick some up.
     
  10. ChriX

    ChriX ^

    Joined:
    30 Aug 2001
    Posts:
    2,651
    Likes Received:
    4
    Can anyone recommend a source for some decent RGB LEDs in the UK? I have seen some really awful ones, and I'd rather get some that have been previously tested by others. :p The ones specialk used look quite good!
     
  11. specialk

    specialk What's a Dremel?

    Joined:
    5 Feb 2002
    Posts:
    68
    Likes Received:
    1
    I purchased mine on eBay from cwithk (http://stores.ebay.com/Chi-Wing-LED-product-shop); however, I would not recommend them because they are very low quality RGB LEDs. The LED dies are significantly off-center, so when this fact is coupled with the fact that they use water-clear lenses, the beam of each color faces a different direction. The reason they look good in the pictures is because all of the pictures are taken from the side (notice none of them are head-on). I would suggest using seperate LEDs that you can individually manipulate or diffused RGB LEDs, depending on your project.

    -special [k]
     
    Last edited: 13 Oct 2005
  12. cpemma

    cpemma Ecky thump

    Joined:
    27 Nov 2001
    Posts:
    12,328
    Likes Received:
    55
    Rapid sell 3 Kingbright 5mm RGBs, different brightnesses, that should be quality. I think the brighter ones are 4-wire (common-cathode) types which may cramp your style. One's on offer ATM (see home page), but it's the lowest mcd. :(
     
    Last edited: 13 Oct 2005
  13. specialk

    specialk What's a Dremel?

    Joined:
    5 Feb 2002
    Posts:
    68
    Likes Received:
    1
    :idea:
    I have 4-lead common cathode RGB LEDs and I haven't had a problem with them. The 6-lead RGB LED, which I assume are similar to the full spectrum LEDs here, are actually common cathode too, but because they use two blue dies (because blue LEDs are less efficient than green or red at producing the same amount of lumens), they have an anode for red, and anode for green, two anodes for blue (one for each die), and two cathodes.

    -special [k]
     
  14. cpemma

    cpemma Ecky thump

    Joined:
    27 Nov 2001
    Posts:
    12,328
    Likes Received:
    55
    By "cramp his style" I meant you can't use a switching transistor like the ULN2803 darlington array I'd suggested earlier. The RGB has to be on the ground side of the switch, and on that NPN chip all the emitters are already commoned.

    Discrete transistors rule. :D
     
  15. SteveyG

    SteveyG Electromodder

    Joined:
    23 Nov 2002
    Posts:
    3,049
    Likes Received:
    8
    Any of the waterclear LEDs with more than one die inside aren't going to mix very well unless you have an extra diffuser. I've tried the Kingbright ones from Rapid, lots of Chinese RGB LEDs, and the only ones that are worthwhile are the Nichia 4 lead RGB leds in a milky package. All the others shoot light off in various directions or contain cheap crap gallium nitride dies that stop working rapidly when PWM'd...
     
  16. Confused Fishcake

    Confused Fishcake Minimodder

    Joined:
    25 Sep 2005
    Posts:
    698
    Likes Received:
    1
    Starbuck, is he really going to have experiance soldering QSOP chips if he hasnt used pics much? Hate to be mean but it is kinda obvious. Anyways, dunno about the LEDs but try a picaxe (techsupplies.co.uk) I know I keep recomending them to everyone, but they are in-circuit programmable, and are £1.50 each for one of the best types, they will handle PWM no probs, You can buy a kit which will give you everything you need for about £8 including programming cables, maybe the picaxe 18 pin project board?

    Forgot to mention, they are PICs programemd with a bootstrap to allow easy in circuit programming in basic, I think one is the 16F84 with a bootstrap
     

Share This Page