Badcaps.net Forum
Go Back   Badcaps Forums > Troubleshooting Hardware & Devices and Electronics Theory > General Electronics Technical Discussion
Register FAQ Calendar Search Today's Posts Mark Forums Read

 
Thread Tools Display Modes
Old 10-28-2017, 02:36 AM   #1
Dannyx
CertifiedAxhole
 
Dannyx's Avatar
 
Join Date: Aug 2016
City & State: Constanta
My Country: Romania
Line Voltage: 230VAC 50Hz
I'm a: Hardcore Geek
Posts: 2,475
Question 555 countdown timer design question

Good day folks. I need to build a countdown timer for a light fixture, that is, when you activate it, it turns the light on for 60 seconds and then turns it back off. Browsing the interwebs revealed the best solution might be to use a 555 timer in the configuration shown in the schematic. I kinda understand how it works and even simulated it and works perfectly, but I have a few questions regarding some aspects about it that I can't quite comprehend, since although the 555 timer is probably the most standard and ubiquitous component out there, I can't grasp its principle in this situation.

C1 and R2 set the time before the thing shuts down, in this case it's set at 60s. I imagine you can make it adjustable by using a pot - will look into that later.

Now: how exactly does C1 charge up ? The simulator shows it doesn't charge until I pull the TRIG pin to GND...C1 is connected straight to the rail via R2, so shouldn't it be charged all the time, albeit slowly ? Even after the fact, how does pulling TRIG to GND cause it to suddenly charge ? TRIG is connected internally to an op-amp inside the 555 so it doesn't charge THROUGH it, that's for sure.

Next, that discharge pin: when the 555's output goes high, the discharge pin pulls anything it's connected to to GND and in the schematic we see the positive of the cap is connected directly to the discharge pin, so shouldn't that drain the cap instantly since the transistor inside the 555 pulls it to GND ? How does it drain so slowly to count down the 60s ?

That's about it, other than that, I understand how it works and I'll start building it, but I also want to understand how it works instead of just rolling with it
Attached Images
File Type: png Timermod.png (19.6 KB, 30 views)
File Type: png Sim.png (9.8 KB, 19 views)
__________________
Wattevah...
Dannyx is offline   Reply With Quote
Old 10-28-2017, 05:49 AM   #2
Radio Fox
Badcaps Veteran
 
Radio Fox's Avatar
 
Join Date: Jan 2010
City & State: East London
My Country: UK
Line Voltage: 230VAC 50Hz
I'm a: Hobbyist Tech
Posts: 272
Default Re: 555 countdown timer design question

Quote:
Originally Posted by Dannyx View Post
1)...C1 and R2 set the time before the thing shuts down, in this case it's set at 60s. I imagine you can make it adjustable by using a pot - will look into that later...

2)...Now: how exactly does C1 charge up ? The simulator shows it doesn't charge until I pull the TRIG pin to GND...C1 is connected straight to the rail via R2, so shouldn't it be charged all the time, albeit slowly ? Even after the fact, how does pulling TRIG to GND cause it to suddenly charge ? TRIG is connected internally to an op-amp inside the 555 so it doesn't charge THROUGH it, that's for sure...

3)...Next, that discharge pin: when the 555's output goes high, the discharge pin pulls anything it's connected to to GND...
1) If you intend connecting a pot to the timing circuit, it's best to use a fixed resistor in series with the pot. This will prevent pins 6 & 7 from being accidentally connected straight to the supply voltage. (e.g. a 100k fixed resistor in series with a 500k pre-set pot would give an approx range of 11s to 66s)

2) Athough R2 & C1 are connected in series across the supply, the junction of R2/C1 also connects to the Discharge pin (7). Under stable condition (i.e. not triggered), this pin is held low, preventing the capacitor from charging.

3) You've got that the wrong way round. When the output goes high, the internal transistor connected to the discharge pin is switched off, allowing C1 to charge up until it reaches approx 8V (with a 12V supply), at which point the output goes low & the discharge transistor is swithed on again, discharging C1.

It's easier to see how a monostable works by looking at the internal block diagram of the 555 whilst designing your circuit around it as this site shows (note...the text incorrectly refers to the internal transistor as Q2 instead of Q1):-

https://circuitdigest.com/electronic...ircuit-diagram
__________________
________________________________________________

Invisible airwaves crackle with life
Bright antennae bristle with the energy
________________________________________________
Radio Fox is offline   Reply With Quote
Old 10-28-2017, 08:25 AM   #3
Dannyx
CertifiedAxhole
 
Dannyx's Avatar
 
Join Date: Aug 2016
City & State: Constanta
My Country: Romania
Line Voltage: 230VAC 50Hz
I'm a: Hardcore Geek
Posts: 2,475
Talking Re: 555 countdown timer design question

I did have a look at the internal diagram of a 555 - see it here. I modified it slightly, adding signs to the inputs of the op-amps to make it idiot-proof and also removed the CTRL and RST pins since I'm not interested in those just yet, although I believe that reset pin would be useful for cancelling a countdown that's already in progress (aka turning off the lamp BEFORE 60 seconds or whatever are up), which is something I'll require as well.

The symbol in cyan is for an NPN transistor, so shouldn't that turn ON when the output of the SR flip-flop (and therefore its BASE) goes high ? THAT'S actually what caused this whole confusion, because otherwise I had it all figured out from the start. It makes a whole lot of sense when you understand that it turns OFF - I actually thought of that myself, but now it's clear
Attached Images
File Type: png Untitled.png (24.4 KB, 20 views)
Dannyx is offline   Reply With Quote
Old 10-28-2017, 09:44 AM   #4
eccerr0r
Solder Sloth
 
eccerr0r's Avatar
 
Join Date: Nov 2012
City & State: CO
My Country: USA
Line Voltage: 120VAC 60Hz
I'm a: Hobbyist Tech
Posts: 4,219
Default Re: 555 countdown timer design question

The internal RSFF is active low (bubble on output), that's why the discharge transistor turns on once threshold reaches 2/3 VCC. Upon threshold, it forces the RSFF to reset, but the active low will invert the signal for the cyan transistor to start discharging the timing capacitor.

I like op amps that have + and - without bubbles. It's more confusing this way - either don't mark the + and - and leave one input bubbled, or omit bubble and keep + and -...
having both implies both inputs are noninverting.
eccerr0r is offline   Reply With Quote
Old 10-28-2017, 09:58 AM   #5
Dannyx
CertifiedAxhole
 
Dannyx's Avatar
 
Join Date: Aug 2016
City & State: Constanta
My Country: Romania
Line Voltage: 230VAC 50Hz
I'm a: Hardcore Geek
Posts: 2,475
Default Re: 555 countdown timer design question

NEVER would've noticed those little circles on some of the pins, let alone think they actually denote something.....the more you learn So basically the output of the blue section to the pink and cyan is ON (high) when points R and S are low ? I also noticed the Reset pin also has a little circle next to R1...would that mean that pulling reset LOW resets the timer, given a circle means active low, aka grounded=on, VCC=off ? That would be in layman terms, how my brain processes electronic lingo

Last edited by Dannyx; 10-28-2017 at 10:02 AM..
Dannyx is offline   Reply With Quote
Old 10-28-2017, 10:30 AM   #6
stj
Great Sage 齊天大聖
 
stj's Avatar
 
Join Date: Dec 2009
City & State: Europe
My Country: some shithole run by Israeli agents
I'm a: Professional Tech
Posts: 21,066
Default Re: 555 countdown timer design question

use a microcontroller
stj is offline   Reply With Quote
Old 10-28-2017, 10:36 AM   #7
Dannyx
CertifiedAxhole
 
Dannyx's Avatar
 
Join Date: Aug 2016
City & State: Constanta
My Country: Romania
Line Voltage: 230VAC 50Hz
I'm a: Hardcore Geek
Posts: 2,475
Default Re: 555 countdown timer design question

Quote:
Originally Posted by stj View Post
use a microcontroller
WAY overkill for what this thing needs to do
Dannyx is offline   Reply With Quote
Old 10-28-2017, 11:25 AM   #8
eccerr0r
Solder Sloth
 
eccerr0r's Avatar
 
Join Date: Nov 2012
City & State: CO
My Country: USA
Line Voltage: 120VAC 60Hz
I'm a: Hobbyist Tech
Posts: 4,219
Default Re: 555 countdown timer design question

Sadly, it's what people want you to do for the most part, no need to think about analog, just write a program that even lets you press three times or something to immediately shut off the light if in an emergency situation.

just that if you're in a situation where you don't have a microcontroller handy...
eccerr0r is offline   Reply With Quote
Old 10-28-2017, 12:40 PM   #9
Dannyx
CertifiedAxhole
 
Dannyx's Avatar
 
Join Date: Aug 2016
City & State: Constanta
My Country: Romania
Line Voltage: 230VAC 50Hz
I'm a: Hardcore Geek
Posts: 2,475
Default Re: 555 countdown timer design question

To me personally, and this is simply my opinion, it's pretty lame to see everything migrating towards micros. Just a simple little boring chip handling everything...Thought discrete components are obsolete ? How about relays then ? I've always had a fascination with relays for some reason....Heck, half of the elevators in my country still use relay logic. That's not to say we should live in the stone age forever just because something goes "click-click" and occasionally makes an arc that makes you go "UUUH...AAAH" What can I say, progress I guess......
Dannyx is offline   Reply With Quote
Old 10-28-2017, 01:25 PM   #10
eccerr0r
Solder Sloth
 
eccerr0r's Avatar
 
Join Date: Nov 2012
City & State: CO
My Country: USA
Line Voltage: 120VAC 60Hz
I'm a: Hobbyist Tech
Posts: 4,219
Default Re: 555 countdown timer design question

Use a TRIAC and driver and you can even PWM the TRIAC with a microcontroller to slowly turn the bulb on and off (if it's incandescent; all bets are off with CFLs, etc.)

Pretty disgusting what you can do with a microcontroller beyond just turning it on and off in a delay with just a software change.
eccerr0r is offline   Reply With Quote
Old 10-28-2017, 01:51 PM   #11
Dannyx
CertifiedAxhole
 
Dannyx's Avatar
 
Join Date: Aug 2016
City & State: Constanta
My Country: Romania
Line Voltage: 230VAC 50Hz
I'm a: Hardcore Geek
Posts: 2,475
Default Re: 555 countdown timer design question

Quote:
Originally Posted by eccerr0r View Post
Use a TRIAC and driver and you can even PWM the TRIAC with a microcontroller to slowly turn the bulb on and off (if it's incandescent; all bets are off with CFLs, etc.)

Pretty disgusting what you can do with a microcontroller beyond just turning it on and off in a delay with just a software change.
It's an LED floodlight so it's got a driver in it - not dimmable sadly, thought the idea is pretty cool nonetheless.

Might look into home automation one day. The problem is that unless you're planning on installing a "smart home" system from scratch when you buy/build a house/apartment, it's VERY difficult to reconfigure the existing electrical installation to work with micros and stuff, esp. here in east Europe where apartment building are mostly made of concrete and smashing through is like tough sh!t
Dannyx is offline   Reply With Quote
Old 10-29-2017, 05:58 AM   #12
Radio Fox
Badcaps Veteran
 
Radio Fox's Avatar
 
Join Date: Jan 2010
City & State: East London
My Country: UK
Line Voltage: 230VAC 50Hz
I'm a: Hobbyist Tech
Posts: 272
Default Re: 555 countdown timer design question

Quote:
Originally Posted by Dannyx View Post
NEVER would've noticed those little circles on some of the pins, let alone think they actually denote something...
Ahh right. So your initial confusion was caused by the fact that you thought when the base of the transistor was high (causing the capacitor to discharge), then the output was also high, not realising that the output driver circuit was actually inverting.

Unfortunately there are some images on the internet that don't even show that the output driver is inverting, which can be confusing.

As you say, if you want to reset the timer before it's finished it's timing period, simply switch the RST pin from Vcc to GND.
Radio Fox is offline   Reply With Quote
Old 10-29-2017, 06:53 AM   #13
Dannyx
CertifiedAxhole
 
Dannyx's Avatar
 
Join Date: Aug 2016
City & State: Constanta
My Country: Romania
Line Voltage: 230VAC 50Hz
I'm a: Hardcore Geek
Posts: 2,475
Question Re: 555 countdown timer design question

I have another question: HOW exactly is the timing period calculated ? WHY does R2 affect the countdown time ? THIS article says the formula is 1.1*R2*C1 (it's R2 in my case - the original is R1), which I know is based around the RC time constant "TAU equals R*C", but what's 1.1 exactly ? Is it like a constant ? I'm working on making the thing adjustable, so that's what I'm asking Cheers.
Dannyx is offline   Reply With Quote
Old 10-29-2017, 07:43 AM   #14
Radio Fox
Badcaps Veteran
 
Radio Fox's Avatar
 
Join Date: Jan 2010
City & State: East London
My Country: UK
Line Voltage: 230VAC 50Hz
I'm a: Hobbyist Tech
Posts: 272
Default Re: 555 countdown timer design question

R2 affects the countdown time because it's the resistor used to charge C1. The higher the value of R2, the longer it will take C1 to charge to 2/3 of the supply voltage.

The 1.1 factor can be calculated from the expression for the voltage on the capacitor at a certain instant in time. The maths is shown here:-

http://www.play-hookey.com/digital/555/timer_555.html

It's not going to be exact anyway if you use an electrolytic as the timing component, as electrolytics have a wide tolerance & leakage to consider. If you want the time to be exact, you would need to trim R2 or use a trimmer pot in series with R2 as mentioned earlier.
Radio Fox is offline   Reply With Quote
Old 10-29-2017, 08:41 AM   #15
eccerr0r
Solder Sloth
 
eccerr0r's Avatar
 
Join Date: Nov 2012
City & State: CO
My Country: USA
Line Voltage: 120VAC 60Hz
I'm a: Hobbyist Tech
Posts: 4,219
Default Re: 555 countdown timer design question

And another reason why microcontrollers are preferred, if you're using a crystal oscillator, it can be accurate down to parts per million, and even using the onboard oscillators in some even newer microcontrollers they have errors of only 1% or so. Using 5% resistors and +80-20% electrolytics, know knows what your real time constant will be
eccerr0r is offline   Reply With Quote
Old 10-29-2017, 03:06 PM   #16
Dannyx
CertifiedAxhole
 
Dannyx's Avatar
 
Join Date: Aug 2016
City & State: Constanta
My Country: Romania
Line Voltage: 230VAC 50Hz
I'm a: Hardcore Geek
Posts: 2,475
Default Re: 555 countdown timer design question

Quote:
Originally Posted by Radio Fox View Post
R2 affects the countdown time because it's the resistor used to charge C1. The higher the value of R2, the longer it will take C1 to charge to 2/3 of the supply voltage.

The 1.1 factor can be calculated from the expression for the voltage on the capacitor at a certain instant in time. The maths is shown here:-

http://www.play-hookey.com/digital/555/timer_555.html

It's not going to be exact anyway if you use an electrolytic as the timing component, as electrolytics have a wide tolerance & leakage to consider. If you want the time to be exact, you would need to trim R2 or use a trimmer pot in series with R2 as mentioned earlier.
....and perhaps use something better than an electrolytic ? Something that's not an electrolytic but is not a micro either Poly film caps maybe ? No expert.
Dannyx is offline   Reply With Quote
Old 10-29-2017, 04:46 PM   #17
eccerr0r
Solder Sloth
 
eccerr0r's Avatar
 
Join Date: Nov 2012
City & State: CO
My Country: USA
Line Voltage: 120VAC 60Hz
I'm a: Hobbyist Tech
Posts: 4,219
Default Re: 555 countdown timer design question

Chances are you will need to use electrolytics for RC in the 1 minute range because if using a poly cap of even 1F, your resistances will end up being 51M+ ohms, of which IC pin leakage may become an issue.

For 1 minute RC constants I'd probably need to look into 100F timing capacitors to pull the charge resistor down to something more reasonable. However I'd be a bit worried about going too big and the energy stored in the capacitor destroys the discharge pin...
eccerr0r is offline   Reply With Quote
Old 10-29-2017, 05:20 PM   #18
petehall347
Badcaps Veteran
 
Join Date: Jan 2015
City & State: worcester
My Country: United Kingdom
I'm a: Knowledge Seeker
Posts: 1,751
Default Re: 555 countdown timer design question

have you thought of one of these ?
petehall347 is offline   Reply With Quote
Old 10-29-2017, 06:40 PM   #19
stj
Great Sage 齊天大聖
 
stj's Avatar
 
Join Date: Dec 2009
City & State: Europe
My Country: some shithole run by Israeli agents
I'm a: Professional Tech
Posts: 21,066
Default Re: 555 countdown timer design question

vac-switch.
not seen one of those for a while!
stj is offline   Reply With Quote
Old 10-30-2017, 12:37 AM   #20
Dannyx
CertifiedAxhole
 
Dannyx's Avatar
 
Join Date: Aug 2016
City & State: Constanta
My Country: Romania
Line Voltage: 230VAC 50Hz
I'm a: Hardcore Geek
Posts: 2,475
Default Re: 555 countdown timer design question

Quote:
Originally Posted by petehall347 View Post
have you thought of one of these ?
Not remote controlled I reckon...
Dannyx is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Badcaps.net Technical Forums 2003 - 2019
Powered by vBulletin ®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
All times are GMT -6. The time now is 07:28 PM.
Did you find this forum helpful?