Relays and Multiplexing

Greetings Forum,
I am using an 8-channel multiplexer to control 8 x relays via an 8 x Darlington array. The state of each relay depends on the state of 8 x input signals fed into my Arduino (also via an 8-channel multiplexer). Here is my problem: If any of the input signals goes LOW the corresponding relay must be switched ON and be latched in the ON condition, irrespective of any future state of the input value. This relay must remain ON until the Arduino is reset. I know the probable solution lies in the use of some sort of flip-flop but there are so many different types available that it has boggled my brain. If someone would be kind enough to tell me which type will do the job I will purchase it and try it out. Thank you for your attention. Any responses will be greatly appreciated.
Regards, George Poulos

Schematic? Code? Without it it's impossible to give you a good solution.

I am using an 8-channel multiplexer to control 8 x relays via an 8 x Darlington array.

You can't do what you want with that setup. You want to use an addressable latch, a 74HCT259.

1 Like

Grumpy_Mike:
You can't do what you want with that setup. You want to use an addressable latch, a 74HCT259.

Thank you very much Grumpy_Mike. I have downloaded the data-sheet and at first glance it looks to be the ticket AND I can buy it locally ! Much appreciated. Regards.

Another alternative would be a tpic6b595. This would replace the multiplexer and the Darlington array. You would drive it differently, however, using shiftOut() instead of 3 address lines.

1 Like

using shiftOut()

Which is essentially three lines.

Grumpy_Mike:
Which is essentially three lines.

Indeed, one less pin than the addressable latch solution. But my suggestion was really about reducing the chip count rather than the pin usage.

Thanks PaulRB, shiftOut() is listed under "Advavced I/O" using "clocks" and such like. Hopefully I'll get there someday ...regards.

Grumpy_Mike:
You can't do what you want with that setup. You want to use an addressable latch, a 74HCT259.

Hi, I am doing something similar too.
But I have one question regarding the 74HCT259.

Base on the truth table:

is that mean the output pin state is base on "d"?
For example i want to set high for output 1, my input will be:

D = H
A0 = L
A1 = L
A2 = L

set output1 to low, input will be:

D = L
A0 = L
A1 = L
A2 = L

Am i right?

74HCT259 truth table.PNG

74HCT259 truth table.PNG

Almost correct. But in your example, you would be setting output 0, not output 1.

You would also need to use the LE line to "write" the data to the chip. So in fact 5 Arduino pins are needed. Tpic6c595 reduces this to 3 pins and removes the need for the uln chip to drive high current device like relay coils.

Well I think that shift registers are over used here on this forum. A shift register solution here relies on the software keeping the data and it will loose it on reset.