Build a latching switch circuit A that can also momentarily close switch B?

Thread Starter

redeyedjim

Joined Jul 14, 2018
33
Hi - I am a hack at this stuff and could use some help :)

I am building a device that integrates a commercially available PWM frequency and duty cycle generator mini-board (e.g., one of these:





https://www.amazon.com/Eachbid-1Hz-150Khz-Frequency-Adjustable-Generator/dp/B07CG9VYDN ).

The above PWM generator outputs three different duty cycles. My device use one of these at a time, and includes a circuit to select an output.

What I want: the above PWM circuit always displays the last preset that was adjusted. When I switch from one preset output to another, I want to bump this display by momentarily closing the "-" contact for that preset, which will prompt the PWM display to change to match the chosen output. Due to the way the board is constructed I will probably need to solder individual leads to the three "-" tactile switch contacts to interact with the device. It's a complete hack and I'm open to a better idea, but even the hack would be worth it if it worked smoothly. I just don't know how to momentarily close the second contact.

Any suggestions on how to make this work? The simpler the solution, the better.

Thanks!
 

Thread Starter

redeyedjim

Joined Jul 14, 2018
33
Updated to add: I found this 555-based circuit here:

http://www.bowdenshobbycircuits.info/page9.htm

555 timer Mono stable (one shot) circuit:
Left circuit has a 6 second pulse width
Right circuit is ~1 second


I would use the circuit at right and connect it with individual, dedicated relays for each of the tactile switches I want to operate. So that's one very "hack-ish" way I can see to do this. I am open to better, more elegant a solution, as long as I can pull it off.
 

crutschow

Joined Mar 14, 2008
34,415
A 555 is a common way to generate such a delay, although since the delay is not critical, just a resistor, capacitor and MOSFET would likely work also, without the relay.
But, to do that, we would need to know the supply voltage(s), and the voltages from each side of the switches to common.
Can you post a simple diagram of the connections you want to make?
 

Thread Starter

redeyedjim

Joined Jul 14, 2018
33
Thanks for the reply.

This is the on/off and PWM selection circuitry for the device I'm building. The functionality I am trying to add via this request is minor but will be very helpful to the user. Here's my circuit, such as it is:



It's 12VDC throughout. I got tired of fighting EasyEDA, so imagine three dedicated DPDT relays instead of just the one SPST shown, etc.

Again, my goal is to alter the UI so that the duty cycle the PWM generator displays matches the (analog) selection made via a separate slider switch.

Thanks for your help!
 
Last edited:

Thread Starter

redeyedjim

Joined Jul 14, 2018
33
I missed my editing window, so I'll just add that you are correct and I would prefer to actuate the secondary circuit immediately, or with as little delay as possible. Thanks again for your help.
 

crutschow

Joined Mar 14, 2008
34,415
The above PWM generator outputs three different duty cycles. My device use one of these at a time, and includes a circuit to select an output.
When I switch from one preset output to another, I want to bump this display by momentarily closing the "-" contact for that preset, which will prompt the PWM display to change to match the chosen output.
This is what's confusing me.
What's the "circuit to select an output" duty-cycle?
How does this switch from one preset to the other if you don't press the "-" contact for that preset?
 

Thread Starter

redeyedjim

Joined Jul 14, 2018
33
This is what's confusing me.
What's the "circuit to select an output" duty-cycle?
How does this switch from one preset to the other if you don't press the "-" contact for that preset?
Sorry I wasn't clearer in my written explanation. Let me try again, as this PWM generation device doesn't work the way you or I might want it to.

The PWM generator outputs all three duty cycle signals simultaneously, on three separate pins {PWM1; PWM2, PWM3}. It has no internal mechanism to choose which output is selected - that is left for the end user to sort out externally.

The last duty cycle preset to be adjusted is the one that remains displayed on the screen.

I have three different duty cycle presets, and it's my intention to switch between them at will via a mechanical switch. This is how my prototype functions, and it works well for my needs. I just want to force the device's UI to follow my selector switch choice. Maybe I'm trying this from the wrong side, but this seems like the easier direction to approach from, as all three PWM outputs from the device are active simultaneously, so making, say, PWM2 active on the UI doesn't select its output from the device.

In the lower right corner of the schematic, there is a switch labeled "this is a 4 position slide switch". That is my mechanism for selecting which of the three duty cycle signals to use.

That's wordier, but hopefully also clearer? Let me know if I'm still unclear, or if I'm overlooking some obvious solution.

Thanks.
 
Last edited:

crutschow

Joined Mar 14, 2008
34,415
Okay, I think the bulb has lit and I now understand how it works. :)

Can you measure the voltage from each side the the (-) duty-cycle switch to the power supply common (negative) with power applied, both when pressed and when not pressed.
That will help tell me whether you can just use a MOSFET to mimic the switch operation.
 

Thread Starter

redeyedjim

Joined Jul 14, 2018
33
The hot side of the switch is 3.306V unpressed, and goes to ground (0.001V) when pressed. The opposite side remains grounded (0.001V) throughout.

So really, all I need is a circuit that momentarily goes to ground when triggered, then goes open and remains open until reset/triggered again.
 

crutschow

Joined Mar 14, 2008
34,415
The likely a small N-MOSFET such as a 2N7000 should work.

So the next question is, how do we generate the signal to trigger the MOSFET?
I understand you want to generate this signal whenever you move the slide switch(?).
Can you use a double-pole slide switch so we can use one pole to generate this signal?
Otherwise we need to know the change in voltage at the slide switch when it changes position.
 

crutschow

Joined Mar 14, 2008
34,415
Okay, so here's my take on circuit using 2N7000 MOSFETs to do what you want.
It requires 2 resistors, 1 capacitor, and 1 MOSFET for each position.

The LTspice simulation below shows that the associated PB switch turns on (connects to ground) for about 130ms when the slide-switch changes to that position.
If you need a longer time, you can increase the value of the capacitors, but I expect that value will be sufficient.

The 12V battery is the supply you have to power the circuit.

(The Rsim resistors and 3.3V supply are just to show the signal in the simulation and aren't needed in the actual circuit).

upload_2018-7-15_11-10-52.png
 

Thread Starter

redeyedjim

Joined Jul 14, 2018
33
Thank you!! That looks great! I just ordered some 2N7000s, which should get here tomorrow. I have some larger MOSFETs at hand - I have a dozen of these IRLB8721PBF 30V/60A MOSFETs (https://www.adafruit.com/product/355) - but nothing this small.

Thanks - I should have the parts on hand to build this tomorrow night, and will report back on the results. I'm in California, so realistically that probably means I'll have an update about ~36 hours from now. Thanks again for your help - I like this approach and think it will work very well for this little standalone PWM generator I'm putting together. :D
 

Thread Starter

redeyedjim

Joined Jul 14, 2018
33
True, but if they'll work for a proof of concept, I'll wire one up and give it a try.

Off to do just that - thanks! I'll post an update shortly.
 

Thread Starter

redeyedjim

Joined Jul 14, 2018
33
Hmmm. Unfortunately I am not getting the expected results with the POC - although I see a 0V result on the Drain from the transistor, I can't seem to translate that into making my display switch presets. I have confirmed again that the display changes presets as expected when I manually connect a ground lead to the powered side of the switch, so there may be something bad in my breadboard model, or something else may be incorrect. Unfortunately, I have to step away for a bit, so I will likely come back to this tomorrow, when I have the 2N7000s on hand and a bit more time, and will try this again.

Thanks again, @crutschow - I truly appreciate your help with this!
 

Thread Starter

redeyedjim

Joined Jul 14, 2018
33
Then perhaps the capacitor size has to be increased to give a longer pulse.
Just checking the thread from my phone: I did try doubling the size to 2.2uF, and then tried 10uF, and but still wasn't seeing the expected behavior. Should I try an even larger cap value?
 
Top