Bi-color leds and shift registers

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

boji

Well-known member
Joined
Jan 6, 2010
Messages
2,375
Location
Maryland, USA
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.
 
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.
 
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
 
Thanks for questions and ideas guys.

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

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.

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:
rmvfVjl.jpg




 
boji said:
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


 
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.

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

 
boji said:
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 
 
How many LEDs per module?

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

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.

out of interest, which buttons are you using?

https://www.nkkswitches.com/pdf/hbilluminated.pdf
 
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.

nWy7SIp.jpg
 
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
 
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.
 
Thanks to the both of you!

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

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


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?


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


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.


One diode should be enough if they don't sit a meter apart.
Good to know! But too late to change. :)
 
boji said:
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
 
In a big desk when you flip SIP, lots of relays can go over at once, which can cause a seriously big spike.

:eek: :eek:  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.
 
boji said:
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 
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. :)
 
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!

P1ZcwDq.jpg
 
boji said:
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!

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

JR
 
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.
 
Back
Top