Decoupling capacitor for ATtiny - Page 1
Forum section: electronics / beginners

author: Lee697
author_rank: Regular Contributor
timestamp: September 29, 2019, 09:06:26 pm
content: I have a small circuit I'm testing - very basic.....ATtiny85V, powered by a CR2032 (1, or 2 in parallel). It flashes a morse code sequence to a 3mm red LED, that's it.LED draws approx 2mA when on, ATtiny draws 0.9mA in between.I've just had it run for 240hr continuously to assess battery life, and it appeared to do well - surprisingly it was still functioning, seemingly normally, at 1.7V, although the LED was getting pretty dim.....I wasn't using a decoupling cap in this circuit. I did note Vcc swinging about as the LED flashed.In reading, a decoupling cap should be installed across Vcc/GND, so I'll do this - but what sort of cap, and what value? Battery life is a priority here - should I expect this to degrade battery life? (I'll test it anyway) Cheers!

author: Audioguru again
author_rank: Regular Contributor
timestamp: September 29, 2019, 09:48:55 pm
content: When the battery becomes weak then its high internal resistance causes the LED to be dim. Try adding a 10uF electrolytic capacitor for it to charge when the LED is off and help power the LED when it should be on to make the LED brighter. Then of course the battery life will be reduced.

author: james_s
author_rank: Super Contributor
timestamp: September 29, 2019, 10:08:19 pm
content: a 100nf ceramic capacitor across the power pins as close to the IC as practical is always a good idea. The electrolytic mentioned may also be helpful when using small batteries. So long as the capacitor has a low leakage current it should not affect the battery life.

author: Lee697
author_rank: Regular Contributor
timestamp: September 29, 2019, 10:32:18 pm
content: To test this.... is it mainly just a case of checking the voltage trace at Vcc with the scope, and trying different cap values to flatten it out?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 29, 2019, 11:36:07 pm
content: Yes, in fact that procedure provides more confidence than "whack a 0.1 on it" does.It is very likely that 0.1 will be an adequate value, and best placed at the point of measurement, though.Tim

author: Lee697
author_rank: Regular Contributor
timestamp: September 30, 2019, 12:28:57 am
content: Some pics.... I tried a bunch, up to a 47uF tantalum - 100-200nF of ceramic seemed as good as anything, 200nF ceramic was the flattest by a smidge, especially the background when the LED wasn't on. You can see the length of the LED pulses in the traces. This was whilst running from a single 2032, I started with my Jaycar lab supply, but the scope showed it up, with some pretty nasty wandering about.....

author: gcewing
author_rank: Regular Contributor
timestamp: September 30, 2019, 12:41:44 am
content: It won't do much about the voltage sagging when the LED is on, though. A largeish electrolytic might help, but only if the LED duty cycle is fairly low, otherwise the capacitor won't have enough time to recharge between flashes. If you really want to squeeze out maximum battery life, maybe consider some kind of jewel thief like circuit.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 30, 2019, 01:09:06 am
content: The low frequency content isn't what the capacitor will help with -- that's to be expected, from the cell. As long as it's within the operating range, and doesn't change too quickly (~V/ms??), it's fine.The capacitor helps with high frequency stuff -- you'll see the difference in the 100ns to 10us/div range.Tim