## How do I figure out how big a cap I need?

General project help for Adafruit customers

### How do I figure out how big a cap I need?

Hi All...

I am trying to build a board with a super capacitor that will keep it up for several seconds after the power goes away. This is because the device is logging data to an SD card and I need to detect that power went away, and then close the files on the SD card gracefully. I am thinking a super cap will hold my board up for a second or so, giving me time to close the files.

But, after lots of googling, I have not learned much. My device accepts 12V to 14.7V in and uses a 5V regulator to make 5V. Some of the board uses 5V and there is also a 3.3V regulator for the SD card, which needs 3.3V. So there is 12V in to a 5V regulator which then feeds a 3.3V regulator.

I did see that I should use a 5.5V cap down stream of the 5V regulator and upstream of the 3.3V regulator, because super caps don't come in much higher voltages. If I needed to put the cap on the 12V line then I would have to string caps together which reduces their capacity.

But I don't know how to figure out the value of the cap that is needed based upon current draw and how much time I want to stay up.

Any help?

Thanks...
jarcher

Posts: 40
Joined: Sun Mar 27, 2011 1:49 am

### Re: How do I figure out how big a cap I need?

To start with, you need to know how much current your board draws. If there is no spec sheet for it, you will have to measure it with a multimeter.

Posts: 15982
Joined: Sat Feb 07, 2009 9:11 am

### Re: How do I figure out how big a cap I need?

adafruit_support wrote:To start with, you need to know how much current your board draws. If there is no spec sheet for it, you will have to measure it with a multimeter.

Oh, I know that. Measuring at the 12VDC input, it will draw between 170mA and 230mA, depending upon which LEDs are lit.
jarcher

Posts: 40
Joined: Sun Mar 27, 2011 1:49 am

### Re: How do I figure out how big a cap I need?

Posts: 15982
Joined: Sat Feb 07, 2009 9:11 am

### Re: How do I figure out how big a cap I need?

Hm, that seems very specific to Maxim RTC chips... I'm not sure how to translate those parameters to my application. I put the current and such in, and it said 0 hours. I suspected it was a rounding issue, so I lowered the current consumption from 240,000,000 banned to 30,000 banned and got some numbers. I read the app note, and it talked quite a bit about keeping a RTC chip up.
jarcher

Posts: 40
Joined: Sun Mar 27, 2011 1:49 am

### Re: How do I figure out how big a cap I need?

Yea, that one is for long-term backup of low-current devices.
This one might be more applicable. But it does require a spreadsheet:

Posts: 15982
Joined: Sat Feb 07, 2009 9:11 am

### Re: How do I figure out how big a cap I need?

Dimensional analysis is your friend. A Farad is a coulomb per volt. An Ampere is a coulomb per second.

To figure how much capacitance is needed, you've got to know how much charge (coulombs) must be delivered, and how much the voltage is allowed to sag while delivering the charge.

To figure the charge, multiply amperage times seconds to get coulombs. If it needs 200mA for 2 seconds, that would be 200mA*2s * 1A/1000mA = 0.4 coulombs

Suppose the capacitor starts at 12V, and is allowed to sag down to 7V before your regulator drops out (you'll need to verify the allowable lower limit on your voltage; you haven't given that). That would mean the voltage can sag 5V while the capacitor delivers 0.4 coulombs. The required capacitance is 0.4coulombs/5V = 0.08F

To guarantee things work right, you'll want to analyze the worst case. Look at the longest time required for saving data, highest current draw during that time, lowest voltage that triggers your "save everything, we're going down" routine, and highest input voltage on your regulator that could cause problems due to dropout issues. Add a safety factor, and look at the tolerances on your capacitors.
uoip

Posts: 127
Joined: Wed Sep 23, 2009 4:48 pm

### Re: How do I figure out how big a cap I need?

I generally use this to estimate the cap size:

http://www.ehow.com/how_7432556_calcula ... tance.html

The key is the voltage drop as the cap discharges. If you can put a buck/boost converter in the path, you won't need as big of a cap since you aren't trying to hold a 5V rail at 5V.

JamesC4S

Posts: 114
Joined: Sun Sep 26, 2010 10:49 pm
Location: Austin, TX