boji

Bi-color leds and shift registers
« on: November 20, 2020, 06:13:13 PM »
When using a two pin bi-color led, is there any standard shift register technique for swapping anode/cathode pins?  Going to guess the solution would be to double-up on them so to get a source/sink (red), sink/source (green) or sink/sink (off) state delivery to two pins.

Perhaps there's a better ic to use, one where pin output states are flexible and can drive a bunch of leds?
So far the only thing I'd be confident coding-up would be a few atmel megas, banging out pinstates 1:1, sent to buffers.
« Last Edit: November 20, 2020, 06:22:44 PM by boji »


volker

Re: Bi-color leds and shift registers
« Reply #1 on: November 20, 2020, 06:28:09 PM »
You can do it with one IC too, you just need double the number of output pins compared to LEDs.

What would you consider more flexible? Whether you use shift registers, inverters as buffers, a multiiplexing scheme or something else depends on the number of LEDs you want to drive and the number of pins of your controller you want to use.

ruffrecords

Re: Bi-color leds and shift registers
« Reply #2 on: November 20, 2020, 06:31:10 PM »
You could do it with a couple of port pins with pull up resistors and the LED across the two port pin outputs.  Off state is both ports high. Set either one to zero to light one LED. Both ports low would also be off but consume more current.

You might be able to do something clever with three port pins and two bipolar LEDs??

Cheers

Ian
www.customtubeconsoles.com
https://mark3vtm.blogspot.co.uk/
www.eztubemixer.blogspot.co.uk


'The only people not making mistakes are the people doing nothing'

boji

Re: Bi-color leds and shift registers
« Reply #3 on: November 20, 2020, 08:33:19 PM »
Thanks for questions and ideas guys.

Quote
What would you consider more flexible?
Doing what I know already works. =D (must learn to implement these 74HC595 type basics however!)

Quote
depends on the number of LEDs you want to drive
Project requires 48 bi-colors (96 color states) for non-latching buttons, perhaps additional 10 for general indication and aux duty. Button logic produces cv low to mute, pfl, and afl relays with an optional config for sip.

Quote
couple of port pins with pull up resistors and the LED across
Two pins with output changed high/low are how the proto is working now.  Just thinking advanced coders would want to smack me for brute force approach. =D  Was hoping there was an 8 or 16pin SIPO that could be daisychained to produce buffered outputs of low, high, or null depending on shifted inputs of say, 0,1,2. Of course this would reduce the Mc pin connections to three or four.

Edit: I should probably keep reading/searching. Can't imagine wanting a shift register's pins to either source or sink on the fly is extraordinary. Perhaps I'm just describing a basic mc chip!


Brute force would require two of these:




« Last Edit: November 20, 2020, 08:56:42 PM by boji »

JohnRoberts

Re: Bi-color leds and shift registers
« Reply #4 on: November 20, 2020, 09:16:13 PM »
When using a two pin bi-color led, is there any standard shift register technique for swapping anode/cathode pins?  Going to guess the solution would be to double-up on them so to get a source/sink (red), sink/source (green) or sink/sink (off) state delivery to two pins.

Perhaps there's a better ic to use, one where pin output states are flexible and can drive a bunch of leds?
So far the only thing I'd be confident coding-up would be a few atmel megas, banging out pinstates 1:1, sent to buffers.
easy peasy... connect two lead bicolor between the two outputs with a resistor in series. Both hi or both low is off... one high or the other is red or green.

I shared a schematic recently for how to drive 36 LEDs but the bicolor LEDs were 4 pin and both colors could be illuminated at the same time. https://groupdiy.com/index.php?topic=75407.msg970750#msg970750


JR


 
It's nice to be nice....

boji

Re: Bi-color leds and shift registers
« Reply #5 on: November 20, 2020, 11:52:23 PM »
Quote
between the two outputs
Thought Q can deliver +5v but not also be used as a return. It would help if I had some in front of me to play with.  ::) Should have waited to speak up.

Quote
[Resotune II] bicolor LEDs were 4 pin and both colors could be illuminated at the same time.

Yeah the buttons the leds sit in won't accept more than two pins. For that third color I'd like to try for PoV switching.


ruffrecords

Re: Bi-color leds and shift registers
« Reply #6 on: November 21, 2020, 06:54:29 AM »
How many LEDs per module?

Cheers

Ian
www.customtubeconsoles.com
https://mark3vtm.blogspot.co.uk/
www.eztubemixer.blogspot.co.uk


'The only people not making mistakes are the people doing nothing'

JohnRoberts

Re: Bi-color leds and shift registers
« Reply #7 on: November 21, 2020, 09:36:37 AM »
Thought Q can deliver +5v but not also be used as a return. It would help if I had some in front of me to play with.  ::) Should have waited to speak up.
 
Yeah the buttons the leds sit in won't accept more than two pins. For that third color I'd like to try for PoV switching.
Back in my old kit business I used a 3 lead bi-color LED (common cathode). When I joined Peavey they had a two lead bicolor in the system so I started using that.

I have shared before a bicolor signal present/OL indicator. In that case I drove the LED from an op amp with resistances to +v or -V.
-------
As I already answered adding a R in series with the two lead bicolor and driving the two ends independently,  high, or low, or mixed from a low impedance source can generate either polarity of current flow.

JR 
It's nice to be nice....

Re: Bi-color leds and shift registers
« Reply #8 on: November 21, 2020, 01:24:08 PM »
Just out of interest, which buttons are you using?

boji

Re: Bi-color leds and shift registers
« Reply #9 on: November 21, 2020, 01:38:36 PM »
Quote
How many LEDs per module?

For majority of them, Two. Mute and solo buttons each contain a bi-color.

Quote
I have shared before a bicolor signal present/OL indicator
Yes! Sophisticated, and exceeds my ability to trace flow.

I''ll play around with two bi-colors paired together at one end once 595's arrive.

Thanks gents.

Quote
out of interest, which buttons are you using?

https://www.nkkswitches.com/pdf/hbilluminated.pdf
« Last Edit: November 21, 2020, 01:45:08 PM by boji »


boji

Re: Bi-color leds and shift registers
« Reply #10 on: November 27, 2020, 04:43:53 PM »
Hey friends,
Before shift registers arrive, would you mind looking over this simple interfacing of M/C for mistakes?

For example not sure BC550 is appropriate, even though it works on breadboard.
Datasheet shows it should be fine, but if you have a better recommendation I welcome it.

« Last Edit: November 27, 2020, 11:23:35 PM by boji »

ruffrecords

Re: Bi-color leds and shift registers
« Reply #11 on: November 28, 2020, 04:20:51 AM »
It seems a little complex to me but I have not studied it in detail. The only thing I would add would be a small series resistor before the 10uF cap that decouples the incoming supply to slow up its recharge current from the supply after dumps its charge into the relays when they operate.

Cheers

Ian
www.customtubeconsoles.com
https://mark3vtm.blogspot.co.uk/
www.eztubemixer.blogspot.co.uk


'The only people not making mistakes are the people doing nothing'

volker

Re: Bi-color leds and shift registers
« Reply #12 on: November 28, 2020, 08:22:31 AM »
Muntzing some stuff.

- Use internal pullup of the controller.
- Dampening a digital output is unnecessary.
- You only need one resistor in series with the LED.
- One diode should be enough if they don't sit a meter apart.

That zener arrangement seems overly complex to me. But I might not have fully thought through what you are trying to achieve there. This would be the common way of doing it.
« Last Edit: November 28, 2020, 08:44:26 AM by volker »

boji

Re: Bi-color leds and shift registers
« Reply #13 on: November 28, 2020, 08:42:25 PM »
Thanks to the both of you!

I'm glad no one had any complaints about the BC550. 

Quote
seems a little complex
Yes.  Should have noted that relay / zener pulldown was sourced from 70's console and meant for simple switches. I think its complexity had to do with PSU stabilization? Circuit draws more current while unselected than selected.
Quote
add would be a small series resistor before the 10uF cap that decouples the incoming supply to slow up its recharge current
Unfortunately there's no going back at this point; those little relay sub assemblies are already in place in the hundreds.  May I ask, why slow the recharging, potential noise?


Quote
Use internal pullup of the controller.
Yeah, after some reading, found a suggested minimum 1k pulldown was needed to produce .5mA, the minimum current required for button contacts to self clean. Perhaps the button was built to do this mechanically, but playing it safe. Was this bad information?


Quote
- Dampening a digital output is unnecessary.
Playing with this was fun. Cap is just precautionary. I found that when base of BC550 was left floating, my hand acted like a touch sensor and put it into oscillation, as well if M/C ground and PSU ground lose reference. Cap acts like a sort-of schmitt should anything get accidently disconnected (I had this image of a session getting ruined because my desk was buzzing).


Quote
You only need one resistor in series with the LED.
Yessr, thank you. Only did it this way so each mc pin has current protection, which is probably redundant as protection is likely on-chip as well.


Quote
One diode should be enough if they don't sit a meter apart.
Good to know! But too late to change. :)
« Last Edit: November 29, 2020, 04:16:47 AM by boji »

ruffrecords

Re: Bi-color leds and shift registers
« Reply #14 on: November 29, 2020, 04:01:19 AM »
May I ask, why slow the recharging, potential noise?

Yes. The idea of a cap is to provide local charge storage for when the relay first operates so the PSU doesn't have to provide a current spike. With out it, once the cap has dumped its charge into the relay to make it operate, the cap recharges through its ESR. This is very low so the recharge current spike will be short and tall. With a small series resistor, the recharge time is much longer so you get a smaller but longer current spike. Current spikes are great for cross coupling onto audio lines so you need to tame them if you can. They may also get onto the audio power rails if they use the same supply. In a big desk when you flip SIP, lots of relays can go over at once, which can cause a seriously big spike.

Cheers

Ian
www.customtubeconsoles.com
https://mark3vtm.blogspot.co.uk/
www.eztubemixer.blogspot.co.uk


'The only people not making mistakes are the people doing nothing'

boji

Re: Bi-color leds and shift registers
« Reply #15 on: November 29, 2020, 04:27:46 AM »
Quote
In a big desk when you flip SIP, lots of relays can go over at once, which can cause a seriously big spike.

 :o :o  Good point and I've yet to be able to test this. Fingers crossed there's enough iso and copper between sources. I did make certain +V relay and audio supplies never commingle, except where they get sent out from within the PSU.

JohnRoberts

Re: Bi-color leds and shift registers
« Reply #16 on: November 29, 2020, 10:07:24 AM »


Yeah, after some reading, found a suggested minimum 1k pulldown was needed to produce .5mA, the minimum current required for button contacts to self clean. Perhaps the button was built to do this mechanically, but playing it safe. Was this bad information?
I have done a couple designs using the microprocessor's internal pull up current sources. I haven't looked recently but my recollection was in the range of low hundreds of micro amps pull up.

In my first generation tuner I used gold plated PCB switch pattern with carbon button pucks to close the switch circuit. To reduce PCB cost I went to a screened carbon ink and metal dome switches for my second generation tuner.

In this second generation design I only had an issue with one switch behaving marginally. The on/off switch.... That switch had an additional pull-up current component, part of my power supply initial start up circuitry.

I fixed that one balky switch by incorporating a cycling pause of the microprocessor current source pull-up for just that one switch in software, so even if the press didn't read as a switch closure at first, when the pull-up current momentarily cycled off, it then switched reliably. 

In the years since I made that software tweak not one switch complaint from customers. The cheaper carbon ink switch contacts were fully reliable when shunting modest pull-up current.

JR 
Quote
Playing with this was fun. Cap is just precautionary. I found that when base of BC550 was left floating, my hand acted like a touch sensor and put it into oscillation, as well if M/C ground and PSU ground lose reference. Cap acts like a sort-of schmitt should anything get accidently disconnected (I had this image of a session getting ruined because my desk was buzzing).

Yessr, thank you. Only did it this way so each mc pin has current protection, which is probably redundant as protection is likely on-chip as well.

Good to know! But too late to change. :)
It's nice to be nice....

boji

Re: Bi-color leds and shift registers
« Reply #17 on: November 30, 2020, 01:33:16 AM »
Thanks again Ian and V.  As well JR! I think you're saying to not worry about button contacts.  :)


Last of the transistor buffer playing, as the shift regs have arrived. 

If the below is a bad idea, please let me know? Thank you!

« Last Edit: November 30, 2020, 06:13:50 PM by boji »

JohnRoberts

Re: Bi-color leds and shift registers
« Reply #18 on: November 30, 2020, 09:55:03 AM »
Thanks again Ian and V.  As well JR! I think you're saying to not worry about button contacts.  :)


Last of the transistor buffer playing, as the shift regs have arrived. 

If the below is a bad idea, please let me know? Thank you!


Simple but not very current efficient, how many will be in the design?

JR
It's nice to be nice....

boji

Re: Bi-color leds and shift registers
« Reply #19 on: November 30, 2020, 02:05:17 PM »
Quote
Simple but not very current efficient, how many will be in the design?

Thanks for looking. Approx 55, give or take.  If I move up to 150k on base resistors, it still functions fine and current draw is .016mA. Picked 20k because...well, long-ish wireruns at play and not running off batteries, plus illogical superstition that stronger cv means less chance for interference.

  Collector shows approx 5.4mA peak turn on, 7.6 for Emitter, depending on color.

Edit:  I am so overdue for getting comfortable with circuit sims.
« Last Edit: November 30, 2020, 02:31:52 PM by boji »


 

Related Topics

  Subject / Started by Replies Last post
1 Replies
2002 Views
Last post August 04, 2004, 07:52:49 PM
by volki
15 Replies
3850 Views
Last post August 23, 2004, 02:54:18 PM
by
8 Replies
11508 Views
Last post October 04, 2006, 06:16:19 PM
by Brad McGowan
1 Replies
1285 Views
Last post October 26, 2007, 03:28:34 PM
by CJ