• 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.

Simpler timer circuit

Status
Not open for further replies.

Moonbat

New Member
Hi,

I'm completely new to electronics and I have a few questions with regards to a small project i'm trying to build.

I have a simple switch that is closed most of the time and occasionally opens then closes again. I would like a setup whereby whenever the switch opens and stays open for more than 15 ms a light comes on for a second or so.

I want the circuit to be battery powered and as small and light as possible, ideally not much larger or heavier than a AA battery.

I looked up various tutorials and tried to summon up the electronics course i took 14 years ago at school. And have managed to design a circuit that does what i want albeit with ground inputs. You can see my circuit if you go to

Circuit Simulator Applet

and then Import the 1st code segment at the bottom of this post.

What i've done is to take two 555 timer chips that are triggered together when my switch opens. They are timed for 15 ms and 16 ms respectively, the outputs feed into an xor gate. So that after 15 ms the outputs are different and the xor gate outputs a +1 which lasts for 1 ms before the outputs become equivalent and the xor gate drops back to 0.

I feed this pulse into an and gate with a second input that comes directly from the switch, so the and gate only outputs a +1 if the switch is open and the pulse is active. This then triggers a third 555 timer chip which will switch on an led for a second.

I was thinking of using a TLC556 chip and a TLC555 chip for the timers and a 3.3 1/2 AA battery as power supply.

My questions are:

Is this overall design a stupid way of doing it? I.e. is there an obvious solution that is simpler, less power hungry, etc.

I use a dspt switch but it feels somewhat clumsy can anyone see a better of way handling it that wouldn't require a second switch?

Will it be ok to replace all the grounds bar the one in the top left with lines back to the battery? (see second circuit) and will it be ok to replace the ground in the top left with a line that connects to the ground pins of the 555 chip and then also feeds back to the back of the battery? (I can't do this in the simulation because it doesn't give you the ground inputs on the 555s). Ultimately i can't have any grounds because it's not mains powered but i'm not sure what you're supposed do with pins on chips like the 555 that ask to be connected to a ground!

Thanks you so much for you time.

Cheers

Moonbat

$ 1 5.0E-6 14.841315910257661 57 5.0 50
165 368 96 480 96 0 0.0
w 368 128 368 224 0
w 368 128 336 128 0
w 368 192 288 192 0
w 336 128 336 224 0
c 336 224 336 272 0 1.0E-6 0.0019986675549633582
g 336 272 336 288 0
r 336 128 336 64 0 15000.0
w 336 64 432 64 0
r 288 64 288 192 0 100.0
w 288 64 336 64 0
c 288 192 240 192 0 1.0E-5 3.0001054973638475E-9
c 480 464 432 464 0 1.0E-5 3.0001059414530573E-9
w 480 336 528 336 0
r 480 336 480 464 0 100.0
w 528 336 624 336 0
r 528 400 528 336 0 16000.0
g 528 544 528 560 0
c 528 496 528 544 0 1.0E-6 0.0018738288569643974
w 528 400 528 496 0
w 560 464 480 464 0
w 560 400 528 400 0
w 560 400 560 496 0
165 560 368 672 368 0 0.0
w 240 464 240 192 0
w 496 160 736 160 0
w 688 432 736 432 0
w 736 432 736 192 0
154 736 176 768 176 0 2 0.0
w 240 464 240 640 0
w 240 640 768 640 0
I 768 640 816 640 0 0.5
w 816 640 880 640 0
150 880 624 928 624 0 2 0.0
w 880 608 848 608 0
w 768 176 848 176 0
w 848 176 848 544 0
w 848 544 848 608 0
w 1232 592 1280 592 0
165 1104 528 1216 528 0 0.0
w 1104 560 1104 656 0
w 1104 560 1072 560 0
w 1104 624 1024 624 0
w 1072 560 1072 656 0
c 1072 656 1072 704 0 2.4999999999999998E-5 2.999700029997027E-4
g 1072 704 1072 720 0
r 1072 560 1072 496 0 100000.0
w 1072 496 1168 496 0
r 1024 496 1024 624 0 100.0
w 1024 496 1072 496 0
c 1024 624 976 624 0 1.0E-5 -1.9999999999998668
w 928 624 944 624 0
I 944 624 976 624 0 0.5
w 432 64 496 64 0
w 528 336 528 64 0
w 496 64 528 64 0
w 1072 496 1072 64 0
w 528 64 1072 64 0
w 240 464 176 464 0
w 240 464 432 464 0
160 176 464 176 368 0 10.0 1.0E10
w 112 416 160 416 0
g 64 64 64 112 0
v 64 64 112 64 0 0 40.0 3.0 0.0 0.0 0.5
s 112 416 112 64 0 0 false
g 192 368 192 320 0
w 160 368 160 64 0
w 160 64 112 64 0
w 160 64 288 64 0
o 25 64 0 35 7.62939453125E-5 9.765625E-5 0 -1
o 4 64 0 35 0.01953125 9.765625E-5 1 -1
o 3 64 0 291 10.0 9.765625E-5 2 -1
h 2 7 5
$ 1 5.0E-6 12.050203812241895 57 5.0 50
165 368 96 480 96 0 0.0
w 368 128 368 224 0
w 368 128 336 128 0
w 368 192 288 192 0
w 336 128 336 224 0
c 336 224 336 272 0 1.0E-6 0.0019986675549633582
r 336 128 336 64 0 15000.0
w 336 64 432 64 0
r 288 64 288 192 0 100.0
w 288 64 336 64 0
c 288 192 240 192 0 1.0E-5 3.0001054973638475E-9
c 480 464 432 464 0 1.0E-5 3.0001059414530573E-9
w 480 336 528 336 0
r 480 336 480 464 0 100.0
w 528 336 624 336 0
r 528 400 528 336 0 16000.0
c 528 496 528 544 0 1.0E-6 0.0018738288569643974
w 528 400 528 496 0
w 560 464 480 464 0
w 560 400 528 400 0
w 560 400 560 496 0
165 560 368 672 368 0 0.0
w 240 464 240 192 0
w 496 160 736 160 0
w 688 432 736 432 0
w 736 432 736 192 0
154 736 176 768 176 0 2 0.0
w 240 464 240 640 0
w 240 640 768 640 0
I 768 640 816 640 0 0.5
w 816 640 880 640 0
150 880 624 928 624 0 2 0.0
w 880 608 848 608 0
w 768 176 848 176 0
w 848 176 848 544 0
w 848 544 848 608 0
w 1232 592 1280 592 0
165 1104 528 1216 528 0 3.0
w 1104 560 1104 656 0
w 1104 560 1072 560 0
w 1104 624 1024 624 0
w 1072 560 1072 656 0
c 1072 656 1072 704 0 2.4999999999999998E-5 0.8847155531996896
r 1072 560 1072 496 0 100000.0
w 1072 496 1168 496 0
r 1024 496 1024 624 0 100.0
w 1024 496 1072 496 0
c 1024 624 976 624 0 1.0E-5 -1.9999999999998677
w 928 624 944 624 0
I 944 624 976 624 0 0.5
w 432 64 496 64 0
w 528 336 528 64 0
w 496 64 528 64 0
w 1072 496 1072 64 0
w 528 64 1072 64 0
w 240 464 176 464 0
w 240 464 432 464 0
160 176 464 176 368 0 10.0 1.0E10
w 112 416 160 416 0
v 64 64 112 64 0 0 40.0 3.0 0.0 0.0 0.5
s 112 416 112 64 0 0 false
w 160 368 160 64 0
w 160 64 112 64 0
w 160 64 288 64 0
w 528 544 528 704 0
w 1072 704 528 704 0
w 336 272 336 704 0
w 528 704 336 704 0
w 192 368 208 368 0
w 208 368 208 704 0
w 336 704 208 704 0
w 64 64 64 704 0
w 64 704 208 704 0
g 64 64 16 32 0
o 23 64 0 35 5.0 9.765625E-5 0 -1
o 4 64 0 35 2.5 0.2 1 -1
o 3 64 0 291 10.0 9.765625E-5 2 -1
 

BrownOut

Banned
Please just attach your schematic. Most ppl here don't have the time to run applets, import code, etc. Without looking at your schematic, I think your design is a little over-complicated. Just use a 556, configure both timers as one-shots, the first for the delay and the second for the "on" time. Just take the output from the second.

There is an excellent online turtorial, but I can't seem to find it. I know someone else has the link. It's been referenced many times on here.
 

Moonbat

New Member
Sure thing.

Here's the 1st circuit:


and here's the 2nd:



If I only have two timers then how will I stop the light activating if the switch opens then shuts before 15 ms have passed?
 
Last edited:

BrownOut

Banned
The 1st timer can be designed to hold off for 15 mS. Use the RC time constant to hold the trigger high until 15 mS has passed. An invertor will be needed between the 1st and 2nd timer to get the trigger at the correct level. A transistor can be used.
 
Last edited:

Moonbat

New Member
If I understand you correctly (which i probably don't) then wouldn't the light go out as soon as my switch closes? I.e. if the switch closed after 16 ms the light would only go on for 1 ms?

I want the light to go on for about 2 seconds if it's triggered at all regardless of whether the switch closes after 16 ms or after 2 seconds.

Edit: maybe not - hmm will go away and try and design the circuit as you suggest then report back. Cheers.
 
Last edited:

BrownOut

Banned
Um, if you can wait, I'll post a schematic later. Right now, I have to go to the office for awhile Ugh!
 

Moonbat

New Member
I think this is along the lines of your suggestion:



It seems to work though i confess i'm not entirely sure why.
Is there an obvious way of avoiding the use of the dpst switch or is this now a reasonable solution (assuming i can deal with the grounds by conecting them up to the battery).

(Edit still some work for me to do as apparently vast currents are passing through the output of the first 555 chip)
 
Last edited:

Moonbat

New Member
Ok how about this:



Is it ok to use these analogue switch things or is better to use something else? (Transistors? But current has to flow in both directions forward to charge the capacitor and back to trigger the timer)
 

BrownOut

Banned
If I understand your objective correctly, and that's a BIG if, here is my solution. Sorry, but I couldn't understand your approach, so I just made my own. I include simulation data here. You can see, the first timer holds off until the pulse is a few hundred mS, and then triggers the second timer, which is active for a couple seconds.
 

Attachments

Moonbat

New Member
Thanks! I've just downloaded LT spice and have been trying to understand your circuit.

I think I understand what's happening. Please correct me if i'm wrong.

The left circle with the plus and the minus in it represents my switch and in the initial settings it is connected for 0.5 seconds, after 0.5 seconds of simulation time have passed.

After about 250 ms the capacator has charged up enough that the voltage on the trigger has risen to 6 2/3 Volts which in turn drops the output from the first timer to 0 activating the second timer which is set to last a few seconds.

If the switch is set to connect for less than 0.5 seconds then the capacator never charges up enough to get to the point where the trigger deactivates chip 1.

So other than the fact that i want pulses of 15 ms and above to trigger the final output of a couple of a seconds rather than 0.5 seconds that sounds good. The only thing is that my switch is the other way round in that when it's depressed the circuit is broken not made. So i would need to put an inverter into your circuit.

Does that make sense?

I'm going to try and build it in the simulator app that i'd used before to better understand what's going on.

Cheers for the help man.

Moonbat
 

BrownOut

Banned
It makes sense. R2 and C1 control the 15mS delay you want. Just use RXC to figure out the values. Make R1 = R2. You don't need an inverter. Just connect your switch to the right side of R2, and ground. Connect the other side of R2 to your voltage rail.
 
Last edited:

BrownOut

Banned
See if you can change your delay by changing C1 only. Lowering R2 would have other consequences.
 

Moonbat

New Member
Oh yes one other thing. This ground business - what do you do about ground if it's battery powered?
 
Last edited:

BrownOut

Banned
Ground is the "-" terminal on the battery ( or any wire connected to it ). Same as the "-" connection to the voltage source in the circuit -- right side of the drawing.
 
Last edited:
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top