I have a device that requires a momentary switch closure, however I need to activate it using a toggle type switch that will remain closed. I am hoping to find a circuit that will provide the momentary closure when the toggle switch is first closed and then not again unless the toggle switch is opened and then closed again.
I am inexperienced with electronics and need some direction. I thought adding a resistor and cacpacitor might achieve what I need by allowing current to flow while the capacitor is charging and then cutting off when it is fully charged. I don't know if this will work or how to reliably discharge the capacitor to reset for the next switch close.
I also looked at using a one-shot (monostable multivibrator) but they appear to trigger continually if the input signal persists. Maybe some additional logic could overcome this. I also wonder if an edge triggered one-shot would avoid the problem.
I am triggering buttons on a device that simulates a USB gamepad on PCs. Specifically the Ultimarc A-PAC. It is often used for building custom controllers for arcade emulators. I am using it to interface the stick, buttons, and switches on an RC airplane radio to a PC so it can be used with the FMS RC flight simulator.
The A-PAC button terminals need to grounded to activate the switch. A want the radio toggle switches like on/off and high/low rate to become momentary button presses on the controller. I think something like
1/10 of a second should be adequate to register the button press. I don't think the rise and fall time is critical here.
I don't have any specification about how much current will flow from the button terminal to ground upon closure. Would grounding the button through a multi-meter tell me this accurately?
I thought a non-retriggerable was what I needed until I read it only prevents retriggering during the output pulse. I need to prevent retriggering after the output pulse because my input will remain pulled low. I only want to trigger again after the input switch goes open and then grounded again.
I see some possibilities based on the 555 in Schematica that Joel referred to. I will try those but in the final product I want to use a newer timer with duals or a quad because I have four switches to connect.
The newer timers seem to use edge triggering instead of level triggering. I am not certain edge triggering will eliminate the need to worry about my persistant input causing additional triggering after the output cycle, but I guess it will.
An RC circuit can certainly generate a pulse but to know if it will do the job more info is needed about the application. What are you trying to trigger, how long does the pulse have to last, are the requirements for rise or fall time of the pulse, what kinds of voltage and currents are involved?
I assume you added a connection from pin 4 to Vcc in the actual constructed circuit? It wouldn't work without that.
BTW, that's the classic edge-triggered monostable, one of the possibilities you were correctly considering in your original post.
Does it behave reliably when you first power up? If not (i.e. if it sometimes gives you an unwanted output pulse), try inserting 100k from pin 4 to Vcc (instead of the direct connection), and 0.1uF from pin 4 to ground.
Pin 4 should be connected to Vcc to allow normal operation of the monostable. (Yes, you were just lucky!) To disable the mono for a brief time at power-up, and hence prevent possible spurious output pulses, use an additional R and C as I described. If it behaves consistently OK, then you don't need that refinement.
Ed: That looked such an attractively simple circuit that I tried it myself yesterday. I may have missed something but aren't there a couple of downsides to it? I don't think the OP specified what sort of pulse he wanted, but my starting assumptions were a clean, +ve, full supply signal. Your circuit:
1) Delivers only a low amplitude spike, so needs amplifying to get a 'full' pulse. Using say a simple NPN stage that results in a -ve going pulse, which may then need inverting. (BTW, such amplification would presumably be simplified if the headroom voltage is rather larger than your examples?)
2) Transmits switch noise.
I used a 14V supply and a nominal 12V 1W zener, with this circuit:
Here are a few screenshots of the results I actually saw:
Relatively 'clean' switch
Noisy switch, detail
Noisy switch, detail, after NPN stage
BTW, I'm puzzled by the roughly triangular shape of the output. I tried one simulation and got a squarish result:
He's replacing (or using in place of) a momentary switch. Both the toggle and the momentary are subjecty to switch bounce. Since whatever circuit he's driving will work on a momentary, then switch bounce from a toggle is not a factor.
But your observation is correct. The circuit will not provide a clean, +ve, full signal supply. It is a definite downside to the circuit for general use - it is good only for use where switch bounce is irrelevant.
That's wierd. It should deliver close to Vcc. Your Vcc is 14 volts and the zener is 12. It (the zener) should conduct until Vcap drops to 12, meaning that the pulse amplitude has to be at least 12. Maybe you are scoping at the input to the zener? The duration depends on the load, and to a lesser extent, on the 220K resistor, but primarily on the zener. It will be a spike, but it should be a spike whose amplitude is over the zener voltage. RC is ~ 9.5 mS (way too short) down to ~1/3 vcc - but it is collapsing only 2 volts or about 14% (instead of ~ 63%) when the zener shuts it off. You need a bigger cap! The circuit "looks at" just the top of the cap discharge curve, which is steep.
We disagree on spike amplitude, but that doesn't change the fact that the output is another downside, as you indicated. You get what amounts to a spike instead of a nice robust square wave.
Using say a simple NPN stage that results in a -ve going
Yes - you need that with a low impedance load, or a long duration pulse, or if the pulse must be square. And as long as you stuff enough drive current into the base, it drives to Vcc minus the transistor Vce. So you can have plenty of headroom between the zener and Vcc and still get square wave output.
I got way over 40 seconds with a 120(?) ohm relay driven that way through a darlington with Hfe > 1000 in a delay off circuit I made. Had to add a resitor in parallel with the cap to get it down to the ~40 second target in that circuit. I don't remember all the values, but I can find them if they are of interest.
The headroom was to make the pulse voltage unambiguous. RC is ~ 63% discharged - the circuit is "looking" at the top ~6% of discharge (eg from 5.0 down to 4.7). I didn't want the the circuit that is being driven to "see" an ambiguous voltage that was not clearly either a high or a low. By using the top of the discharge curve, the voltage will be at a high until the zener cuts it off. It has a wicked slope, but all of it will be above the zener V. Also, I picked common zener voltages. I run into lots of 11 and 4.7v zeners, but rarely a 4.3.
Absolutely. As mentioned earlier, I don't think that's a factor for the op, but it certainly is in many applications.
Thanks for these - they're great! I have a question, inline below.
I'm puzzled by the Vout curves. It should "fall off the cliff" at 12V when the zener stops conducting, but the traces all show Vout curving down below 12 volts.
I think the output (without the noise, which I can't draw) should look like this:
+12 | \\ | | | | | |
0 ---- ----
Can you determine why there is that curve down to 0 volts? I wonder if your zener doesn't "zen" :-) ?
Regarding the simulation - my guess is that they treat the switch as noiseless, no bounce. But they don't show the Vout "falling off the cliff" pattern - unless the yellow is supposed to be Vout. The green looks more like a capacitor discharge curve than the yellow, but the green doesn't fall off the cliff. And if the yellow is supposed to be Vout, the trailing edge is correct and everything before it is wrong. So I'm clueless.
I think I need a much *smaller* cap! If I make it 10nF instead of 1uf, then I see Vout as an initial *very* brief spike.
You've lost me there. Can you draw that circuit please?
I'm out for rest of day, but I'll get back on the case tonight. I suspect that 'triangle' I saw for Vout might have been an artifact of some sort, due to poorly chosen PC-based 'scope settings. All the simulations I've tried show a square signal, amplitude Vcc-Vz, *apart* from that initial spike which they now show, following the massive reduction in the value of C.