Multiplexer to retain the value sent to channels

Status
Not open for further replies.
Hi, community!

I've recently tried to use 74HC4051 multiplexer in order to control my 6 LEDs (let's call the like this) with just 4 outputs from Teensy 3.6. So I am sending signals from Teensy to Mux.
The test went successfully, but there's one thing I wasn't aware of. The Mux doesn't retain the values sent. E.g:

Each of my LEDs is ON when the HIGH signal is sent, and is OFF when LOW signal is sent.
If I send the HIGH value to my first LED - it is ON, but as soon as I change the channel on Mux to address my second LED, the first LED goes OFF.

I need to be able to retain values sent to LEDs until the LOW signal is sent to them. Is there a way to achieve this with the Mux? Or do I need to add anything to my chain?
 
Most people wouldn’t recommend a multiplexer for controlling LEDs, while it is possible and I’ve done it, it’s not the best device to do it. That being said, while the 4051 is not latchable if you update the LEDs fast enough it will look like they are all on even though in reality that’s not the case. Your best option for a small number of LEDs would be to use a shift register without adding much overhead to your existing program, but if you need a large number of LEDs shift registers aren’t the best option.
 
Hi, vjmuzik! Thank you for the reply!

Most people wouldn’t recommend a multiplexer for controlling LEDs, while it is possible and I’ve done it, it’s not the best device to do it. That being said, while the 4051 is not latchable if you update the LEDs fast enough it will look like they are all on even though in reality that’s not the case. Your best option for a small number of LEDs would be to use a shift register without adding much overhead to your existing program, but if you need a large number of LEDs shift registers aren’t the best option.

To be honest, I've tried to simplify the schema and probably confused you. In reality the mux is connected to Opto-Triacs, each of them in its turn is connected to a TRIAC, which controls EL Wire. To make it simpler, mux is controlling the Gate on TRIACs. When mux sends HIGH value, the TRIAC is opened and the current flows through the EL Wire

What do you mean by "latchable"? What I really want to avoid is to have an endless loop in my program which goes over all the gates and sends their real value every millisecond over the 6 mux channels.
The shift register you are referring, does it have a possibility to retain the sent value on its own? Or is it at all not technically possible?
 
I likely haven't thought it through... but I thought you connect a sink or source to the common side and switch the mux connections when needed.

...don't bother to explain if this is nonsense. I just don't like shift registers and thought it might be an option.
 
If you choose to build stuff with common buses it’s really easy to get a large I/O amount with a relatively small number of pins needed. Even though common buses have died off in favor of serial it’s still a good option for fast I/O that really adds low overhead to your program since they have high MHz versions of most 8 bit bus chips. For example, with 17 microcontroller pins you can connect 1024 buttons and 1024 LEDs that can all still be run in real-time very easily and with minimal programming. If anyone is interested in the example circuit that I speak of I can take a picture of the PCB and the schematic for it.
 
Hi, guys! I was able to accomplish my task with the shift register 74HC595. It perfectly latches the values. Everything as I need.
Thank you very much!
 
Status
Not open for further replies.
Back
Top