Using a capacitor for a spike in current requirements

Hi All,

This is my first post, please bear with me if I miss a detail.

I have a circuit that has a 5V 500mA power source (USB). The circuit spends 8 seconds in sleep (all sensors off, ATtiny in power down mode) and then wakes up with a watchdog time, turns on a power hungry sensor (2A draw) for about 40ms, and then goes back to sleep.

I believe it is possible to use a capacitor or super capacitor to power this 2A sensor even though the source is only 500mA. My challenge is determine the right capacitor to use.

I did some research I believe I need 0.08 coulombs for the spike, am I not sure what to do with that information.

Thank you.

You're trying to make up for 1.5A of current for 40 ms....

I think you're going to need a super-cap for this - back of eyelid calculations (ie, definition of a Farad) suggests you'll need something around a 1F supercap to avoid unacceptable droop in the supply voltage... I see ~60mV droop by the end of the sensing. If you can take more droop, of course, you can use a smaller super-cap - but a traditional cap would have to be huge to be in the right ballpark.

I did some research I believe I need 0.08 coulombs for the spike, am I not sure what to do with that information.

I'm not sure if that helps because by the time you extract all of the energy out of the capacitor, you're down to zero volts. ;)

And capacitors discharge exponentially so the voltage drops very quickly at first.

If you can charge-up to more than 5V you can get more running-time from it. I've forgotten the equations,* but that's what you need to calculate... You need to calculate the percentage-discharge for a particular capacitor value, a particular current, and a particular time.

  • All I can remember is I = C dV/dt, and I remember the R-C time constant.

Or use a Boost converter to hold the output steady at 5V.
Check the offerings at www.pololu.com, or make your own.

Need a higher current version of a part like this one, maybe one with external switch that can work with a larger inductor.

LTC3525fb voltage_boost.pdf (541 KB)

DVDdoug wrote (in part):

All I can remember is I = C dV/dt, and I remember the R-C time constant.

Capacitor - Wikipedia has this and many other equations.

treadon: Hi All,

This is my first post, please bear with me if I miss a detail.

I have a circuit that has a 5V 500mA power source (USB). The circuit spends 8 seconds in sleep (all sensors off, ATtiny in power down mode) and then wakes up with a watchdog time, turns on a power hungry sensor (2A draw) for about 40ms, and then goes back to sleep.

I believe it is possible to use a capacitor or super capacitor to power this 2A sensor even though the source is only 500mA. My challenge is determine the right capacitor to use.

I did some research I believe I need 0.08 coulombs for the spike, am I not sure what to do with that information.

Thank you.

You're almost there, actually. The most useful form of the capacitor equation for you is: Q=CΔV. For you to pick the size of your capacitor, you need to know how low your sensor 's voltage can get. Does it only work above 4.5V? Well then your capacitor size is: 0.08C / (5V - 4.5V) = 0.16F.

The next problem you have, however, is that if you attach 0.16F directly to the USB +5V it's going to draw a lot of current when it's first attached to the bus. You need to keep it below 100mA when it's first attached, which you can do by charging it through a 50Ω resistor. Note that this makes a long time constant, however. You won't be able to use your sensor for ~30seconds after attaching to the USB.

Actually, the most useful formula is CV=It.

This is of course, the same as Q=CV and Q=It

Let's muse on using a 10 mF capacitor. V (or ΔV if you prefer) = It/C = 1.5 A x 0.04 s / 0.01 F = 9 V. That is not going to work!

So, go to 100 mF - we now drop 0.9 V and that might just be almost tolerable.

Looks like 1 F it is! Will drop 90 mV during the impulse.

Obviously, you cannot use a 50Ω series resistor!

(I think the USB port will survive anyway.)

Paul__B:
Obviously, you cannot use a 50Ω series resistor!
(I think the USB port will survive anyway.)

The closest to 1F I have is a 50F, but this is the message I got when I connected it to VUSB and plugged in the Uno:

usb_error.JPG

Why are you against putting 50Ω between VUSB and the large cap at the input of the sensor that requires 2A for 40ms?

I simulated it here, although I’m really not sure what the confusion is about:
USB_Sensor_Power.png

The cap for the sensor power will take ~30s to initially charge up from the USB, but after that the UNO can use it for 2A/40ms and the voltage will only drop 0.5V. The OP never told us the lower spec for their sensor’s power, but 4.5V is a reasonable guess. After ~20s the capacitor is recharged enough to use the sensor again. What do you see as the problem?

What do you see as the problem?

The original specification was one sample per 8 seconds. You need to charge the capacitor faster to support that sample rate.

MorganS: The original specification was one sample per 8 seconds. You need to charge the capacitor faster to support that sample rate.

I see. I missed that and yes you do need to charge the cap faster to meet the 8s sample rate.

The easiest thing to do would be to decrease the resistor. At that point, however, you're risking however your PC chose to interpet section 7.2.1.2.1 of the USB spec:

7.2.1.2.1 Over-current Protection The host and all self-powered hubs must implement over-current protection for safety reasons, and the hub must have a way to detect the over-current condition and report it to the USB software. Should the aggregate current drawn by a gang of downstream facing ports exceed a preset value, the over-current protection circuit removes or reduces power from all affected downstream facing ports. The over-current condition is reported through the hub to Host Controller, as described in Section 11.12.5. The preset value cannot exceed 5.0 A and must be sufficiently above the maximum allowable port current such that transient currents (e.g., during power up or dynamic attach or reconfiguration) do not trip the over-current protector. If an over-current condition occurs on any port, subsequent operation of the USB is not guaranteed, and once the condition is removed, it may be necessary to reinitialize the bus as would be done upon power-up. The over-current limiting mechanism must be resettable without user mechanical intervention. Polymeric PTCs and solid-state switches are examples of methods, which can be used for over-current limiting.

Generally speaking, voltage sources only have two ways to deal with overcurrent: shutdown or foldback (aka removes or reduces power), and neither of them are particularly good for VBUS. PCs seem to do anything from shutting down the port temporarily to shutting down the port until reboot to current limiting at 100mA even if it takes 30s for the bulk cap to become charged. It is almost certain, however, that you could decrease the resistor to the point where the cap is recharged after 8s yet your particular PC is still happy.

More complex methods of limiting inrush current to a bulk cap are possible, however, the simplest of which would be two resistors and a FET.

treadon: Hi All,

This is my first post, please bear with me if I miss a detail.

I have a circuit that has a 5V 500mA power source (USB). The circuit spends 8 seconds in sleep (all sensors off, ATtiny in power down mode) and then wakes up with a watchdog time, turns on a power hungry sensor (2A draw) for about 40ms, and then goes back to sleep.

I believe it is possible to use a capacitor or super capacitor to power this 2A sensor even though the source is only 500mA. My challenge is determine the right capacitor to use.

I did some research I believe I need 0.08 coulombs for the spike, am I not sure what to do with that information.

Thank you.

2A USB chargers are available, note.

MarkT: 2A USB chargers are available, note.

Heh...yes...very good point.

BigBobby: You need to keep it below 100mA when it's first attached, which you can do by charging it through a 50Ω resistor.

Actually, I just noticed the problem there. Why did you pick on 100 mA? USB ports are capable of supplying 500 mA, so it would be a 10Ω and that might just work.

Of course, the funny thing is that (typically!) our "one shot wonder" OP never rose to the challenge of explaining what this "sensor" requirement for 2 A for only 40 ms was. For all we know he was actually thinking of a TGS-type sensor which obviously requires power all the time. :roll_eyes:

We have been trolled!

This post is bogus. This whole discussion is science fiction.

Paul__B: Actually, I just noticed the problem there. Why did you pick on 100 mA? USB ports are capable of supplying 500 mA, so it would be a 10Ω and that might just work.

Of course, the funny thing is that (typically!) our "one shot wonder" OP never rose to the challenge of explaining what this "sensor" requirement for 2 A for only 40 ms was. For all we know he was actually thinking of a TGS-type sensor which obviously requires power all the time. :roll_eyes:

We have been trolled!

I picked 100mA because that's all a USB device is allowed to draw until it's entered the Configured state. At that point it can request 500mA, but the host isn't required to provide it.

As MarkT pointed out, however, a 2A USB charger would power the sensor without using any huge caps. I've never made a 2A USB charger before. I'd need to read that part of the spec to know how they get 2A.

Why do you guys think that the OP was fake?

BigBobby:
The closest to 1F I have is a 50F, but this is the message I got when I connected it to VUSB and plugged in the Uno:

usb_error.JPG

Why are you against putting 50Ω between VUSB and the large cap at the input of the sensor that requires 2A for 40ms?

I simulated it here, although I’m really not sure what the confusion is about:
USB_Sensor_Power.png

The cap for the sensor power will take ~30s to initially charge up from the USB, but after that the UNO can use it for 2A/40ms and the voltage will only drop 0.5V. The OP never told us the lower spec for their sensor’s power, but 4.5V is a reasonable guess. After ~20s the capacitor is recharged enough to use the sensor again. What do you see as the problem?

Thanks everyone for helping me out, I now have a better idea on how to make the needed calculations.

Does anyone know the name of the above simulation program?

treadon: Thanks everyone for helping me out, I now have a better idea on how to make the needed calculations.

Does anyone know the name of the above simulation program?

That's LT Spice. You can download it here for free (Windows and Mac) -> http://www.linear.com/designtools/software/

It's pretty awesome, especially since it's free.