GroupDIY

General Discussions => Truth Table => Topic started by: boji on November 20, 2020, 06:13:13 PM

Title: Bi-color leds and shift registers
Post by: boji 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.
Title: Re: Bi-color leds and shift registers
Post by: volker 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.
Title: Re: Bi-color leds and shift registers
Post by: ruffrecords 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
Title: Re: Bi-color leds and shift registers
Post by: boji 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:
(https://i.imgur.com/rmvfVjl.jpg?1)



Title: Re: Bi-color leds and shift registers
Post by: JohnRoberts 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 (https://groupdiy.com/index.php?topic=75407.msg970750#msg970750)


JR


 
Title: Re: Bi-color leds and shift registers
Post by: boji 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.

Title: Re: Bi-color leds and shift registers
Post by: ruffrecords on November 21, 2020, 06:54:29 AM
How many LEDs per module?

Cheers

Ian
Title: Re: Bi-color leds and shift registers
Post by: JohnRoberts 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 
Title: Re: Bi-color leds and shift registers
Post by: mskeete on November 21, 2020, 01:24:08 PM
Just out of interest, which buttons are you using?
Title: Re: Bi-color leds and shift registers
Post by: boji 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
Title: Re: Bi-color leds and shift registers
Post by: boji 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.

(https://i.imgur.com/nWy7SIp.jpg?1)
Title: Re: Bi-color leds and shift registers
Post by: ruffrecords 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
Title: Re: Bi-color leds and shift registers
Post by: volker on November 28, 2020, 08:22:31 AM
Muntzing some stuff (https://abload.de/img/asdfqpkwv.jpg).

- 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 (https://i.stack.imgur.com/6SrbG.png) would be the common way of doing it.
Title: Re: Bi-color leds and shift registers
Post by: boji 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. :)
Title: Re: Bi-color leds and shift registers
Post by: ruffrecords 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
Title: Re: Bi-color leds and shift registers
Post by: boji 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.
Title: Re: Bi-color leds and shift registers
Post by: JohnRoberts 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. :)
Title: Re: Bi-color leds and shift registers
Post by: boji 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!

(https://i.imgur.com/P1ZcwDq.jpg?1)
Title: Re: Bi-color leds and shift registers
Post by: JohnRoberts 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!

(https://i.imgur.com/uIeMvQI.jpg?1)
Simple but not very current efficient, how many will be in the design?

JR
Title: Re: Bi-color leds and shift registers
Post by: boji 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.
Title: Re: Bi-color leds and shift registers
Post by: boji on November 30, 2020, 02:43:25 PM
Vbe(on) minimum 580mV?  Am I reading that right?

Obviously it's taking much less to switch on.

(https://i.imgur.com/5Os2BTG.jpg?1)
Title: Re: Bi-color leds and shift registers
Post by: ruffrecords on November 30, 2020, 04:04:10 PM
Transistors are turned on (saturated) by base current. The actual Vbe depends on the saturated collector current - see the VBe sat entry.

Cheers

Ian
Title: Re: Bi-color leds and shift registers
Post by: boji on November 30, 2020, 04:15:00 PM
Duh. What would I do without you guys eyes-n-brains...Thank you!

I ASSume because they leave the minimum blank, any microcurrent value that will get the leg to show proper voltage will do the do.



Title: Re: Bi-color leds and shift registers
Post by: squarewave on November 30, 2020, 04:21:30 PM
At 5ma you don't need the transistors. And I don't see how you're going to do 55 leds with one micro. You need an LED driver or maybe just an I/O expander if it has enough power (although long runs of clock and data could be an issue). Then just do resistors from supply to each expander output pin with the LED across the output pins. The rest is software. Drive one output high and the other low to get one color and then swap high / low for the other.

For lots of LEDs a mutliplexing IC is really the only sane way to go but it's not clear how that would work with bi-color LEDs.
Title: Re: Bi-color leds and shift registers
Post by: boji on November 30, 2020, 04:46:36 PM
Hi SW! Missed your input!

Quote
At 5ma you don't need the transistors. And I don't see how you're going to do 55 leds with one micro.
Well, I've not settled on a led yet. Still believing some may require standard 20mA.  But wow yeah, these particular ones are efficient.  Mega has about 60 available pins, so two of them would suffice.
 Edit:more like ~190 pins without plexn'...

Quote
maybe just an I/O expander
it's not clear how that would work with bi-color LEDs.
Now that shift registers have arrived going to try to incorporate some hex inverters to see if I can minimize pincount as you suggest, I'm just not that strong at writing code for IC's. Perhaps the inverters will provide the buffering for leds as well, so to omit the transistors.
Title: Re: Bi-color leds and shift registers
Post by: ruffrecords on November 30, 2020, 05:39:05 PM
Duh. What would I do without you guys eyes-n-brains...Thank you!

I ASSume because they leave the minimum blank, any microcurrent value that will get the leg to show proper voltage will do the do.

What you normally do, when operating a transistor as a switch,  is to ensure the circuit provides sufficient base current to saturate it. For worst case design you assume that when saturated, beta drops to no more than 20. You know the rail voltage, you know Vbe (sat) and the base current required; the rest is just ohms law.

Cheers

Ian
Title: Re: Bi-color leds and shift registers
Post by: boji on December 01, 2020, 07:04:51 PM
Maybe these will fit the bill since they can drive led's:
https://www.ti.com/lit/ds/symlink/pcf8574.pdf?ts=1606793008066

Would need quite a few chained together tho.
Much to learn.

(https://i.imgur.com/e5f5q7k.jpg?1)
Title: Re: Bi-color leds and shift registers
Post by: squarewave on December 02, 2020, 12:40:06 AM
Yeah that looks like it could work. I2c is nice in this case too because you can just connect up to 8 ICs to a 7 conductor bus and then just select the IC you want to listen to your clock and data by playing the right chord on the 3 address pins. So you would only need 5 microcontroller pins for 8 ICs for a total of 32 bi-color LEDs or 64 regular LEDs. Shielded CAT6 could probably make it a meter or so with the right clock speed and termination resistors.
Title: Re: Bi-color leds and shift registers
Post by: boji on December 05, 2020, 04:52:40 AM
Square or anyone else care to recommend a trusted I2C expander?  PCA9548A (https://www.ti.com/lit/ds/symlink/pca9548a.pdf)  looks like a candidate.

Reason is I found the MCP23017 (https://ww1.microchip.com/downloads/en/DeviceDoc/20001952C.pdf).


Thanks SW for the repeated I2C advocacy.  Hope switching between groups won't be very difficult. I imagine it will be about cycling I2C bus addresses on and off during state changes, much like clock latches.

Quote
Shielded CAT6 could probably make it a meter or so with the right clock speed and termination resistors.
yessr. thanks
Title: Re: Bi-color leds and shift registers
Post by: boji on December 08, 2020, 06:35:35 PM
FWIW:  I/O expanders bit shift to select, as will likely I2C multiplexer.  For PCA switching, this function simplifies:
Code: [Select]
void chipselect(uint8_t i) {
  if (i > 7) return;
 
  Wire.beginTransmission(PCA_ADDR_1);  //1 of 8 I2C bus addresses
  Wire.write(1 << i);                  //1 of 8 Pin expander chips on given I2C bus
  Wire.endTransmission(); 
}


So after setup, naming chips, setting pinstates and starting I2C, switch in expanders as needed:
Code: [Select]
chipselect(1); // prep to test leds I/O expander 1
   
  for(int i = 0; i <=15; i++) {
    mcp1.digitalWrite(i, HIGH);
    delay(200);                     
    mcp1.digitalWrite(i, LOW);     
    delay(200);             
}

chipselect(2);//switch and prep

  for(int i = 0; i <=15; i++) {
    mcp2.digitalWrite(i, HIGH);
    delay(200);                     
    mcp2.digitalWrite(i, LOW);     
    delay(200);             
}

And so on, ultimately providing up to 512 available sink/source pins over three wires. Neat!
Title: Re: Bi-color leds and shift registers
Post by: squarewave on December 08, 2020, 07:08:13 PM
I realize you're just fiddling but I cannot stop myself from telling people never use delay(). Even for fiddling don't do it. Delay makes it impossible to do more than one thing at a time. Your code will not be reusable.

Instead, loop continuously and compare the current time to the expiration time of whatever event. When the expiration time is exceeded you process the event and go back to looping.
Title: Re: Bi-color leds and shift registers
Post by: boji on December 14, 2020, 07:48:38 PM
Indeed, thanks SQ!
Title: Re: Bi-color leds and shift registers
Post by: boji on December 27, 2020, 05:33:02 PM
Happy Holidays everyone.  I've seen address assignment of I2C chips done both ways as shown below. Do you have a preference and if so, why? 
Note for B, resistors are left out or included so to define assignment, whereas for A, resistors are included no matter the HEX value.

(https://i.imgur.com/ITKS9O7.jpg?1)

B in layout:
(https://i.imgur.com/jEXjaNe.jpg?1)

Title: Re: Bi-color leds and shift registers
Post by: boji on December 27, 2020, 10:07:38 PM
Unless otherwise directed, going to go with B as it seems pretty straightforward.
Title: Re: Bi-color leds and shift registers
Post by: abbey road d enfer on December 28, 2020, 12:46:18 AM
Happy Holidays everyone.  I've seen address assignment of I2C chips done both ways as shown below. Do you have a preference and if so, why? 
I vote for B, since I don't like having Vcc (or Vdd) distributed to too many places without protection.

Quote
Note for B, resistors are left out or included so to define assignment, whereas for A, resistors are included no matter the HEX value.
Not necessarily.
Title: Re: Bi-color leds and shift registers
Post by: boji on December 28, 2020, 04:24:43 AM
Thank you Abby. B it is.

Quote
Not necessarily.
Think I understand, because Vcc could be 3.3 or perhaps lower in some scenarios.
Title: Re: Bi-color leds and shift registers
Post by: boji on January 13, 2021, 04:17:56 AM
First time digital project, about to send out for PCB's.  If anyone has a free moment, wouldn't mind glancing over the attached skiz in case I missed something obvious? Thank you much!

Title: Re: Bi-color leds and shift registers
Post by: boji on January 13, 2021, 04:18:47 AM
Layout attached. 
I2C resistors / pads used depending on mux bus & 1/4 PCBs.
Title: Re: Bi-color leds and shift registers
Post by: squarewave on January 13, 2021, 10:36:18 AM
I don't see anything obviously wrong but I do have two possibly minor concerns.

One is that it seems to me that part of the benefit of using an I/O expander is that you can put it where the devices you're driving are. But in this case you're going to have potentially long control cables? Just brainstorming here but my first thought would be to make a little daughter board with one I/O expander on it and that can be plugged into a board that has relays or LEDs or whatever. Then just run a little bit of two conductor for the low current I2C control signal.

Or, if you do it the way you have it layed out, what is the ground plane situation? What voltage are the relays? If you have large currents going through those transistors, it might be desirable to have a decent ground plane below (or above) those lines to the transistors with a really good ground wire to DGND running right next to (or loosely twisted around) the relay supply wire. Remember ground follows signal. That is super important here since you're delivering currents out in a distributed fashion.
Title: Re: Bi-color leds and shift registers
Post by: boji on January 13, 2021, 01:36:54 PM
Thanks for feedback SW.

Quote
you're going to have potentially long control cables?
Yeah I struggled with this decision but perhaps concerns are unfounded. Figured a bundle of shielded i/o wires are better than having a 'digital' pcb in each bucket (right under unbalanced fader lines) chunking away 24/7.  I agree it would be much simpler to put extenders near the i/o endpoints. Looking for a slimline case to shield pcb's, but finishing is becoming more important than anything at this point. :/

Went so far as to order some I2C balanced extenders to test, but they haven't arrived yet.

Quote
Or, if you do it the way you have it layed out, what is the ground plane situation?
5v and Gnd planes included, quite objectively to drain those transistors and pull up button sensing i/o :)
Cut them out for sake of picture clarity-- oops

Quote
might be desirable to have a decent ground plane below (or above) those lines to the transistors with a really good ground wire to DGND running right next to (or loosely twisted around) the relay supply wire.
Yessr.  Pulldown/debouncing circuits for relays are onboard each channel card that supplies 12v, and sinks most of it.  I believe as long as m/c pcb's are tied to console dcom, max draw is 0.6mA @ ~3v per relay cv pin.

I should have put a dotted line around that relay buffer circuit on the previous page, they are already installed in each channel/group cards. The logic pcb only sinks cv, not the whole relay loop.

There are better ways to have implemented this whole thing, that's for sure. Live and learn.
Title: Re: Bi-color leds and shift registers
Post by: squarewave on January 13, 2021, 02:23:20 PM
Just to be clear, so relay current is returned on the cable shield?
Title: Re: Bi-color leds and shift registers
Post by: boji on January 13, 2021, 04:24:12 PM
Quote
Just to be clear, so relay current is returned on the cable shield?

Relays are normally energised while unmuted/unsolo'd. They return to dcom via the relay daughter boards housed within each of the channel/group cards (no current on i/o pins). 

When cv pins on daughter boards are pulled low via i/o cable, the relays de-energise, and 'digital' voltage source returns over i/o cables to logic pcb. BC550 emitter delivers about 900uA to pour.

Edit:  Going to assume then max draw (all buttons in) pulls about 14mA total per bucket. Probably didn't need the transistors, as led's pull far more directly off their respective i/o... ::)

Buffers for nothing...when BC chips are free. :-[

Title: Re: Bi-color leds and shift registers
Post by: squarewave on January 13, 2021, 07:05:30 PM
They return to dcom via the relay daughter boards housed within each of the channel/group cards (no current on i/o pins).
So supply for the relays is delivered by the control cable but returns to the power supply by a completely different "dcom" path. That's not ideal because sudden changes in current will emit an electromagnetic field that could invoke currents in nearby high impedance and / or high gain circuitry. For example you could get spurious digital events like you engage / disengage a relay and a bunch of LEDs flip erroneously. If return followed signal, the electromagnetic fields would cancel and that wouldn't happen. The caps on the transistor bases will probably slow things down enough that it will be ok but you might try to not run those lines next to digital lines if possible.
Title: Re: Bi-color leds and shift registers
Post by: boji on January 13, 2021, 07:56:22 PM
Quote
So supply for the relays is delivered by the control cable but returns to the power supply by a completely different "dcom" path.
Thanks again.

Just checked current draw of com pin of the relay sub-pcb.
Active pins are 12v, dcom, and cv.  When relays are energised, 23mA goes to dcom at console backplane, and source follows sink.
When cv is made active, relay sub-pcb dcom pin current drops to almost zero. So it is as you say, cv does becomes the only return path during relay de-energising. So both dcom and cv should physically follow source, even if it means extending source however far to cv's interface?

Quote
you might try to not run those lines next to digital lines if possible

Indeed, relay cv definitely gets their own shielded control cable (2 per bucket), distinct from button sensing & illum cable runs.
Title: Re: Bi-color leds and shift registers
Post by: squarewave on January 13, 2021, 09:40:01 PM
Actually I was wrong about the direction of current in my previous description. I see that your relay transistors are current sinks and not current sources. Of course the direction of current doesn't matter but because I'm not sure I understand the identifiers you're using to describe your circuit, I will just restate my concern:

If the current used to power relays is not supplied by conductors physically adjacent to the conductors sinking that current, then the "source follows sink" rule is not satisfied. And because all 8 of the conductors in what appear to be RJ45 jacks are occupied by current sinking conductors, the only conductor in that cable bundle that could supply the source current would have to be the cable shield. Meaning unless the cable shield is supplying the 12V used to power the relays (and it most certainly should not), then it must be coming from somewhere else and that is not ideal. But again, it's not a show stopper because the caps on the transistor bases will limit the intensity of the magnetic fields generated when a relay switches on.
Title: Re: Bi-color leds and shift registers
Post by: boji on January 13, 2021, 09:50:17 PM
Quote
I'm not sure I understand the identifiers you're using to describe your circuit
Perhaps I should make a block diagram as I'm probably not using the correct descriptive terminology.  Thanks for your time, still good food for thought.

Title: Re: Bi-color leds and shift registers
Post by: boji on January 14, 2021, 05:52:09 AM
Quote
the only conductor in that cable bundle that could supply the source current would have to be the cable shield.
I think this is where the confusion lies, as no positive voltage needs to get sent out of the M/C logic pcb to drive relays. Their 12v source comes from the channel pcb's. The logic pcb only serves to sink cv so to disengage relays, and both 12v and 5v sources eventually share dcom bus.

I do see your point about proper EMI practice.  :o  Unfortunately don't know of any other way to satisfy it except to possibly take the cv return going into logic pcb (racked under desk) back out of rack to relay sub-pcbs.

As is, the plan was to join the four logic pcb dcom's together within the rack, and then send it over one cable back to the dcom bus bar at the end of the desk.

Mostly a redraw, but hope it clarifies:

(https://i.imgur.com/GObmq7K.jpg?1)


One of the relays at the front of channel / group pcb's:

(https://i.imgur.com/RWJ5rvx.jpg?1)
Title: Re: Bi-color leds and shift registers
Post by: squarewave on January 14, 2021, 11:53:26 AM
Oh, that's no problem. I thought those transistors were sinking the current of the relay coil. But if you're just using them as an inverter (not sure why that's necessary since I would think you could just change the code but whatev) to send a control voltage then there's no significant currents over those cables. Carry on.
Title: Re: Bi-color leds and shift registers
Post by: boji on January 14, 2021, 03:18:49 PM
Quote
you could just change the code
True. They even have a provision to invert a side's pins all in one go.

Quote
Carry on.
/Salute
PCB's ordered.
Title: Re: Bi-color leds and shift registers
Post by: boji on February 19, 2021, 05:26:05 PM
Is there ever a valid use for delay()?

For example

Code: [Select]
while (!Serial) delay(500); //wait 1/2 second for console voltages to stabilize

I'm figuring that the pausing of code is desirable since the code ought not proceed until serial is available, which ensures debugging notifications.
Title: Re: Bi-color leds and shift registers
Post by: squarewave on February 19, 2021, 07:44:06 PM
Is there ever a valid use for delay()?
I would never use delay(). Your code is no different from just:

  while (!Serial) {}

But I wouldn't do that either. And I assume !Serial is pseudo code. There's probably a way to detect if the serial port is ready by checking some register of some sort.