# How can I modify this circuit for some hysteresis and better design?

I need to make a circuit even when the push button pushed and released very fast, the final output will stay ON at 12 V for roughly a second. 10% accuracy for the timing is fine. An LED will indicate the ON and OFF time. I tried to combine couple of circuits to obtain the goal.

Below circuit uses C1 and R4 for adjusting the pulse ON time. LM2903 is used as a comparator. The output of the comparator is buffered by a transistor buffer to obtain enough current to the load and the LED. The need for buffer is to obtain better results for different loads:

(left-click to enlarge)

And here is the voltage and current waveforms from the simulation for the nodes marked as n, p, op, out, LED current I(D1) and switch current I(S1):

My problem in this circuit is that I cannot add hysteresis because if I add positive feedback it will be connected to the RC timing circuit. I might overcome this by changing R4 but I cannot even create hysteresis by adding a resistor between the nodes out and p.

How can I add some hysteresis to this comparator without affecting the function of this circuit? Is there anything fundamentally wrong or missing with this design?

• Is there something wrong with this: Momentary PB, Timed ON Circuit? Note that the load doesn't have to be an LED. It can be any load you want. You just have to adjust some other values to accommodate what's needed. Let me know.
– jonk
Sep 18, 2018 at 22:30
• @jonk can you provide an alternative answer for this question of mine? Seems your design is much easier to implement. Maybe mine is unnecessarily complicated. Which circuit performs exactly the same functionality in your link/answer? Sep 18, 2018 at 22:36
• The goal of the circuit I provided is to instantly trigger the circuit upon pressing the momentary switch and to then hold it on for a given period of time, regardless of what the momentary switch does after. It is completely debounced. But do you need re-triggering? Or not? What's the actual LOAD current compliance required. Etc. I need lots of details.
– jonk
Sep 18, 2018 at 22:52
• @jonk I need to trigger a device to initiate scanning for 30 seconds(this scanning period is set by a software). To trigger I need to send a 12V pulse with a clean rising edge of around one second ON duration. Load should receive 9 to 15Vdc @ 6.5mA to be triggered. From the manual it says: Sep 18, 2018 at 23:05
• "Hardware Trigger The external trigger input is optically isolated to prevent grounding problems. It is a TTL level, edge sensing device. It requires a minimum signal of 9Vdc @ 6.5 mA. It may accept voltages as high as 15 Vdc. " from this manual johnmorrisgroup.com/Content/Attachments/126110/… That is why I modelled the load as 2.3k in my question. Sep 18, 2018 at 23:05

The following circuit will do what you are looking for. It debounces the switch and provided a $1\:\text{s}$ wide pulse of $12\:\text{V}$ to your ERAD4000 Trigger inputs (pins 8 and 9, as I understand it.)

simulate this circuit – Schematic created using CircuitLab

$C_1$ and $R_1$ and the threshold voltage required by $M_1$ set the timing for you. In this case, I've worked out the approximate values for $C_1$ and $R_1$ when $M_1$ is a BSS145. But you can use other choices for the NFET device. Just be aware that the gate threshold voltage will affect the timing. (For example, a BSS123 would also be fine here but because it has a lower threshold voltage, the timing will be longer than I estimated.)

Regardless, it shouldn't be hard to make adjustments to get the desired timing.

The circuit will automatically shut itself off after the time period.

$R_2$ determines the base current in $Q_1$. This needs to be about one tenth of the required current compliance for the ERAD4000 trigger. As shown, the base current is about $\frac{12\:\text{V}-V_\text{BE}}{R_2}\approx 1.6\:\text{mA}$. So the collector of $Q_1$ will provide substantially more current compliance than the ERAD4000 requires.

• Thanks this looks great. I also need an LED indicator. How about this version: imgur.com/a/ZWXMCnJ I used different MOSFET and PNP and as you said adjusted the R1 for timing. And added an LED and a current limitter resistor for it in parallel with the load. What do you think? Sep 19, 2018 at 9:01
• Adding an LED and current limit resistor to the load is fine. However, you may want to reduce the value of $R_2$. I arranged things for between $15-30\:\text{mA}$. Your device doesn't require much, itself, and the LED probably (if you current limit it, correctly) wouldn't exceed the compliance already handled. But it might, too. So that's a possible consideration. But it will probably work fine.
– jonk
Sep 19, 2018 at 16:22

I haven't fully analyzed your circuit. You can always add a buffer between stages to avoid loading effects (such as positive feedback) between stages if that's what you are worried about.

• Just add hysteresis to the comparator and a buffer after it. ti.com/lit/ug/tidu020a/tidu020a.pdf Sep 18, 2018 at 22:34

There is nothing fundamentally wrong with your design, in the usual sense. However, you are missing few tricks.

Adding hysteresis will affect your timing (capacitor waveform) since that is connected to the + input of the comparator. Can you change that? Yup.

Notice that your output buffer is essentially two inverters in series. Swap + and - inputs at the op amp, and get rid of the NPN section of the buffer, and the circuit will work just the same. Rload is a good deal greater than R1, the LED current limit resistor, and the total required current is on the order of 25 mA. This means that you need about 2.5 mA base drive for the PNP, and a 290x will provide that without blinking. So you don't need the NPN to boost the comparator output, and can safely do away with it.

Under the new setup, the + input of the op amp connects to the trigger level voltage divider (R2/R3), so running a large resistor (100k to 1M) from the comparator output to the + input will have no major effects. It will produce unequal trigger levels depending on the state of the comparator output, but that is in the nature of practical hysteresis.

@Jonk showed many of hundreds of great ways to make a pushbutton power one-shot.

Schmitt Trigger CMOS is very useful and comes in many supply voltage ranges. The old CD4000 series could drive a few mA max. while the 74HC series is limited to 5V. THen Comparators are easy to use with 4 in an IC.

Here's another way. If you never used CMOS before, read about precautions for handling.

## Minor Fixes to yours

Many ways to do it.

The main problem of 12s is fixed changing R4 from 1M to 10M assuming 2/3 threshold from 33% hysteresis. If you need to increase time duration increasing R2 up to 1M may be done.

In order to not load the comparator pull-up resistor and offset the hysteresis threshold too much, I changed the NPN bias. When cascading saturated high currents to the same voltage use 10 or 20:1 Rb/Rc ratio. 1:1 is ok but not needed. Since the comparator is low Z out when low the NPN base R to gnd is redundant.

R for the LED can be increased to 1k or 2k