Circuit to provide a high pulse on closed and a high pulse on open utilizing a SPST switch and XOR gate for a Control Panel

Thread Starter

O1134

Joined Apr 29, 2021
7
Hello, this is my first post, so hopefully from all of the reading I have done so far, I can provide the necessary information for all you smart folks out there.
BACKGROUND: Recently purchased a new travel trailer that has a main switch control panel. This has a mixture of momentary and spst switches for various lights and equipment. The spst switches all illuminate and the momentary ones obviously do not. Interestingly all 4 of the momentary switches control lights outside of the unit that I cannot see and have to go out at night to tell if they are on or off. I tried replacing the momentary switches with the spst, but discovered that the trailer has something like a latching relay setup so you have the click the spst twice to get the lights to switch on, switch off (it is not an option to replace this latching setup as it is internal to the master control box of the unit)

I have been reading through a lot of posts here and I think I have found something that would work for me. The circuit utilizes a single XOR gate in the CD40470B which contains 4 in the standard IC, so to replace 4 switches so I could use one IC and the supporting discrete components, but I have a couple of questions based on this circuit. I have referenced the link here and the specific post is by Crutschow:

Pulse on closed circuit and on open again. (converting toggle switch to momentary) | All About Circuits

Here's the LT spice simulation of the circuit I suggested.
The relay coil rating must be whatever the power supply voltage is. Its contacts are not shown.
Power and ground to U1 are not shown.
The six unused inputs in the U1 package must be grounded.

View attachment 138954

1. This circuit is based on 5v and my source would be 12v. The XOR IC looks to have an operating range that will work but I wanted to ask just in case there was any additional consideration there or with the discrete components.
2. It is my understanding that the duration of the pulse is controlled through the combination of R1 & C1. Is there a way to easily make this adjustable or is it a matter of determining what the optimum pulse duration is for the latching setup and calculate the R1 and C1 value to support that?
3. This circuit uses a 2N3904 transistor to control the relay. I'd like to replace this setup with a high power transistor such as the TIP120 so that I can control larger loads if needed (obviously with a heat sink). Are there considerations I should consider when using a transistor to switch the load rather than a relay?

I not an engineer but I have have a compute science background and I have experience creating simple circuit boards and projects etc.

Your help is greatly appreciated and please let me know if you have any questions.

Thanks.
 

crutschow

Joined Mar 14, 2008
34,201
1. This circuit is based on 5v and my source would be 12v. The XOR IC looks to have an operating range that will work
Yes it should work fine on 12V.
But to minimize the effects of any transients in from the vehicles electrical system I would put a 10 ohm resistor in series with the power to the IC with a 100µF capacitor to ground.
2. It is my understanding that the duration of the pulse is controlled through the combination of R1 & C1. Is there a way to easily make this adjustable
You can use a trimmer type potentiometer in place of R1.
3. This circuit uses a 2N3904 transistor to control the relay. I'd like to replace this setup with a high power transistor such as the TIP120 so that I can control larger loads if needed (obviously with a heat sink). Are there considerations I should consider when using a transistor to switch the load rather than a relay?
Since the TIP120 is a Darlington compound transistor, the IC should be able to readily drive it.
Note that a Darlington has a voltage drop of about 1-2V to the load.
If that's a problem with either the drop or the dissipation from that, you could use an N-MOSFET in place of the TIP120, which has a voltage drop equal to its on-resistance times the load current.
If you get a MOSFET with a sufficiently low on-resistance such that the power dissipated from the load current is less than a watt, then it shouldn't need a heat-sink.
 
Last edited:

Thread Starter

O1134

Joined Apr 29, 2021
7
Yes it should work fine on 12V.
But to minimize the effects of any transients in from the vehicles electrical system I would put a 10 ohm resistor in series with the power to the IC with a 100µF capacitor to ground.
You can use a trimmer type potentiometer in place of R1.
Since the TIP120 is a Darlington compound transistor, the IC should be able to readily drive it.
Note that a Darlington has a voltage drop of about 1-2V to the load.
If that's a problem with either the drop or the dissipation from that, you could use an N-MOSFET in place of the TIP120, which has a voltage drop equal to its on-resistance times the load current.
If you get a MOSFET with a sufficiently low on-resistance such that the power dissipated from the load current is less than a watt, then it shouldn't need a heat-sink.
Thanks for the feedback. Awesome!
I figured what you had posted before would do the job with a few minor tweaks.
 

Thread Starter

O1134

Joined Apr 29, 2021
7
I have been reading about the N-MOSFET and how to choose the right one to use. It looks like there are several considerations when making a choice:
1. Gata-Source threshold voltage: I need to select a MOSFET that has a min and max operating voltage that will work with the XOR output from the CD40470B
2. The Drain-Source on resistance: As you mentioned, choose a MOSFET whose lowest Rds(on) values occur at or near the ideal logic high voltage value and do not decrease with higher Vgs values. To determine this, I would need to know the typical logic high voltage from the CD4070B XOR gate when used in a 12v circuit
3. The circuit already contains a current limiting resistor between the I/O pin and the gate of the MOSFET, but in the reading it also says to add a pull-down resistor to prevent a floating gate i.e. 10K resistor to ground.

One last thing, can you recommend a reliable source to order all these components?

Thanks for all your help.
 

AnalogKid

Joined Aug 1, 2013
10,971
1. With nearly 12 V available from the gate output, just about any power MOSFET will work. Most have a max Vgs of 20 V and a recommended Vgs of 10 V for the lowest Rdson, so 11-12 V is fine.

2. Standard 4000 series CMOS gates have output high and low voltages that are very close to the rails when very lightly loaded, as when driving other CMOS parts of MOSFET gates. The XOR gate outputs will be above 11 V, more than enough to turn on firmly just about any "standard" power MOSFET.

3. For completeness and clarity, please post to this thread the schematic you are referencing.

4. Do you have any information on the max current through the FET(s)?

One last thing, where are you located?

ak
 

crutschow

Joined Mar 14, 2008
34,201
in the reading it also says to add a pull-down resistor to prevent a floating gate i.e. 10K resistor to ground.
That's needed if there's a possibility that the MOSFET gate will experience an open-circuit, and that would only happen if there's a miswire in the circuit.
 
Last edited:

Thread Starter

O1134

Joined Apr 29, 2021
7
1. With nearly 12 V available from the gate output, just about any power MOSFET will work. Most have a max Vgs of 20 V and a recommended Vgs of 10 V for the lowest Rdson, so 11-12 V is fine.

2. Standard 4000 series CMOS gates have output high and low voltages that are very close to the rails when very lightly loaded, as when driving other CMOS parts of MOSFET gates. The XOR gate outputs will be above 11 V, more than enough to turn on firmly just about any "standard" power MOSFET.

3. For completeness and clarity, please post to this thread the schematic you are referencing.

4. Do you have any information on the max current through the FET(s)?

One last thing, where are you located?

ak
Thanks for the answers to #1 & #2.
#3: The schematic was listed in the original post but here it is for your reference:
upload_2017-11-8_21-4-17-png.138954 (777×720) (allaboutcircuits.com)
#4: I am unable to determine the exact load through the FET but I do know it is less than 3A as there is an inline fuse on that line behind the control panel. Hope that helps.

Lastly, I'm in the midwestern US (the camper was probably the giveaway..)

Thanks for your feedback.
 

Thread Starter

O1134

Joined Apr 29, 2021
7
Yes it should work fine on 12V.
But to minimize the effects of any transients in from the vehicles electrical system I would put a 10 ohm resistor in series with the power to the IC with a 100µF capacitor to ground.
I have all the components to build this circuit but one last question (I hope). You mentioned that I should add a resistor in series and a capacitor to ground in the power to the IC. Is the diagram below what you mean? (I have removed all other components for clarity)
Thaks again for all your help
 

Attachments

Thread Starter

O1134

Joined Apr 29, 2021
7
Disconnect the + end of C1 from the 12 V. Connect it to IC pin 14.

ak
I created the circuit on a breadboard first and it works exactly as designed but I didn't fully understand the switch placement and how this particular circuit uses a pull-up resistor. The SPST switch that I have to use has an LED that switches on when the switch is in the closed position. In the current circuit, the switch has 0v across it when closed so while the circuit works, the led does not illuminate (which was the whole point of this project)
Is the change as simple as switching the existing components in to a pull-down configuration? I have attached a circuit diagram (omitting the components on the output side of the XOR) that shows how I think it should be wired. I also included the configuration of the switch so that you can see what I am trying to do.
Thanks again.
 

Attachments

Top