Resetting a 555 Astable circuit - Page 1
Forum section: electronics / beginners

author: Pulse Cloud
author_rank: Contributor
timestamp: September 03, 2011, 04:41:58 pm
content: Greetings.I have a simple 555 astable circuit with a 16 seconds Mark (HIGH) and a 0.3 seconds Space (LOW):Pic.I want to reset the circuit every time I feel like resetting it. This means that every time I press a button or send an electric signal, I want the 16 second HIGH countdown to go back to 0 and start again.This means that if the output has been HIGH for 10 seconds and I press the button, the output will be LOW in 16 seconds and, when that happens, I can say that the output was HIGH for 26 seconds.According to the first image inthis page, the way this can be done is by fully discharging the timing capacitor (C1 in that page's image and C2 in the image I linked to above).Using the Reset pin makes the output go LOW, which isdefinitelynot what I want.So here is my question: how do I discharge that capacitor?Willthiswork (the point is: I send a 5V signal from an Arduino, or something else)?I am effectively short-circuiting the capacitor - is it... well... bad?Thank you!Off topic rant: why does Altium Designer not have a schematic or PCB image exporter? With EAGLE you can even set the resolution in DPI!

author: IanB
author_rank: Super Contributor
timestamp: September 03, 2011, 04:48:31 pm
content: Discharging a big capacitor through a transistor will not be good for the transistor (100 uF is big). You could rescale your values to have a smaller timing capacitor and bigger timing resistors, and/or put a resistor in series with the transistor to moderate the discharge current to a safe value.

author: Pulse Cloud
author_rank: Contributor
timestamp: September 03, 2011, 05:00:06 pm
content: Is 10uF big?Having a 10uF C2 means having a 2.2M R1 and a 43K R2. Won't there be a problem of insufficient current with those resistors?What resistor would you recommend putting in series with the transistor? Will a 1K work? 10K? 1T?But that second schematic will work, right? Placing a transistor there will, in fact, do what I want. (<-- that's a question)Thank you, Ian.

author: IanB
author_rank: Super Contributor
timestamp: September 03, 2011, 05:06:30 pm
content: You may be right about the capacitor and resistor sizes and insufficient current. I'm not expert in this so I just reviewed the datasheet for the 555. It looks like you don't actually need to discharge the timing capacitor yourself. All you need to do is take pin 2 low for long enough to reset the timer. The 555 will then discharge the capacitor itself via the discharge pin and R2.So putting the transistor where you put it is correct as it will take pin 2 low which is what you want. What is not so good (perhaps) is that it will short circuit C2. I'm not quite sure if there is enough energy in that capacitor to damage the transistor but it seems like a possibility. But maybe not. Maybe I'm just thinking up a problem that isn't going to be an issue.

author: IanB
author_rank: Super Contributor
timestamp: September 03, 2011, 05:14:26 pm
content: Quote from: Pulse Cloud on September 03, 2011, 05:00:06 pmI think you could leave the capacitor at 100 uF and put a 100 ohm resistor in series with the transistor. 100 ohms at 5 V will limit the maximum current to 50 mA which should be safe for the transistor and still give a good reset signal on the trigger input.

author: Pulse Cloud
author_rank: Contributor
timestamp: September 03, 2011, 05:16:03 pm
content: A member of another Forum said "Nope, not bad to discharge the cap."I guess I'll just build the circuit with the added 100ohm resistor and leave it on for a couple of hours. If it still works then there's no problem.Thank you again, Ian.If another member would like to leave his opinion on how to achieve this, please do so!

author: IanB
author_rank: Super Contributor
timestamp: September 03, 2011, 05:25:02 pm
content: Quote from: Pulse Cloud on September 03, 2011, 05:16:03 pmIt's true, it's not bad for the capacitor at allThe general concern (which may not be a concern in this actual instance) is that when you discharge a capacitor through a low resistance path you will tend to get a very large current of short duration as the capacitor dumps all its stored energy. In general you need to make sure your discharge path can handle the peak current without damage.I recently discovered this when I discharged a charged 300 V capacitor through a 10k 1/8 W resistor and got that interesting burning smell of a resistor being toasted. Oops...

author: Pulse Cloud
author_rank: Contributor
timestamp: September 03, 2011, 05:47:44 pm
content: I checked the 2N2222 datasheet and discovered thatthe peak collector current is 800 mAand the peak base current is 200 mA.The 100ohm resistor seems to be imperative for my circuit!You've just saved a transistor, Ian.Also, better the smell of a resistor than the smell of your flesh.

author: Zero999
author_rank: Super Contributor
timestamp: September 03, 2011, 06:17:31 pm
content: 100uF charged to 5V is onlu 1.25mJ of energy. I imagine a small transistor should be able to handle it. TheBC337will certainly be fine as long as you select a base resistor which will limit the peak collector current to under 1A. This can be calculated using the Hfe figures, for example the BC337-16 has a minimum gain of 40@500mA, the maximum gain will be 2.5 times going from the other minimum vs maximum values specified so we can safely assume 100, so for 500mA of collector current, the base current should be 5mA which gives Rb = (5-0.8)/0.005 = 840R so use 1k for Rb and all will be well.What about using a small SCR to discharge the capacitor?It should be able to handle the current surge from a 100uF capacitor with no trouble and jut needs a single trigger pulse. If you're paranoid include a 1R resistor in series with the SCR but it shouldn't be necessary.Here's a list of suitable parts:TICP106NTE54002N5060MCR100

author: Pulse Cloud
author_rank: Contributor
timestamp: September 03, 2011, 09:46:18 pm
content: @Hero999: Where did you get those 0.8V in the Rb calculation?Is it just me, or the 2N2222 datasheet lacks the necessary data to do such calculations?The output of the 555 timer will be connected to a pin of an ATmega328 - the Reset pin.According to the "Absolute Maximum Ratings" on page 317 of theATmega328 datasheet, the maximum "DC Current per I/O Pin" is 40mA. I don't know if the Reset pin qualifies as one, but if it doesn't, it surely won't have a lower maximum current rating.How can I make sure the current in the Reset pin of the microcontroller, supplied by the Output pin of the 555, is lower than 40mA, say, 10mA?Can I just add a 510 ohm resistor in series? Like so: Output ->-----/\/\/\/\----->- Reset

author: IanB
author_rank: Super Contributor
timestamp: September 03, 2011, 10:00:42 pm
content: I think the 0.8 V in the Rb calculation comes from the Base-Emitter Saturation Voltage, VBE(sat) on the datasheet (= 0.6 V). This value is typical for NPN transistors.The reset pin on a device will usually be voltage sensitive, it will not source or sink any significant current. So you just have to provide the right voltage (high or low) as described on the datasheet.

author: ejeffrey
author_rank: Super Contributor
timestamp: September 03, 2011, 10:36:05 pm
content: Quote from: Pulse Cloud on September 03, 2011, 09:46:18 pmThe reset pin is an input, and like most CMOS inputs draws negligible current. I don't know the spec for the reset pin, but the normal inputs draw only nanoamps of current, or a few hundred microamps if the internal pull-up resistors are enabled. The maximum current rating of 40 milliamp is the maximum amount of current you are allowed to draw from the outputs.TL;DR: You don't need to do anything, just connect the output of your 555 to the reset pin.

author: Pulse Cloud
author_rank: Contributor
timestamp: September 03, 2011, 11:19:42 pm
content: Hero999, Ian and Jefrey, thank you all.Because I have already designed the PCB for a TO-92 transistor, I think I'll stick to the 2N2222 and replace the 100ohm resistor for a 1k resistor.Here's how I thought (this is the Beginners forum, so if you see a mistake please say so so I can learn!):The only Min/Max pair of Current Gain displayed in the 2N2222 datasheet is on page 4, with the values IC= 150 mA; VCE= 10 V; Min = 100; Max = 300.Bellow we can read that at IC= 500 mA and VCE= 10 V, the minimum Gain is 30. Because of the previous min/max gives us a relation of Max=3*Min, we apply the same to our value, so the maximum gain at 500mA is 90.That means that the current in the base has to be 500mA/90, which we'll round to 5mA. // Why would we want half a friggin' Amp in the collector?! Just to waste battery?Now to calculate the resistor to be placed in series with the base, which will also limit the current in the collector, we do (5-0.8)/0.005 = 840 ohm, and we'll use a 1K resistor to keep things simple.Have I done Science?Is this how one uses datasheets? I've only used them to see the pin mapping of components - I never really understood what all those values meant.Is there something like a Noob's Guide to Reading Datasheets?Here's the updated schematic:pic.Any critics? Suggestions? Warnings?

author: IanB
author_rank: Super Contributor
timestamp: September 03, 2011, 11:50:41 pm
content: Your circuit looks OK to me. Basically a transistor works a bit like a current amplifier. If you feed 5 mA into the base, then that current multiplied by the gain (e.g. 100) is the current that will flow through the collector, perhaps 500 mA. This is why transistors are useful, they can amplify a small signal into a bigger signal.I guess you are building a kind of watchdog timer on your Arduino? If the Arduino stops working and fails to keep the 555 going, the Arduino automatically gets reset.So a deeper question is why might your Arduino lock up? Could you perhaps have a programming error you need to fix?

author: Pulse Cloud
author_rank: Contributor
timestamp: September 04, 2011, 12:19:21 am
content: Quote from: IanB on September 03, 2011, 11:50:41 pmThat is exactly it.In the project I'm working on I used to have quite some errors - it would rarely lock up, though -, but now I've reprogrammed it and it hasn't had any error at all.I just want the Watchdog because the project will be used in a friend's factory, so having it reset whenever something bad happened is a feature I think is important. It's not likely that the Arduino will ever need it, but it's there just in case.Also, it's proven to have been a valuable learning experience!Thank you again!