RGB led circuit, reading values in series and remembering status

Discussion in 'The Projects Forum' started by akaSkyWolf, May 20, 2016.

  1. akaSkyWolf

    Thread Starter New Member

    May 20, 2016
    4
    0
    Hi everybody,
    i'm very new to the electronics world coming from a programming background, so forgive me if my vocabulary isn't on point and if i do not explain well what i want to do.

    So (and i'll provide an image to clarify myself) my project is to build an Arduino driven circuit where i can control multiple RGB leds individually,
    my concept is to throw data out in series, specifying to which led it has to go, and i think (emphasis on the "think") that i got this part sorted, i would do something like:
    • RRR, GGG, BBB on 3 different PWM pins
    • and HIGH on a pin exclusive to one led
    the HIGH pin would then "close some switches" and let the RRR, GGG and BBB value through.
    My understanding is that to "electronically close switches" you can use NPNs, having:
    • the aforementioned HIGH pin on the base
    • one of the values (for instance RRR), acting like a "battery" and one of the RGB led pins (for instance R) between the collector and the emitter
    is this correct?

    But then i was thinking: "what if i want to have 2 leds on at the same time?", and this is for me a "walk in the dark". Is there some kind of "memory" which can "remember" the PWM clock so that the LED can stay on without the Arduino constantly feeding the values?
    I know this is a vague question, but i've been researching a lot and i'm not seeing the light at the end of the tunnel (which is funny, given that we're talking about leds), can anybody help me find the right way?

    Thanks in advance.


    Bare sketch of what i want to do to hopefully clarify:
    elecdoubt.png
     
  2. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,771
    971
    There are THOUSANDS of tutorials/videos,etc.. on lighting RGB leds with an Arduino..
    I'm failing to see what makes your project any different.. Just google "Arduino RGB led serial" and go from there..

    Most basic here..
    https://www.arduino.cc/en/Tutorial/ReadASCIIString

    Sounds like you just need to parse the serial string and then control each output pin based on that information.. simple..
     
  3. Picbuster

    Member

    Dec 2, 2013
    376
    50
    Use a cheap PIC's with 3 pwm modules ( or build them) and create RS485 multidrop 1/2 duplex async ports.
    Each set of leds will need that chip and all connected, via rs485, to your main processor.
    Give each PIC an address and build a network. This is a simple job (as you have programmers experience.)
    A control message could be stx [address] [R] [G] [checksum] eot used @ 115000 b/s
    R/G/B each 0-255 (one byte) checksum use polynom.
    Now you are able to make them work independent from each other.
     
  4. akaSkyWolf

    Thread Starter New Member

    May 20, 2016
    4
    0
    Maybe i'm failing to understand what you mean, but the problem here is not lighting A led, but controlling a series of leds individually using only 3 digital PWM outputs. That i haven't found around

    Thanks for the reply, i will study and explore this option for sure.
     
  5. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,771
    971
    So multiplexing.. How many do you want to control?
     
  6. akaSkyWolf

    Thread Starter New Member

    May 20, 2016
    4
    0
    Didn't have a fixed number in mind, let's say 8-12.
     
  7. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,771
    971
  8. akaSkyWolf

    Thread Starter New Member

    May 20, 2016
    4
    0
Loading...