Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Delay on - Instant off timer

Status
Not open for further replies.

theotyflos

New Member
Hi to all - newbie here,

I am a programmer with basic knowledge of electonics, so please forgive my ignorance.
I'm trying to create a circuit (maybe using a 555???) that meets the following criteria:

The circuit has 2 inputs, the 1st is a NC momentary switch and the 2nd one is a NO momentary switch, and one output normally in low state.

When 1st input switches to open state, the circuit should wait for a few seconds (5 to 10 is ok - I don't care for the exact time)
and then it should trigger the output to high state and KEEP IT HIGH (even if 1st input returns to closed state) UNTIL the second switch is pressed.
When 2nd switch is pressed, the output must return to low state and the circuit must be IMMEDIATELLY (in a few milliseconds) ready for the next cycle.

I'm searching the internet for three days now to no avail. I've tried dozens of schematics but none seems to meet the above requirements.

I can create the circuit using an arduino board, but i would like to use more basic components.

If anyone can help I would appeciate it.

TIA.


PS. Forgot to mention that I don't care if it is TTL or CMOS or whatever, power voltage can be from 5 to 24 volts.
 
Try this circuit:
https://electrosome.com/monostable-multivibrator-555-timer/

With the following modifications:

1. INVERT THE BEHAVIOUR OF YOUR TRIGGER BUTTON:
On Pin 2 (trigger) connect a pull-down resistor to ground and the NC switch connected to Vcc.
2. REPLACE THE AUTO-DISCHARGE THAT OCCURS AT THE END OF THE CYCLE IN THE CIRCUIT AND REPLACE IT WITH A MANUAL DISCHARGE BUTTON:
Disconnect pin 7 from the circuit and instead connect it through the NO switch to ground. Instead, take that connection from the top of the capacitor and connect it to ground through the NO push button.
3. Invert the output at pin 3:
You could have the pin drive a NMOS transistor (gate resistor not needed), or an NPN resistor (gate resistor needed) in conjunction with a pull-up resistor. THe pull-up resistor pulls your output high and whenever the 555 is not driving the transistor. Whenever the 555 timer drives the transistor, it overrides the transistor and pulls the output low.

EDIT: Wait, I think I missed a requirement of yours.

EDIT: Yeah, I did. I think this circuit would require two 555 timers since it has three states: the stable off-state, the stable on-state, and the astable delay state.
 
Last edited:
Hi dknguyen,

Thank you very much for replying,

If I understood you correctly, this is what i have done:

upload_2018-4-29_21-35-53.png


Unfortunatelly, I face two problems with that design: when I open the first switch, the output is triggered immediately, and the 2nd switch does nothing.
Am I missing something?
 
No, I'm the one missing something. I think this circuit requires two 555 timers and I'm trying to sort it out. There was also something I missed about the way the trigger pin behaves with the threshold pin so that's why it doesn't work the way I thought it did. You didn't wire up the NO button the way I described either but it's a moot point right now.

I found the simulator you are using. Let's see if I can figure this out.
 
Last edited:
This is the file exported as text. The only thing not working is the reset for some reason, The 555 timer in this simulator does not have a reset terminal but normally you would just use that with the NC pushbutton instead of trying to rig the pushbutton elsewhere.

I think you can actually do away with the charge resistor and capacitor on the second 555 timer since it doesn't have a charge time or anything like. THe second 555 timer is just being used as a flip flip flop to latch the state so those two timing components should not be necessary.
Code:
$ 1 0.000005 4.43302224444953 56 5 50
165 32 160 144 160 0 0
165 368 112 480 112 0 0
R 96 128 96 80 0 0 40 5 0 0 0.5
R 432 80 432 48 0 0 40 5 0 0 0.5
w 32 256 -128 256 0
r -128 256 -128 368 0 10000
s -128 144 -128 256 0 0 false
g -128 368 -128 384 0
R -128 144 -128 96 0 0 40 5 0 0 0.5
c -32 400 -32 288 0 0.000009999999999999999 -0.004995004995005056
w 32 192 -32 192 0
w -32 288 -32 192 0
w 32 288 -32 288 0
g -32 400 -32 432 0
r -32 192 -32 96 0 10000
R -32 96 -32 64 0 0 40 5 0 0 0.5
c 96 320 96 352 0 0.00001 3.282030138209255
c 432 272 432 304 0 0.00001 3.282030138209255
g 96 352 96 368 0
g 432 304 432 320 0
r 208 208 208 96 0 10000
R 208 96 208 80 0 0 40 5 0 0 0.5
f 160 224 208 224 0 1.5 0.02
g 208 240 208 272 0
c 320 240 320 304 0 0.000001 4.99999999999996
w 208 208 368 208 0
g 320 304 320 320 0
r 320 240 320 64 0 100
R 320 64 320 48 0 0 40 5 0 0 0.5
w 496 176 544 176 0
w 320 240 368 240 0
g 272 320 272 352 0
w 272 240 320 240 0
s 272 240 272 320 0 1 true
o 4 64 0 4099 5 0.00009765625 0 2 4 3
o 29 64 0 4099 5 0.00009765625 1 2 29 3
 

Attachments

  • TEST.PNG
    TEST.PNG
    31.3 KB · Views: 314
Last edited:
Wait, a second, the trigerring between the two timers is missing a step.
 
I just tried your code and it dows the same thing: When I open the forst switch, the output of the second 555 goes to HIGH instantly.

The 555 timer in this simulator does not have a reset terminal

Actually it does but it is somehow removed from the "Monostable Multivibrator" example :banghead:. If you delete the existing chip and place a new one, the reset pin apears!!!

OOPS!!! I just place new 555s for the reset pins to appear and now the 1st button does NOTHING:confused::confused:
upload_2018-4-29_22-51-42.png
 
I'm still working out some kinks. The main issue is I need a edge detector and the 555 timer is not one.
 
Last edited:
Here is the circuit without the reset. I'll work on the reset but it's going to be a piece of circuit that's looks more compelx than the thing it actually does.

I was confused for a while why it wasn't working because I did not notice that the clock on the JK flip flop was falling edge triggered, so I had an inverter between the OUT of the 555 and the clock of the JK flip flop. This was causing it to trigger on the leading, rising edge of the 555 output (aka instantly) rather than the trailing, falling edge (after the delay).
Code:
$ 1 0.000005 24.46919322642204 56 5 50
R 96 128 96 80 0 0 40 5 0 0 0.5
w 32 256 -128 256 0
r -128 256 -128 368 0 10000
s -128 144 -128 256 0 0 false
g -128 368 -128 384 0
R -128 144 -128 96 0 0 40 5 0 0 0.5
c -32 400 -32 288 0 0.000009999999999999999 -0.004995004995005056
w 32 192 -32 192 0
w -32 288 -32 192 0
w 32 288 -32 288 0
g -32 400 -32 432 0
r -32 192 -32 96 0 10000
R -32 96 -32 64 0 0 40 5 0 0 0.5
c 96 320 96 352 0 0.00001 3.3333333316638174
g 96 352 96 368 0
165 32 160 192 160 2 0
w 160 192 160 48 0
r 368 48 432 48 0 1000
R 432 48 432 16 0 0 40 5 0 0 0.5
g 208 128 208 176 0
s 208 128 208 64 0 1 true
w 208 64 208 48 0
w 160 48 208 48 0
w 208 48 368 48 0
156 352 192 400 192 0 5
w 208 224 240 224 0
R 240 192 240 160 0 0 40 5 0 0 0.5
g 240 256 240 288 0
w 336 192 352 192 0
w 240 192 336 192 0
w 336 224 240 224 0
w 240 256 336 256 0
w 448 192 512 192 0
w 336 224 352 224 0
w 336 256 352 256 0
w 208 224 160 224 0
o 1 64 0 4099 5 0.00009765625 0 2 1 3
o 30 64 0 4099 0.0000762939453125 0.00009765625 1 2 30 3
o 32 64 0 4099 5 0.00009765625 2 2 32 3

The reset for the 555 is a circuit that needs to make the NO pushbutton:
-J to ground
-K to +5V
-produce a falling edge on the clock pin after this
 

Attachments

  • Capture.PNG
    Capture.PNG
    26.7 KB · Views: 297
Try this:
84.png

I think it does what you want. Note that I try several cases of relative timing between Start~ and Stop~.

I made the R2C2 time constant shorter than what you asked for my convenience, but you can make it anything you want.

The diodes can be 1N914 type.
 
Try this:
View attachment 112629

I think it does what you want. Note that I try several cases of relative timing between Start~ and Stop~.

I made the R2C2 time constant shorter than what you asked for my convenience, but you can make it anything you want.

The diodes can be 1N914 type.
Ahhh, that's how you turn a level sensitive input into an edge-triggered input. AC filtering cap. I was sitting there scratching my head thinking there must be a simple way to do that and had to go with a JK flip flop instead of a 555 because I couldn't think of one.

No point anymore in me trying to figure out a reset circuit for the JK flip flop since that allows a 555 timer to be used whose main benefit over a second 555 is that it already has a reset.
 
It's getting really late here (i'm in Greece) and I have to leave. I will check your design tommorow and report back.
THANK YOU VERY MUCH.
 
I think a better way to go is to use a counter. The nice thing about counter-based delay timers is that there is no capacitor recovery time; a 10 hour timer resets in microseconds. Consider a circuit based on the CD4060 oscillator/divider chip. The output is over 8,000 times slower than the oscillator, so the "timing capacitor" is very small even for long delay times.

Button 1 resets the counter and sets a flipflop (2 gates in a CD4093)
Flipflop locks out additional button 1 presses
Oscillator runs and divider divides until Q14 changes state
Q14 inhibits the oscillator which freezes everything. Q14 drives whatever the output is.
Button 2 resets the flipflop. This allows the next button 1 press to reset the counter and stat a new cycle.

or something like that. There might be additional gating, but the 4093 has 4 gates and only two are needed for the ff.

ak
 
Ahhh, that's how you turn a level sensitive input into an edge-triggered input. AC filtering cap. I was sitting there scratching my head thinking there must be a simple way to do that and had to go with a JK flip flop instead of a 555 because I couldn't think of one.

No point anymore in me trying to figure out a reset circuit for the JK flip flop since that allows a 555 timer to be used whose main benefit over a second 555 is that it already has a reset.
Actually, C5 and R4 is a differentiator. D1 clamps the positive going edge. R3 and R5 turns the second 555 into a set-reset flip-flop.
 
I stole Mike's AC block cap method to make things edge-triggered and it seems to work in full now.

Code:
$ 1 0.000005 75.37042125545614 56 5 50
R 96 128 96 80 0 0 40 5 0 0 0.5
w 32 256 -128 256 0
r -128 256 -128 368 0 10000
s -128 144 -128 256 0 0 false
g -128 368 -128 384 0
R -128 144 -128 96 0 0 40 5 0 0 0.5
c -32 400 -32 288 0 0.000009999999999999999 -0.004995004995005056
w 32 192 -32 192 0
w -32 288 -32 192 0
w 32 288 -32 288 0
g -32 400 -32 432 0
r -32 192 -32 96 0 10000
R -32 96 -32 64 0 0 40 5 0 0 0.5
c 96 320 96 352 0 0.00001 3.3333333333264257
g 96 352 96 368 0
165 32 160 192 160 2 0
165 352 128 448 128 2 0
R 416 96 416 80 0 0 40 5 0 0 0.5
c 416 288 416 320 0 0.00001 3.3333333333264257
g 416 320 416 352 0
s 320 48 320 112 0 1 true
w 480 48 480 160 0
r 480 48 560 48 0 1000
g 320 112 320 128 0
R 560 48 560 32 0 0 40 5 0 0 0.5
w 320 48 480 48 0
w 320 48 176 48 0
w 160 192 160 48 0
w 160 48 176 48 0
c 224 224 272 224 0 1e-7 -4.9999999999999805
w 352 224 272 224 0
w 224 224 160 224 0
r 272 224 272 144 0 1000
R 272 144 272 128 0 0 40 5 0 0 0.5
w 480 192 512 192 0
g 352 256 352 352 0
o 31 64 0 4099 0.0000762939453125 0.00009765625 0 2 31 3
o 30 64 0 4099 10 0.00009765625 1 2 30 3
o 34 64 0 4099 0.0000762939453125 0.00009765625 2 2 34 3
 

Attachments

  • Capture.PNG
    Capture.PNG
    21.3 KB · Views: 309
Last edited:
Actually, C5 and R4 is a differentiator. D1 clamps the positive going edge. R3 and R5 turns the second 555 into a set-reset flip-flop.
Well, whatever I thought you did works the way I thought it would work for me circuit haha.

Maybe a differentiator is what it really is. I looked at it and thought of it as a AC-pass cap that would convert changing level signals into a transient edge signals with a pull-up resistor to bias it to the idle state when there was no activity going on.

I was wondering what R3 and R5 were for and am still don't get how they're doing what you say they're doing since it just seems like it's biasing the threshold pin for no reason
 
Last edited:
...
...I was wondering what R3 and R5 were for since it seemed like you could just tie the threshold to ground...

Yep:

84a.png

A few less parts.

Here is the .asc file incase somebody wants to play...
 

Attachments

  • Draft84a.asc
    4.1 KB · Views: 243
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top