Author Topic: Need help finding an IC/circuit to latch only one output at a time.  (Read 2440 times)

0 Members and 1 Guest are viewing this topic.

Offline mikeylikesitTopic starter

  • Newbie
  • Posts: 2
  • Country: us
Hello all, first post.

I need help selecting an IC.  When I search DigiKey I get too many results because I don't know the name of what I need.

I have an old stereo with mechanical source select switches.  The audio runs right through them and the resultant sound quality is awful.  I plan to replace them with transistors and momentary buttons. 

I am looking for an IC that can take at least 5 momentary inputs and hold a corresponding output pin high until the next press, kind of like an XOR gate but with 5 inputs and 5 latched outputs.  I have tried to figure out how to use discrete gates and simple latches but that's a little above my ability, so I'm trying to find an IC to do the job.

Can someone recommend a specific part, or even just tell me what this thing is called?  I'd also be happy with a proposed schematic using discrete components.

Attached is a drawing of the circuit I'm planning.  When a button on the left is pushed, only the output directly across from it should remain on, the rest (including the one that was just on) should go off.  I don't especially care how it behaves when more than one are pressed at a time, or startup state, provided only one output at a time is ever held high.
 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4051
  • Country: gb
Re: Need help finding an IC/circuit to latch only one output at a time.
« Reply #1 on: November 13, 2017, 04:08:14 pm »
A SR Latch on each output would do.

Switch 1 to Set 1, Reset 2, 3, and 4
Switch 2 to Set 2, Reset 1, 3, and 4
... and so on ...

Might be a more elegant way though.

A register IC would work, but getting the clock pulse at the right time might be tricky.  Basically your buttons would be the data bus, but you would need to delay a few ms and then fire a pulse on the enable pin to latch the output.  Also need to wire the output enable to ON.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19523
  • Country: gb
  • 0999
Re: Need help finding an IC/circuit to latch only one output at a time.
« Reply #2 on: November 13, 2017, 04:09:40 pm »
BJTs will sound even worse than switches because they're very non-linear. J-FETs will be better but the gates will need to be biased below the drain-source voltage, to turn them off.

Analogue switch ICs can be purchased for this sort of thing. Presumably you want to switch one input between five different possible signals? A 1:8 analogue multiplexer, such as the 74HC4051, will do that. To get the latching action you need, a microcontroller could be connected to those switches, to generate the appropriate binary code for the multiplexer.

http://www.ti.com/lit/ds/symlink/cd74hc4051-ep.pdf
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Need help finding an IC/circuit to latch only one output at a time.
« Reply #3 on: November 13, 2017, 04:12:02 pm »
Use PSOC 4.


http://www.cypress.com/documentation/development-kitsboards/psoc-4-cy8ckit-049-4xxx-prototyping-kits


Not only give you the logic but also the analog switches to gate the audio.


Regards, Dana.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 5875
  • Country: de
Re: Need help finding an IC/circuit to latch only one output at a time.
« Reply #4 on: November 13, 2017, 05:38:39 pm »
Why not keep the original button system, but rewire it for DC signals to control analog switches?

 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Need help finding an IC/circuit to latch only one output at a time.
« Reply #5 on: November 13, 2017, 06:09:01 pm »
See attached.

Basically the control is by grounding with an open drain output
the audio channel of interest.

Code handles switch debounce and latch behavior.

You could use debouncer component, and analog on chip muxes, but would take
a more expensive part to route.


Regards, Dana.
« Last Edit: November 13, 2017, 06:13:57 pm by danadak »
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline eblc1388

  • Frequent Contributor
  • **
  • Posts: 394
  • Country: gb
Re: Need help finding an IC/circuit to latch only one output at a time.
« Reply #6 on: November 13, 2017, 06:31:21 pm »
Can someone recommend a specific part, or even just tell me what this thing is called?  I'd also be happy with a proposed schematic using discrete components.

This is one I drawn up years ago. 

The use of 4017 will ensure one and only one output is high.  The circuit works for 10 selections but fewer is OK. You can drive external transistors using a 10K resistors from Q0 to Q9 outputs. You can also use clock signal from another oscillator with a higher frequency.   
 

Offline eblc1388

  • Frequent Contributor
  • **
  • Posts: 394
  • Country: gb
Re: Need help finding an IC/circuit to latch only one output at a time.
« Reply #7 on: November 14, 2017, 08:41:22 am »
Just for fun I did a simulation on the above circuit.

In the simulation, U2 and U3 emulate user push button with the closing time at 200ms and 650ms respectively. CD4017 reset pin is fitted with a power ON reset circuit(C1/R2) to ensure 4017 Q0 is HIGH upon power On. The clocking to the CD4017 is a 1000Hz source. This is not critical. It can be any frequency between 1KHz and 20KHz.

At t=200ms, user pushes button U2. Output Q6 is turned ON six milliseconds later, as the outputs Q1..Q5 has each has to go high for one clock pulse. Therefore it is important that whatever circuit connects to these outputs will be driven high for period of one clock pulse as the 4017 cycles to the correct output. A higher clocking frequency will be better as the unwanted state can be as short as possible.  For example, a 1ms output pulse is not likely to pull ON a relay but will be bad for other applications.

Once Q6 is HIGH, it stays HIGH if there is no other user inputs or user releases the push button. At t=650ms, user pushes U3 button. Q6 is immediately goes LOW, then Q7 goes high for one clock pulse, follows by Q8..Q9..Q0..Q1..Q2..Q3...until Q4 goes high and stays high. There is a 9x clock delay between Q6 goes low and Q4 goes high. Therefore the delay for the output to goes high can varies from one clock pulse to a maximum of ten clock pulses.
 

Online David Hess

  • Super Contributor
  • ***
  • Posts: 16615
  • Country: us
  • DavidH
Re: Need help finding an IC/circuit to latch only one output at a time.
« Reply #8 on: November 14, 2017, 05:19:51 pm »
I like Paulca's set-reset latch idea which can be made up with flip-flops which have set-reset inputs; some variation of a 7474 would be typical.  Drive the set and reset signals from the pushbutton switches through an array of diodes or transistors.

Eblc1388's idea is simpler however it steps through the undesired functions which may not be ideal.
 

Offline eblc1388

  • Frequent Contributor
  • **
  • Posts: 394
  • Country: gb
Re: Need help finding an IC/circuit to latch only one output at a time.
« Reply #9 on: November 14, 2017, 06:37:42 pm »
Eblc1388's idea is simpler however it steps through the undesired functions which may not be ideal.

That can be easily eliminated.

Feeds the outputs of 4017 to a octal transparent latch HC373, and connects the /CE of 4017 to that of the LE pin of HC373.

When the HC373 latch-enable (LE) input is high, the Q outputs follow the data (D) inputs. When LE is low(where 4017 is cycling through varies outputs), the Q outputs are latched at the logic levels of the D inputs.

« Last Edit: November 14, 2017, 07:15:55 pm by eblc1388 »
 

Offline mikeylikesitTopic starter

  • Newbie
  • Posts: 2
  • Country: us
Re: Need help finding an IC/circuit to latch only one output at a time.
« Reply #10 on: November 16, 2017, 04:20:38 pm »
Thanks everyone, so many great ideas!

I looked through my parts box and found a couple quad NAND gates, some N-FETs, and an 8 bit multiplexer, so I'm planning to basically combine the ideas of Hero999 and paulca, plus the diode array steering like David Hess mentioned, so I'll be like this:

pushbutton --> diode array -->  SR latches (one per multiplexer input) --> N-FET (to carry the audio path).

I would like to get a chip with analog switches like the 74HC4051 eventually, but I really enjoy completing a project with what I have on hand and not paying Digikey $13 to ship $8 worth of parts, so I'll just try to come up with a layout that works for the chip I have and one I could order, and socket it so I can change it out later.

I'll post some pictures when I finish the project.
 

Online macboy

  • Super Contributor
  • ***
  • Posts: 2254
  • Country: ca
Re: Need help finding an IC/circuit to latch only one output at a time.
« Reply #11 on: November 17, 2017, 03:15:45 pm »
After you figure out the control part, you need to address the actual audio switching.  You will not have success with cleanly switching audio signals with BJT transistors. A BJT acts like a current-controlled current source (with some current gain, the Hfe of the transistor). They won't work in this application.

You might have success with FETs. A FET acts as a voltage-controlled variable resistance. In this way, it can act as a switch for analog signals. Even easier, get some variation of an "analog switch" or "analog mux" IC, such as 4053, 4052, 4066, etc (different prefixes based on manufacturer: CD4066, 74HC4066 etc). These package up FETs along with the appropriate circuitry to drive them, and accept digital logic inputs to control everything. In either case, you need to realize that the FET isn't perfect, and its resistance will vary with the signal level. This will cause distortion, unless you take care to design out the effect of this variable resistance. In general, all that is needed is a low source impedance to drive the input of the FETs, and a high load impedance on the other side. Then the variation of resistance in the FET has virtually no effect on the signal level.  This means, buffer each input with an op-amp as a unity gain follower, and send the outputs of those to the inputs of the analog MUX IC (or discrete FETs if you choose). The output of the MUX/FETs should then connect to another opamp as a unity gain follower. You'll want to AC couple (DC block) at some point too, as some offset is likely to be introduced.

The above is OK if you want a completely solid-state solution. I'd personally be tempted to use relays since they will negate the requirement for the additional opamps, and will have much less crosstalk. If looking at relays, be absolutely certain to use signal relays, (a.k.a. telecom relays), not power relays. They really are different, and a power relay will end up making bad connections after a while, if used for small signals.

 

Offline paulca

  • Super Contributor
  • ***
  • Posts: 4051
  • Country: gb
Re: Need help finding an IC/circuit to latch only one output at a time.
« Reply #12 on: November 17, 2017, 04:02:43 pm »
Would it be OTT to use switched opto isolators?  So the BJT just switches in the correct set of optos?
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Online macboy

  • Super Contributor
  • ***
  • Posts: 2254
  • Country: ca
Re: Need help finding an IC/circuit to latch only one output at a time.
« Reply #13 on: November 17, 2017, 09:07:41 pm »
Most optos have a BJT output transistor, so you haven't gained anything.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf