Jump to content

Connecting RGB LEDs


FantomXR
 Share

Recommended Posts

I'm trying to understand, what would be the easiest way to connect around 70 RGB LEDs (so around 210 single LEDs). I took a look into the NG-manual. In the DOUT-Matrix chapter it says:

 

"These parameters allow to drive duo-colour or RGB LEDs by using a second set of DOUTs connected to the green LEDs."

and

"These parameters allow to drive RGB LEDs by using a third set of DOUTs connected to the blue LEDs."

 

Do I really need to setup one DOUT (not shift register) per color? If didn't make a mistake in my calculation, one DOUT would be enough to drive 70 RGB LEDs in matrix-mode. I thought, I could connect the LEDs like this:

 

LED1:

Red = D7

Green = D6

Blue = D5

 

LED2:
Red = D4

Green = D3
Blue = D2

 

etc.

Edited by FantomXR
Link to comment
Share on other sites

  • Replies 74
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Marxon links to a long thread where issues are discovered and resolved, it has a happy ending!

 

A few points in summary:

  • 64 RGB LEDs can be driven by a single DOUTx4 PCB
  • The (4) shift registers of the DOUT are organised:(1) row drivers, (1)Reds, (1)Greens, (1)Blues, assignable on a register, not on a bit level.
  • This 8x8 RGB LED matrix  provides at least 64 colours and looks great. 
  • I upgraded to a 16x4 matrix by adding 3 more shift registers (7 total), this gives higher duty cycle, more colours, even brighter. 
Link to comment
Share on other sites

Thanks!

I read thru the thread. Interesting stuff out there! ;)

 

I want to use ULN2803 drivers anyway to drive the LEDs. I hope, I don't need to setup a 16x4 instead of 8x8 to get good brightness levels.

I think I need to hook up some kind of schematic to not get confused by all the connections ;)

 

Anyway: If I want to use more than 64 RGB LEDs it's necessary to use a second DOUTx4 or it's possible to enhance it to a 10x8 matrix?

Link to comment
Share on other sites

The ULN drivers are good to use, but they have a ~=1V minimum output so you can compensate by using a lower series resistor (I used 82 R).

 

You could set up a second  DOUT matrix to provide up to another 64 LEDs.

 

The 8x8 matrix I built was quite bright. I made rectangular diffusers out of opal perpex which spread (and de-intensified) the light.

 

I constructed the matrix in a modular fashion:

  • 4 LEDs to a strip of matrix board with cathodes commoned together along the horizontal (a "module")
  • 2 modules for each row of 8 leds (a link connecting the common cathodes)
  • 8 rows in total.
  • the RGB anodes of each LED have 3 pin header pointing in one direction, and 3 wires 10cm long, with a 3 header socket wired to it.
  • columns are formed by chaining tegether the header plug/sockets
  • The output of the ULN pins wired to each row. 

If you draw diagram it helps to make things clear.

Link to comment
Share on other sites

Yes!
I draw a diagram in Eagle to make it clear.

 

Because I need to use a second DOUT anyway, the first matrix will be 6x8 (six RGB LEDs in eight rows). Did I get it right, that the first SR sets the rows. On the second SR I need to connect all red LEDs (which would be six lines, each with 8 LEDs), third SR all green, 4th SR all blue.

Cause your schematic in this topic

 

says something else.

Link to comment
Share on other sites

 

says something else.

 

Yes, the situation evolved during the thread.

 

Did I get it right, that the first SR sets the rows. On the second SR I need to connect all red LEDs (which would be six lines, each with 8 LEDs), third SR all green, 4th SR all blue.

Correct, and the nice thing is, the configuration variables: sr_dout_sel1, sr_dout_r1, sr_dout_g1, sr_dout_b1  can be assigned to any SR in the DOUT chain.

As you may have recognised, 8 rows of 6 has a little less wiring than 6 rows of 8 (8+3*6=26 Vs. 6+3*8=30), though how you plan on routing the wiring, layout etc, can influence which wiring scheme is best for you (they're functionally the same).

Note that the second DOUT matrix will have it's own  sr_dout_sel1, sr_dout_r1, sr_dout_g1, sr_dout_b1 assignments.

 

Link to comment
Share on other sites

Great!

I drawed a schematic. But I think I need to sit right in front of the LEDs to know, where which wire to solder ;) But all orders were done today. I should get a few nice packages the next days.

I forgot to mention: I have some PCBs with a led ring on it. Its 0603 warmwhite SMD LEDs. How to connect them to the two DOUTs? Is that possible or do I need a dedicated DOUT for those LEDs? If I connect them all to one color-SR there shouldn't be a problem, right?

Link to comment
Share on other sites

I forgot to mention: I have some PCBs with a led ring on it. Its 0603 warmwhite SMD LEDs. How to connect them to the two DOUTs? Is that possible or do I need a dedicated DOUT for those LEDs? If I connect them all to one color-SR there shouldn't be a problem, right?

Not quite sure exactly what you mean here.

If you nave extra LED's you want to drive then yes, you could connect them to the spare columns of the RGB matrix.

To have proper control over the LEDs you'd only connect LEDs to the red columns. I don't know how or if LED rings could be driven this way.

Simpler and probably a lot better to add SR's for extra LED rings.

Link to comment
Share on other sites

  • 2 weeks later...

Thanks for your help!

Another one: How to connect an expression pedal to the LPC? It has a stereo jack, so I assume, I need to connect GND to GND, tip and ring to a separate analog-in on the LPC. But how to assign them in the NGC so it behaves like one controller?

Link to comment
Share on other sites

Thanks for your help!

Another one: How to connect an expression pedal to the LPC? It has a stereo jack, so I assume, I need to connect GND to GND, tip and ring to a separate analog-in on the LPC. But how to assign them in the NGC so it behaves like one controller?

I'd assume the expression pedal is a potentiometer.

The wiper will change it's resistance to ground. Tip or ring? Find out with meter.

The 3rd terminal will have constant resistance to ground. This is wired to 3.3V supply rail.

The wiper goes to the ADC input of Core.

Configure using EVENT_AIN.

Link to comment
Share on other sites

  • 3 weeks later...

Okay, here we go!

 

I now connected 4 rows with 16 LEDs per row to D0:D3 of SR1. For now I just connected eight (8x4) of the green LEDs to D7:D0 of SR2 to see, if it's working.

I connected the DOUT with the core. The first SR has no resistors, just bridges. SR 2-4 are equiped with ULN2803. I put a 82Ohm resistor to each output (so, 8 resistors).

 

I tried this code:
 

 

# In this demo we configure individual brightness levels for the LEDs

RESET_HW

LCD "%C@(1:1:1)RGB Demo #1"


# In the SR configuration we assume that the DOUTs are directly connected to J8/9 of the core
# they emulate led functions
DOUT_MATRIX n=1  rows=4  inverted=0  sr_dout_sel1=1  sr_dout_r1=2  sr_dout_g1=3  led_emu_id_offset=1001

# note: actually the sr_dout_sel1 in DOUT_MATRIX could be removed,
# since DIN_MATRIX already outputs the selection pulses there
# this is just for the case that somebody copy&pastes the definition...


# LED Functions (assigned to the same events like the buttons)
EVENT_LED     id=1001  type=NoteOn key=36 chn=1  rgb=15:0:0
EVENT_LED     id=1002  type=NoteOn key=37 chn=1  rgb=15:0:0
EVENT_LED     id=1003  type=NoteOn key=38 chn=1  rgb=15:0:0
EVENT_LED     id=1004  type=NoteOn key=39 chn=1  rgb=15:0:0
EVENT_LED     id=1005  type=NoteOn key=40 chn=1  rgb=15:0:0
EVENT_LED     id=1006  type=NoteOn key=41 chn=1  rgb=15:0:0
EVENT_LED     id=1007  type=NoteOn key=42 chn=1  rgb=15:0:0
EVENT_LED     id=1008  type=NoteOn key=43 chn=1  rgb=15:0:0

EVENT_LED     id=1033  type=NoteOn key=44 chn=1  rgb=0:15:0
EVENT_LED     id=1034  type=NoteOn key=45 chn=1  rgb=0:15:0
EVENT_LED     id=1035  type=NoteOn key=46 chn=1  rgb=0:15:0
EVENT_LED     id=1036  type=NoteOn key=47 chn=1  rgb=0:15:0
EVENT_LED     id=1037  type=NoteOn key=48 chn=1  rgb=0:15:0
EVENT_LED     id=1038  type=NoteOn key=49 chn=1  rgb=0:15:0
EVENT_LED     id=1039  type=NoteOn key=50 chn=1  rgb=0:15:0
EVENT_LED     id=1040  type=NoteOn key=51 chn=1  rgb=0:15:0

EVENT_LED     id=1009  type=NoteOn key=52 chn=1  rgb=15:15:0
EVENT_LED     id=1010  type=NoteOn key=53 chn=1  rgb=15:15:0
EVENT_LED     id=1011  type=NoteOn key=54 chn=1  rgb=15:15:0
EVENT_LED     id=1012  type=NoteOn key=55 chn=1  rgb=15:15:0
EVENT_LED     id=1013  type=NoteOn key=56 chn=1  rgb=15:15:0
EVENT_LED     id=1014  type=NoteOn key=57 chn=1  rgb=15:15:0
EVENT_LED     id=1015  type=NoteOn key=58 chn=1  rgb=15:15:0
EVENT_LED     id=1016  type=NoteOn key=59 chn=1  rgb=15:15:0

EVENT_LED     id=1041  type=NoteOn key=60 chn=1  rgb=4:15:0
EVENT_LED     id=1042  type=NoteOn key=61 chn=1  rgb=4:15:0
EVENT_LED     id=1043  type=NoteOn key=62 chn=1  rgb=4:15:0
EVENT_LED     id=1044  type=NoteOn key=63 chn=1  rgb=4:15:0
EVENT_LED     id=1045  type=NoteOn key=64 chn=1  rgb=4:15:0
EVENT_LED     id=1046  type=NoteOn key=65 chn=1  rgb=4:15:0
EVENT_LED     id=1047  type=NoteOn key=66 chn=1  rgb=4:15:0
EVENT_LED     id=1048  type=NoteOn key=67 chn=1  rgb=4:15:0

EVENT_LED     id=1017  type=NoteOn key=68 chn=1  rgb=15:4:0
EVENT_LED     id=1018  type=NoteOn key=69 chn=1  rgb=15:4:0
EVENT_LED     id=1019  type=NoteOn key=70 chn=1  rgb=15:4:0
EVENT_LED     id=1020  type=NoteOn key=71 chn=1  rgb=15:4:0
EVENT_LED     id=1021  type=NoteOn key=72 chn=1  rgb=15:4:0
EVENT_LED     id=1022  type=NoteOn key=73 chn=1  rgb=15:4:0
EVENT_LED     id=1023  type=NoteOn key=74 chn=1  rgb=15:4:0
EVENT_LED     id=1024  type=NoteOn key=75 chn=1  rgb=15:4:0

EVENT_LED     id=1049  type=NoteOn key=76 chn=1  rgb=8:15:0
EVENT_LED     id=1050  type=NoteOn key=77 chn=1  rgb=8:15:0
EVENT_LED     id=1051  type=NoteOn key=78 chn=1  rgb=8:15:0
EVENT_LED     id=1052  type=NoteOn key=79 chn=1  rgb=8:15:0
EVENT_LED     id=1053  type=NoteOn key=80 chn=1  rgb=8:15:0
EVENT_LED     id=1054  type=NoteOn key=81 chn=1  rgb=8:15:0
EVENT_LED     id=1055  type=NoteOn key=82 chn=1  rgb=8:15:0
EVENT_LED     id=1056  type=NoteOn key=83 chn=1  rgb=8:15:0

EVENT_LED     id=1025  type=NoteOn key=84 chn=1  rgb=15:8:0
EVENT_LED     id=1026  type=NoteOn key=85 chn=1  rgb=15:8:0
EVENT_LED     id=1027  type=NoteOn key=86 chn=1  rgb=15:8:0
EVENT_LED     id=1028  type=NoteOn key=87 chn=1  rgb=15:8:0
EVENT_LED     id=1029  type=NoteOn key=88 chn=1  rgb=15:8:0
EVENT_LED     id=1030  type=NoteOn key=89 chn=1  rgb=15:8:0
EVENT_LED     id=1031  type=NoteOn key=90 chn=1  rgb=15:8:0
EVENT_LED     id=1032  type=NoteOn key=91 chn=1  rgb=15:8:0

EVENT_LED     id=1057  type=NoteOn key=92 chn=1  rgb=15:12:0
EVENT_LED     id=1058  type=NoteOn key=93 chn=1  rgb=15:12:0
EVENT_LED     id=1059  type=NoteOn key=94 chn=1  rgb=15:12:0
EVENT_LED     id=1060  type=NoteOn key=95 chn=1  rgb=15:12:0
EVENT_LED     id=1061  type=NoteOn key=96 chn=1  rgb=15:12:0
EVENT_LED     id=1062  type=NoteOn key=97 chn=1  rgb=15:12:0
EVENT_LED     id=1063  type=NoteOn key=98 chn=1  rgb=15:12:0
EVENT_LED     id=1064  type=NoteOn key=99 chn=1  rgb=15:12:0

 

But... no lights... nothing happens......

any suggestions?

Edited by FantomXR
Link to comment
Share on other sites

I connected the DOUT with the core. The first SR has no resistors, just bridges. SR 2-4 are equiped with ULN2803. I put a 82Ohm resistor to each output (so, 8 resistors). 

You're using common cathode RGB LED's right?

If so, you cant use ULN2803 as drivers on SR2..4 because ULN2803 is a "low side driver" (Darlington NPN) and won't work as a high side driver.

If your LEDs are common cathode, move one of the ULN's onto SR1, remove the others and replace with a resistor (SR2..4). Also change to "inverted=1".

This configuration works geat.

 

Link to comment
Share on other sites

Here's an excerpt from my config:

#rgbled
DOUT_MATRIX n=1  rows=4  inverted=1  sr_dout_sel1=1  sr_dout_r1=2 sr_dout_r2=5  sr_dout_g1=3 sr_dout_g2=6 sr_dout_b1=4 sr_dout_b2=7  led_emu_id_offset=1001

# LEDs go to colours according to bank selection
EVENT_LED value=127 id=1001 bank=1  rgb=15:0:0
EVENT_LED value=127 id=1002 bank=1  rgb=15:0:0
EVENT_LED value=127 id=1003 bank=1  rgb=15:5:0


EVENT_LED value=127 id=1001 bank=2  rgb=0:0:15
EVENT_LED value=127 id=1002 bank=2  rgb=0:0:15
EVENT_LED value=127 id=1003 bank=2  rgb=7:0:15 

EVENT_LED value=127 id=1001 bank=3  rgb=7:15:0
EVENT_LED value=127 id=1002 bank=3  rgb=7:15:0
EVENT_LED value=127 id=1003 bank=3  rgb=15:7:0

The way you have your config is to light the LED's only when the note is active.

Link to comment
Share on other sites

 

Should I take 82Ohm or standard 220Ohm resistors?

 

When I changed my array from 8x8 to 4x16, I added a DOUT PCB that already had 220R fitted (The first DOUT had 82R fitted). So half is 82R the other half is 220R and it is not at all clear that one half is brighter....

I think this is because the current limiting is mainly in the SR's.

Conclusion: it probably doesn't matter. It may be a good idea to test the brightness on one or two LEDs before you solder a whole bunch of resistors anyhow...

You may want the whole array dimmer for some reason.

Also it may be good to check that R,G and B are fairly balanced with the same value resistor. In my case they were, but...

Link to comment
Share on other sites

Sounds like a wiring problem.

To isolate, please temporarily change the config to straight LED DOUTs rather than MATRIX.

My suggestion is to set up each DOUT pin as EVENT_LED in toggle mode with a unique midi key to control it.

Using MIOS Studio keyboard events, individually activate each row and column to find out if you have control over R,G,B of every LED (by itself).

They will be rather bright because there will be 100% duty cycle.

As the lines are not scanned (they will be in a steady state), you will be able to trace the voltages with a multimeter (if you get incorrect results).

Link to comment
Share on other sites

As you can see in the picture attached, I'm able to set the color for every single LED.

 

Because my wiring was very (!) time consuming, I don't want to rip it all up. And I don't get exactly, what you mean. Maybe you can explain more into detail?

I really appreciate your help!

post-10331-0-49986900-1372893771_thumb.j

Link to comment
Share on other sites

Do not change the wiring!

Change the configuration in default.ngc so that you can individually control each row and column of the matrix separately, using midi key events.

This is so that you can isolate the problem.

Do you understand the idea?

Link to comment
Share on other sites

I'm not so much experienced with coding. So please excuse my "bad coding".

 

I tried just this

 

EVENT_LED  id=1  type=CC cc=16 rgb=0:0:15

 

Nothing happens, when I use the slider. Same with keys... everything is dark.

 

 

//edit: I did draw a diagram, that shows, how I connected the LEDs. The color of the boxes are the rows, the number is the led.

post-10331-0-13838300-1372898174_thumb.j

Edited by FantomXR
Link to comment
Share on other sites

I'm suggesting you take a step by step approach to discovering what is going on with your LED array.

I've made some very specific suggestions.

It is up to you if you want to do it, or not.

Now, can you confirm the the LED's are common cathode or common anode? (Do you have data?)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share


×
×
  • Create New...