Arduino powered bi-colour LED array

Discussion in 'Embedded Systems and Microcontrollers' started by EnjoyIce, Nov 18, 2015.

  1. EnjoyIce

    Thread Starter New Member

    Jan 13, 2014
    25
    0
    Hi guys,

    I am fairly newish to Electronics so this is all a bit alien to me ... but I'm keen to learn so any help would be really appreciated!

    I am working on a project - I require a 12 LED array (3-pin, bi-colour). I need to be able to control each LED separately (its colour and its brightness) and am using an Arduino controller.

    I will control the brightness of the LED via pulse with modulation as just varying the voltage directly can potentially cause the LED to go into breakdown etc and we don't want that! ^_^ (I do know a fewwww things!).

    So, I need a way to connect these LEDs together (its a 3x4 grid) that allows me to control each ones colour and brightness separately via an Arduino controller.

    Software wise I think I am ok, I just need to figure out how to design this circuit with the correct connections for the Arduino so it will be basically 'plug and play' once the software is done.

    These are the LEDs I am planning on using: https://www.lc-led.com/View/itemNumber/411

    I think that is all the information needed, just give me a shout if there is anything else! I'm looking forward to this project but feel a bit like a deer caught in the headlights at the moment.

    Thanks :)
     
  2. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,769
    969
    google charlieplexing and multiplexing and arduino LED cube and tons of other examples..
     
  3. EnjoyIce

    Thread Starter New Member

    Jan 13, 2014
    25
    0
    Thanks for the reply - I didn't know where to start looking really so thanks for the hints.

    (Prepare for a bit of a ramble, sorry!)

    I've been looking into multiplexing and charlieplexing.

    I think charlieplexing may be the better option as I need to drive 24 LEDs (12 bicolour) and I can do that via 6 pins using charlieplexing. Calculated by NumLEDs = NumPins*(NumPins-1).

    In order to power each LED and both possible colours I would need to connect them to two outputs each? So each LED has 2 outputs connected to it and then the common cathode goes to ground.

    Because of the way charlieplexing works, I cannot have certain LEDs on with other ones on so I would need to cycle through the selections really quickly which is something that can be controlled by the software.

    So it would be something like this, but rather than two separate LEDs, it would be one LED connected in the same way.
    [​IMG]

    Although would I come into an issue here? Since the common cathode would need to be connected to both outputs as well to achieve the same configuration?

    In which case would multiplexing be the better option? I was going for charlieplexing until I wrote this reply and now I am having doubts. I will leave in my initial thoughts above incase there is something good in there.

    *some time later after working things out*

    For multiplexing, I will need 10 pins for the 12 LEDs? It is a 3x4 array, however since they are bicolour they will need two separate input pins for each LED so it doubles the pins from 3 by 4 to 6 by 4 (10).

    So I'd cycle through all 24 possible combinations of row/column and light up what is needed to give the desired output (persistence of vision).

    In terms of brightness, would this be a sensible way to approach it? Say each main cycle through the 24 states has 5 minicycles, giving 5 brightness states. So, if the LED is at 100% then the LED would be on for all 5 minicycles. If the LED is at 40%, it would be on for only 2 of the minicycles. This would effectively give me an easy way to control the brightness and I can change 5 to 10 or any other number to give me more specific control of brightness. I would just have to be careful not to pick a number too high as too high a number would slow the overall cycling down and could potentially cause visible flickering once it gets slow enough.

    As for the current limiting resistors, I'd attach them on the common cathode (ground pins). Its against convention but it doesn't matter where the resistors are as its in series and that would require half the resistors than would be needed if I connected them at the anodes.

    Am I on the right track here?

    Sorry about my rambling .. I'm learning so will be a bit all over the place but I appreciate the help.

    Thanks!
     
  4. EnjoyIce

    Thread Starter New Member

    Jan 13, 2014
    25
    0
    I don't seem to be able to edit my previous post, sorry if there is a way - I couldn't see it.

    Some updates: I actually need 11 pins, not 10. Its 3x4 but its the 4 that is doubled, so I need 8 input pins + 3 ground pins. I suppose this depends entirely on the orientation of the circuit as to which way I want the rows/columns being. Having the 8 inputs and 3 grounds works better than the 6 inputs and 4 grounds in terms of space constraints on the board so unless there is any reason not to do it other than having one more input (does that make it exponentially harder or anything?) then I'll go with 11.

    Also, the resistors. I will need to actually place them at the anode side of each input row, as each colour requires a different voltage. So I will need different resistors for each colour.

    Hope those improvements are in the right direction!
     
Loading...