74HC157 mux design problems

Thread Starter

jaygonzo

Joined Jan 29, 2018
17
Hi All,
I am designing a circuit with this mux and I ran into some problem.
My circuit is like this:
I am using this quad 2: 1 mux.
I have 3 signals from one uC_1 to control 3 relays and I have another uC_2 to read a temperature sensor.
When the sensor reaches a certain temperature this uC_2 sends a signal to shut down this 3 relays
so i am using a mux to mux the signals from this 2 uC.
The problem is the relays seems to switching continuously when connected.
I have E and S grounded.
IN: 2,5,11 and 14 (source 0)
OUT: 4,7,9 and 12 (Y0-Y3)
Appreciate if someone can find the fault.
//regards,Jay
 

WBahn

Joined Mar 31, 2012
26,145
It's virtually impossible for someone to find a fault in a system without the schematic for the system they are trying to find a fault in.

That would be true even with a complete verbal description, which yours is not.

As just one example, you say that you have E and S grounded. Wonderful... maybe. What the heck are E and S?

Also, is this any kind of homework or school project?
 

sghioto

Joined Dec 31, 2017
1,451
Looking over the data sheet briefly: "The 74HC/HCT157 is logic implementation of a 4-pole, 2-position switch, where the position of the switch is determined by the logic levels applied to S". You have S grounded so no control on "switch position". Edit: With S grounded all outputs will follow input levels on pins 2,5 and 11. Do you even really need to use this chip?
SG
 
Last edited:

WBahn

Joined Mar 31, 2012
26,145
Why are you using a MUX? You don't seem to be multiplexing anything.

Have you looked at the signals to see if they are flailing?

Where to the cathodes of the optoisolators go?
 

AnalogKid

Joined Aug 1, 2013
8,590
The schematic is very hard to read.

You should spread out things more so it is easier to see the signal paths between parts.
Power should flow from top to bottom.
Things like +5 V and +12 V symbols always point upward.
GND symbols ***always*** point downward. Always. It is an international standard. Always.
Signals should flow through the drawing from left to right.

NPN transistors used as open collector drivers should have the emitter pointing down and the collector pointing up. This helps straighten out the signal flow so it is readable by someone other than you.

Separate from that, you are using the outputs of the optocouplers as emitter followers. There needs to be pull down resistors from the emitters to GND to turn off the relay driving transistors.

Where do the inputs to the mux come from? Are they always connected?

Where do the cathodes of the optocouplers go to?

Without more of the circuit it is impossible to say what is wrong. Also, please explain more clearly what the circuit is doing that is incorrect.

ak
 
Last edited:

Thread Starter

jaygonzo

Joined Jan 29, 2018
17
The schematic is very hard to read.

You should spread out things more so it is easier to see the signal paths between parts.
Power should flow from top to bottom.
Things like +5 V and +12 V symbols always point upward.
GND symbols ***always*** point downward. Always. It is an international standard. Always.
Signals should flow through the drawing from left to right.

NPN transistors used as open collector drivers should have the emitter pointing down and the collector pointing up. This helps straighten out the signal flow so it is readable by someone other than you.

Separate from that, you are using the outputs of the optocouplers as emitter followers. There needs to be phll down resistors from the emitters to GND to turn off the relay driving transistors.

Where do the inputs to the mux come from? are they always connected?

Where do the cathodes of the optocouplers go to?

Without more of the circuit it is impossible to say what is wrong. Also, please explain more clearly what the circuit is doing that is incorrect.

ak
 

sghioto

Joined Dec 31, 2017
1,451
I think I got a handle on this, maybe? Looks like the OP is using the 74HC157 as a buffer on the three relay drivers and then using the 2nd micro to control the enable input pin15 with the label G, (why G and not E, IDK). This way he can turn off all three relays with one input as described in post #1. But why? As I stated earlier you don't really need the mux. This can all be done directly with micros and software.
SG
 

Thread Starter

jaygonzo

Joined Jan 29, 2018
17
Hi
3 signals are coming from uC which is on another PCB to the pin 2,5 and 11 of the 157n chip . They are to switch the relay.
I have another uC which is on another PCB to shut all 3 relay with one signal. The 2 PCBs are connected via on 10 pin contact and the other by 4 pin contact.
Look at the function table for the chip.
 

Thread Starter

jaygonzo

Joined Jan 29, 2018
17
I think I got a handle on this, maybe? Looks like the OP is using the 74HC157 as a buffer on the three relay drivers and then using the 2nd micro to control the enable input pin15 with the label G, (why G and not E, IDK). This way he can turn off all three relays with one input as described in post #1. But why? As I stated earlier you don't really need the mux. This can all be done directly with micros and software.
SG
 

Thread Starter

jaygonzo

Joined Jan 29, 2018
17
Hi,
I think you understand my point here. I want to turn off the the 3 relays from the first uC and from the second uC : I can turn off all 3 relays by one just setting the Enable to HIGH. By this all 3 relays turns OFF.
My problem is the relays seem to switching ON/OFF continuously when the connect the circuit.
//regards,Jay
 

sghioto

Joined Dec 31, 2017
1,451
My problem is the relays seem to switching ON/OFF continuously when the connect the circuit.
//regards,Jay
Then the outputs from the micro must be switching HI and LO somewhere. Again where are the cathodes of the 4N35 connected and why are they not connected directly to ground?
SG
 

sghioto

Joined Dec 31, 2017
1,451
Hi
3 signals are coming from uC which is on another PCB to the pin 2,5 and 11 of the 157n chip . They are to switch the relay.
I have another uC which is on another PCB to shut all 3 relay with one signal. The 2 PCBs are connected via on 10 pin contact and the other by 4 pin contact.
Look at the function table for the chip.
Yes I have seen the function table. Again why can't the signal from the second micro be connected to the first micro and write the software to turn off all three? And why are you double posting when replying with a quote?
SG
 
Last edited:

dl324

Joined Mar 30, 2015
11,516
My problem is the relays seem to switching ON/OFF continuously when the connect the circuit.
Either they are or they aren't. Are all three relays switching?

Use a scope to probe the signals driving the relays. Start with the transistors and work backwards until you determine where the undesired triggering is coming from.

What type of supply bypassing do you have? What is the coil resistance?
 
Top