Jump to content

Btn/LED matrix vs direct configurations


tago
 Share

Recommended Posts

Hi,

i wonder about pro/cons of matrix configurations vs direct connections (DIN/DOUT/DIO). What i've found so far is lower led brightness in matrix configs and different wirings.

I'll have 30 encoders, 60 btns and 90 leds mounted all over a fairly large (80x25cm) frontpanel perf board. To me it seems that direct connections to DINX4/DOUTX4 modules would lead to cleaner wiring in my case. Would that many IO modules result in bad performance as in higher core/cpu usage?

 

ps Additionally the controller will have 40 pots, a 4 octave keybed and 8 oleds.

Edited by tago
Link to comment
Share on other sites

LEDs in matrices are only on 1/8 of the time, so naturally they're dimmer. Are you using sink transistors, or at least no resistor on the sink side?

Matrices are designed to save pins, but it only makes sense when you have close to a grid arrangement. 

Count your pins for individual wiring:

30 encoders = 60 DINs

60 buttons = 60 DINs

90 LEDs = 90 DOUTs

120 DINs /8 per chip = 15 165 chips = 4 DINX4 modules

90 DOUT /8 per chip = 12 595 chips = 3 DOUTX4 modules

MIOS32 allows for a maximum of 32 shift registers (I think this is 32  DIN + 32 DOUT), so you're okay.

 

 

I hope we get to see it one day.

Link to comment
Share on other sites

Thanks for your input @latigid on

 

39 minutes ago, latigid on said:

Matrices are designed to save pins, but it only makes sense when you have close to a grid arrangement.

I anticipate the distances between LEDs/Btns etc. will be too large. So i'm leaning towards direct connection via DIN/DOUT modules.

 

35 minutes ago, latigid on said:

Are you using sink transistors, or at least no resistor on the sink side?

Unfortunately i've no idea what do you mean by this. For the LEDs i'd have 220ohms resistors on the DOUT modules. Is this what you're referring to? Do i need something like that with that many LEDs?

My current thinking is that i would need to power the core via a dedicated power supply (20mA * 100 = 2A max for LEDs alone).

 

42 minutes ago, latigid on said:

I hope we get to see it one day.

I hope too :) It's a slow process because i'm a beginner.

 

Link to comment
Share on other sites

4 minutes ago, tago said:

Thanks for your input @latigid on

 

I anticipate the distances between LEDs/Btns etc. will be too large. So i'm leaning towards direct connection via DIN/DOUT modules.

It creates more wiring work/mess and potential for mistakes, but can be simpler to address individual elements. With the NG if you have a missing/swapped connection, it should be quite simple to identify and fix.

 

4 minutes ago, tago said:

Unfortunately i've no idea what do you mean by this. For the LEDs i'd have 220ohms resistors on the DOUT modules. Is this what you're referring to? Do i need something like that with that many LEDs?

It doesn't matter if you go for single wiring, because you're addressing individual LEDs, with the DOUT pin via a resistor to the anode, and the cathode tied to ground.

However, when using a matrix, you want a constant current sink on the cathode side, so you bridge the resistors only on that DOUT section with wire. Otherwise, your total series resistance is ~440 ohm at a duty cycle of 0.125, and this will lead to dim LEDs! The other method is to connect the sink side resistors to the base of NPN transistors (collector to LED cathodes, emitter to ground/0V), or you could consider the ULN2803 octal Darlington driver. (The latest rev DOUT boards from SmashTV can fit sink or source driver chips directly on the PCB.)

 

4 minutes ago, tago said:

My current thinking is that i would need to power the core via a dedicated power supply (20mA * 100 = 2A max for LEDs alone).

For red/yellow/yellow-green LEDs with Vf ~2V, your consumption is approximately (5-2)/220 = 13.6mA for each LED. Don't forget the OLEDs can have reasonable consumption too. 

 

4 minutes ago, tago said:

I hope too :) It's a slow process because i'm a beginner.

Keep at it, you'll get there eventually!

Link to comment
Share on other sites

A small side note: don't wire up the encoders in matrix configuration. The normal encoder pulses will be high-speed and may not be "caught" by the reduced sampling rate of an input matrix leading to erratic encoder behaviour. At least that is my latest tech info, please correct me, if i am wrong :-). No problem on the LED output side, though, 8x8 matrices are great with low-power LEDs. This also drops your estimated current consumption a lot, a single LED will then not consume 20mA, only 1/8th of that, because of the reduced duty cycle.

Many greets,
Peter

Link to comment
Share on other sites

That's right Peter, encoders should be directly connected to 2* DIN pins. With button/LED matrices it can work and does save lots of pins and power, but the additional wiring might be suboptimal. For instance, anything other than a clean, square array will mean rows will be split, but the columns still need to be wired together. Of course, a way around this is to create multiple matrices based on smaller sections, even if not all positions are filled.

Best,
Andy

Link to comment
Share on other sites

1 hour ago, latigid on said:

However, when using a matrix, you want a constant current sink on the cathode side, so you bridge the resistors only on that DOUT section with wire.

Like shown in this schematic: http://www.ucapps.de/mbhp/mbhp_dout_8x8leds.pdf ?

 

1 hour ago, latigid on said:

or you could consider the ULN2803 octal Darlington driver. (The latest rev DOUT boards from SmashTV can fit sink or source driver chips directly on the PCB.)

I made my own DIN/DOUT boards and forgot to add the ULN2803 option. So i can only mount standard resistors or bridges :(

 

 

Link to comment
Share on other sites

1 hour ago, Hawkeye said:

A small side note: don't wire up the encoders in matrix configuration. The normal encoder pulses will be high-speed and may not be "caught" by the reduced sampling rate of an input matrix leading to erratic encoder behaviour.

Thanks for the hint Peter, sounds plausible.

 

 

Link to comment
Share on other sites

4 minutes ago, latigid on said:

With button/LED matrices it can work and does save lots of pins and power, but the additional wiring might be suboptimal. For instance, anything other than a clean, square array will mean rows will be split, but the columns still need to be wired together. Of course, a way around this is to create multiple matrices based on smaller sections, even if not all positions are filled.

How would that smaller sections look like? Two 4x4 (32 LEDs) instead of a single 8x8 (64 LEDs)? Is 4x4 even possible?

Link to comment
Share on other sites

56 minutes ago, tago said:

Like shown in this schematic: http://www.ucapps.de/mbhp/mbhp_dout_8x8leds.pdf ?

 

I made my own DIN/DOUT boards and forgot to add the ULN2803 option. So i can only mount standard resistors or bridges :(

 

 

Just try with the bridges, it should be okay with single anode columns

 

Just now, tago said:

How would that smaller sections look like? Two 4x4 (32 LEDs) instead of a single 8x8 (64 LEDs)? Is 4x4 even possible?

4*4 = 16 :)

For this, please read the NGC section:

 

Quote

DOUT_MATRIX

The DOUT_MATRIX command configures LED matrices which are connected between multiple DOUT shift registers.

Usecases:

  • Already with 2 DOUT shift registers it's possible to control 64 LEDs. One DOUT is used to select the column, the second DOUT to set the row pattern. By using the led_emu_id_offset parameter they behave like common EVENT_LED elements and can be controlled individually. This saves some hardware! (only 2 DOUT shift registers instead of 8 to drive 64 LEDs).
    Other useful hardware configurations: with 1 DOUT assigned to the column, and two assigned to the row, up to 128 LEDs can be controlled from 3 DOUT shift registers. With two DOUTs assigned to the column, and two assigned to the row, up to 256 LEDs can be controlled from 4 DOUT shift registers.
  • Actually each matrix provides three separate "row layers", called r, g, b (red, green, blue). You get the message: this allows you to control multicolour LEDs!
  • LED Rings and Meters - see also the LED_MATRIX_PATTERN configuration below. The led_matrix_pattern can be passed from a control element (e.g. EVENT_ENC) to the LED matrix in order to output a pattern based on the event value.
  • LED Digits (7-segment displays) are controlled from a DOUT_MATRIX as well. Here are some interconnection diagrams with the appr. .NGC configuration examples:

Available configuration parameters:

DOUT_MATRIX Parameter Description
n=<1..8> Specifies the matrix number which should be configured; it can range from 1..8
rows=<4|8|16> Sets the number of rows which should be scanned:
  • rows=4: 4 selection pulses are output by the DOUT register specified with sr_dout_sel1. The pulses are available twice: at D7:D4 and D3:D0.
    This configuration allows to scan up to 4x8 LEDs with two DOUTs, or 4x16 LEDs with three DOUTs.
  • rows=8: 8 selection pulses are output by the DOUT register specified with sr_dout_sel1. The pulses are available at D7:D0
    This configuration allows to scan up to 8x8 LED with two DOUTs, or 8x16 LEDs with three DOUTs.
  • rows=16: 16 selection pulses are output by the DOUT registers specified with sr_dout_sel1 and sr_dout_sel2. The pulses are available at D7:D0 of each register.
    This configuration allows to scan up to 16x8 LEDs with three DOUTs, or 16x16 LEDs with four DOUTs.
inverted=<1|0> DOUT selection lines will be inverted with inverted=1. This is required if the LEDs of the matrix have been connected in the opposite order:
  • inverted=0: Cathodes are connected to the DOUT selection lines, see also this schematic.
  • inverted=1: Inverting sink drivers have been added to the DOUT register.
  • inverted_sel=1 and inverted_row=1: Anodes are connected to the DOUT selection lines (swapped polarity)
inverted_row=<1|0> DOUT row patterns can be inverted with inverted_row=1
sr_dout_sel1=<0..16> Sets the first DOUT shift register which should output the row selection signals.
sr_dout_sel2=<0..16> Sets the second DOUT shift register which should output the row selection signals in a row=16 setup.
Set this parameter to 0 if a second DOUT is not required.
sr_dout_r1=<0..16> Sets the first DOUT shift register of the LED matrix row.
sr_dout_r2=<0..16> Sets the (optional) second DOUT shift register of the LED matrix row.
sr_dout_g1=<0..16>
sr_dout_g2=<0..16>
These parameters allow to drive duo-colour or RGB LEDs by using a second set of DOUTs connected to the green LEDs.
sr_dout_b1=<0..16>
sr_dout_b2=<0..16>
These parameters allow to drive RGB LEDs by using a third set of DOUTs connected to the blue LEDs.
mirrored_row=<1|0> The pins of the DOUT rows can be mirrored. This happens only for the shift register value itself. Means: if two DOUT shift registers are assigned to the row, they won't be swapped. If this is desired, just change the sr_dout_r1/sr_dout_r2 assignments.
led_emu_id_offset=<1..4095> With a value >0, the LED matrix will listen on EVENT_LED events instead of EVENT_LED_MATRIX, starting with the specified ID. A matrix of 8x8 LED can emulate 64 LEDs with individual event assignments this way.
In order to avoid conflicts with LEDs which are directly connected to DOUT pins (and which are accessed with LED:1 .. LED:256), it's recommended specify emulated ids outside this range, e.g. led_emu_id_offset=1001.
lc_meter_port=<USB1..USB4|IN1..IN4> Special option for the Logic/Mackie Control emulation. It allows to transfer incoming Poly Preasure events (which are used by the protocol to trigger the meters) to LED bars. An usage example can be found in following template (search for "meter"): logictrl.ngc

 

 

Link to comment
Share on other sites

1 hour ago, latigid on said:

4*4 = 16 :)

But TWO 4*4 = 32 :)

I thought SR1/SR2 (D7-D4)  = one matrix and SR1/SR2 (D3-D0) = second. But according to the docs it looks like 4x8 is the smallest.

The main problem is how to keep the wiring clean with perf boards.

 

Edited by tago
Link to comment
Share on other sites

11 hours ago, tago said:

Another problem is that i'd like colored LEDs. I assume i have to use different resistors to get an even brightness between them.

The way around this is to arrange LEDs of a single colour for each column. It's also important to do this when the Vf values are different, otherwise the current takes the easiest path through the wrong LED.

Link to comment
Share on other sites

3 hours ago, gerald.wert said:

You can use strip board either vertically or horizontally to reduce you wiring if it makes sense for your layout. It should cut your individual wires almost in 1/2.

I have 500x200mm perf boards (hard paper) for now, it's not perfect.

Do you know a supplier for large sturdy strip boards? At Reichelt they only have max. 500x100mm (hard paper). I would prefer epoxy for more mechanical stability. My frontplate dimension is 800x250mm.

 

Link to comment
Share on other sites

I tested some 20mA LEDs and found they could be dimmer. Low-current LEDs (2mA) would be to dark. Is it ok to halve the current via higher resistance sink resistor? Or will there be too much loss/ bad efficiency?

Edited by tago
Link to comment
Share on other sites

The Veroboard is really good quality. Their most durable is the epoxy board. It is much more durable than the paper or phenolic stuff. You can buy it direct :

https://veroboard.com/product-category/the-veroboard-products/view-by-material/epoxy-fiber/

It comes up on Amazon and ebay too. That is where I normally buy it but I do not see a good listing right now.

If you have ever worked with fiber glass before be sure to protect yourself when cutting it. I wear disposable gloves mask and safety glasses. Use a rotary tool with a fiber cutoff disk to cut it. It cuts a lot faster if you cut down a row with the holes in it and they make a nice guide. Also try not to cut it to fast so it does not heat up and smoke. Making a shallow first pass and going back over it a few times keeps it from smoking. It does take some time making the cuts to lay out the circuit but I find it is faster than cutting and stripping so many extra wires. It may or may not be faster than etching a board it depends on how many holes you have to drill and how much time you have to spend laying it out in the cad program. Another design tip if you are using encoders you can run you ground bus below the encoders on a strip and jump over to it with a resistor trimming.

 

Link to comment
Share on other sites

On 22.3.2017 at 10:56 PM, latigid on said:

Try dimmed and see how it works for you.

I got a dimmed LED working, but had to use a range map (eg 0 2) to get a fixed dimmed value. Is there a better way?

Does this method saves power vs resistor solution? I'd assume yes if it's done via PWM. But i have really no idea.

Link to comment
Share on other sites

3 hours ago, gerald.wert said:

The Veroboard is really good quality. Their most durable is the epoxy board. It is much more durable than the paper or phenolic stuff. You can buy it direct :

https://veroboard.com/product-category/the-veroboard-products/view-by-material/epoxy-fiber/

Thank you.

5"x10" Epoxy Fiber Strip Board Copper USD $13.80 -> 7pcs = $96.60

11.5"x19.5" Epoxy Fiber Strip Board Copper USD $63.40 -> 2pcs =  $126.80

The question is whether strip boards would really help with many mixed parts (leds, btn, pots).

A custom pcb at dirtypcb with 80x25cm cost $250 for 10 pieces. If i could find a manufacturer that offers single pieces, maybe it would make sense to do a custom pcb.

 

 

 

Link to comment
Share on other sites

7 hours ago, tago said:

I got a dimmed LED working, but had to use a range map (eg 0 2) to get a fixed dimmed value. Is there a better way?

I haven't tried this with direct DOUT pins. I know for the WS2812-type LEDs "dimmed=1" will allow a CC to control the dimming level as defined in the LED event.

 

7 hours ago, tago said:

Does this method saves power vs resistor solution? I'd assume yes if it's done via PWM. But i have really no idea.

With a resistor, you're burning current*voltage as heat, so yes, switching the LED via PWM should be more efficient. Measure it yourself: set the multimeter to mA and connect it in series after the resistor. You'll need a higher value resistor to match the given dimmed value. 

Something else to keep in mind is you don't want a panel full of flashlights. The more LEDs on your panel, the lower brightness they should be (depending on how they're spread apart).

 

6 hours ago, tago said:

The question is whether strip boards would really help with many mixed parts (leds, btn, pots).

Check also if your parts have a standard 0.1"/2.54mm pin spacing.

 

6 hours ago, tago said:

A custom pcb at dirtypcb with 80x25cm cost $250 for 10 pieces. If i could find a manufacturer that offers single pieces, maybe it would make sense to do a custom pcb.

If you're inexperienced with PCB design, it will probably take the same amount of time (+mistakes) as going the wiring method. That said, it's a good chance to practice. Consider splitting the panel into subsections, that brings the down cost and shipping is easier. If others find the layouts useful you can sell the extras you don't need. 

 

 

Link to comment
Share on other sites

You can spend a lot of time routing traces in a cad program. If you etch your own PCB you also need to consider drill time. Limited drilling can be an advantage of strip or pad per hole board in a proto phase or a one off. You have a lot more freedom in part placement when making a board in cad. If you are planning more that one it is definitely worth cad time. +1 to also having more than one board, that will make your life a lot easier when you start to trouble shoot it in addition to the lower cost.

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...