Simple USB UPS

17,805

97

18

This is an very simple circuit to act as a Uninterruptible Power Supply for a usb powered device. I'm using it to prevent reset of Raspberry Pi's during short power flickers caused by high motor current draws on a battery powered system. The circuit I'm using is able to maintain full power to a Raspberry Pi with usb peripherals (a laser mouse and a keyboard) for about 80 seconds after main power loss.


Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Build It!

Parts Required:
- micro USB power cable

- Three (3) 2.3V rated 50 Farad Supercapacitors (this design omits balancing resistors as it relies upon capacitor leakage. If low leakage caps are used, balancing resistors are advised)

- One (1) 10kOhm resistor

- One (1) 4.7V Super Bright LED

- Soldering Iron

- Vinyl Tape

The three supercapacitors were connected in series effectively creating a 6.9V rated 16.33F capacitor and then the LED in series with the resistor were connected in parallel with that. Be mindful of polarity of the LED and the supercaps. Reverse voltage applied to the supercaps and quickly destroy them.

Next a normal usb power cable is cut in the center and the overall jacket and/or shield is striped back two inches on both ends revealing four (4) individual insulated conductors. The red insulated conductor is +Vdc and the black insulated conductor is -Vdc. The blue and white conductors are signal wire. Solder the striped ends of the two red conductors (one from each half of the usb cable) to the positive (long lead side) of the supercap circuit and the two black ends to the negative (short lead side) of the circuit. Tape or reconnect the blue and white conductors.

Solder each connection then wrap each bare conductor and the whole assembly in electrical tape except leaving only the LED exposed. Then the device is complete.

Connect it as you would any normal usb power cable (this is not recommended for devices that use both the signal and the power conductors). Note that there can be quite a lag between the time the cable is connected and it is able to power a device, it may take up to a minute or so for the capacitors to charge up to 5V, the LED will provide indication of charge on the capacitors. Another note: If the fully charged cable is disconnected from power (i.e. unplugged) the LED will remain on until the stored potential drops below its shutoff threshold, this could be quite some time, but is nothing to be concerned about.

1 Person Made This Project!

Recommendations

  • Made with Math Contest

    Made with Math Contest
  • Multi-Discipline Contest

    Multi-Discipline Contest
  • Robotics Contest

    Robotics Contest

18 Discussions

None
TonyA3

2 months ago

I've had a thought about capacitors in series as power sources - someone please explain. The value of the combination is 6.9V 16.33F, therefore it can supply up to 6.9V at 1A for 16.33s. However each cap is 50F which can supply 2.3V at 1A for 50s, so the series combination ought to supply 6.9V at 1A for 50s. Which answer is correct and why?

8 replies
None
TonyA3idontlikeregs

Reply 2 months ago

This explanation is good, up to a point. I already know about the combined value of caps in series, and this article tries to explain a bit more about about how the charging current has to come through the plates of the adjacent capacitor. However, it still doesn't quite explain the fundamental problem - if each cap charges up to 1/3 of the total supply, then each cap should be able to supply 1A for 50s, and the series result should be 5V at 1A for 50s. The answer is something subtle about the fact that the charge on each capacitor has to flow through the other two, so presumably one could get V/3 from each cap with a direct DC connection to the cap giving 1A for 50s, but only 1A for 16.6s when that current has to flow through 2 more caps.
There's a lot more to understanding this than simply following the formula.

None
idontlikeregsTonyA3

Reply 2 months ago

It does indeed explain the "fundamental problem". If you say "charge up to 1/3 of the supply", I guess you mean to 1/3 of the voltage of the supply. The supply has an (theoretically) unlimited amount of charge Q that can be fed to the capacitor as long as there is a voltage difference between the supply and the capacitor. You can charge the capacitor with an amount of charge Q until the voltage is same as the supply, i.e. no current is flowing anymore (the charge corresponds to the time integral of the current (current = flowing charge). The stored amount of charge (excess charge) will then be Q=V*C. This means: The bigger the capacitor plate area (increasing capacitance), the more charge it needs in order to generate the same voltage. And the farther away the plates are (decreasing capacitance), the less charge it needs for the same voltage. If you connect 3 identical capacitors in series, it's the same as if you had one single capacitor with the same plate area but three times the distance between them. So the charge stored in the system (the 3 caps in series) will be Q=V*C/3, where C is the capacitance of a single of those 3 caps. In our example this would be 6.9 V * 50/3 F = 6.9 V * 50/3 As/V = 115 As. As the charge is the same on every capacitor (Qtot = Q1 = Q2 = Q3), this means that every capacitor holds an excess charge of 115 As at 2.3 V.

If you charge one single cap with a power supply of 2.3 V, you will still have a charge of 2.3 V * 50 F = 115 As. If you now reconnect all 3 in series, you get 6.9 V but still 115 As (I was wrong on this in my last comment, that's why I deleted it). Yes, every capacitor has 115 As excess charge but it does not accumulate for the whole system as you need the excess charge in every capacitor to be able to push the whole charge through the circuit at 3 times the voltage.

So everything holds: If you have one single capacitor of 50 F at 2.3 V, you have 115 s at 1 A (but starting at 2.3 V!) and if you have 3 capacitors of 50 F in series at 6.9 V, you still have 115 s at 1 A, but this time starting at 6.9 V! If you had a voltage converter without any losses to transform 2.3 V to 6.9 V you only would have 115/3 s starting at 6.9 V, 1 A with a single 50 F capacitor and not 115 s. This is IMHO the error in your assumption.

Let's have a look at the energy stored in the capacitor: E = (1/2)*Q*V. In the case of a single capacitor at 2.3 V we have 0.5*115*2.3 = 132.25 J. In the case of three capacitors in series we have 0.5*115*6.9 = 396.75 J, three times the energy stored in the single capacitor case.

Now, why is the charge the same on every capacitor? Because the current (flowing charge) into and out of every capacitor has to be the same, as they are all on the same current path. So the same amount of charge enters and exits the whole system, the three capacitors, as well as the same amount of charge enters and exits one single of them. By pushing negative charges onto the negative plate and pulling negative charges out of the positive plate, an electric field arises between the plates proportional to the amount of charge and inversely proportional to the capacitance. This is where the energy is stored.

Now, as a thought experiment, we could think about what would happen if you charge only one single capacitor of those three to 2.3 V and connect it in series with the two other ones (which are now discharged). The discharged ones act like a short (0 Ohm) in initial state, so we would still have 2.3 V but then, when we would connect a load and a current would flow through them, charge would accumulate on the plates and a voltage would arise (while it diminishes on the first one). If the "load" was an ideal wire (zero resistance), the charge would then be distributed evenly onto the 3 capacitors, supposedly keeping the total energy constant. But E1 = 0.5*115*2.3 is not equal to E2 = 3*0.5*38.3*0.76. This is called the "two capacitor paradox". The transfer cannot happen without "losses" (or rather conversion to other energy forms like heat) because of things like the non-zero resistance in the cables (preventing infinitely big currents). See here: https://en.wikipedia.org/wiki/Two_capacitor_paradox

None
TonyA3idontlikeregs

Reply 2 months ago

Ps that two capacitor paradox link is also something I have not been aware of - fascinating!

None
TonyA3idontlikeregs

Reply 2 months ago

Hi idontlikeregs

This is a great bit of explanation that I will have to chew over for a while, and perhaps is now getting outside the normal level of comment seen on Instructables. It's great to stretch my 72 year old brain with concepts that I have never seriously thought about on components that I have used most of my life. I run a Wimshurst machine at my local Hackspace in Leicester, UK, and when I explain how it works to people, I often talk about pulling apart of capacitor plates where a fixed charge causes the voltage to increase - that was taught us in basic physics at school, but capacitors in series is quite a bit more complex, as you are pointing out.

Tony

None
jwhart1TonyA3

Reply 2 months ago

Q=VC, dQ/dt=I.

For one capacitor, an injection of 1A for one second is 1 coulomb of charge so 1=C x deltaV and deltaV = 1/C

For two caps in series, that same one coulomb of charge gives deltaV1 = 1/C1 and deltaV2 = 1/C2 so net voltage rise is deltaVtot = 1/C1 + 1/C2.

None
UlrichB1

2 months ago

Your capacitors have slightly different capacities. This leads into slightly different voltages at each of the three capacitors. After discharging they have different residual charges. This residual charge is added to the fresh charge and the capacitors have different voltages. May be this exceeds the voltage limit at one of the capacitors.

You should put a resistor e.g. 10 kOhm in parallel to each of the capacitors. This makes shure that all of them will be discharged totally. May be a total of 6.9V is big enough that there is no problem.

If you use accumulators this is done by a load balancer. But in this case some resistors will do the job.

1 reply
None
jwhart1UlrichB1

Reply 2 months ago

These capacitors have significant leakage and a significantly higher voltage rating then is necessary. I used this device for many years, and it still works.

None
idontlikeregs

2 months ago

Caution! You may break your USB power supply with this circuit as you don't have a current limiting resistor. These supercaps have an ESR in the range of 15 mOhms, so 3 in series add up to 45 mOhms, let's assume 0.5 Ohms for a 3 feet 28 gauge charging cable. Total resistance: 0.55 Ohm. So when the supercaps are discharged, you effectively short the output of your USB charger. Some chargers may handle this well (current limiting, which explains the long time for charging the supercaps), other will just break or burn...

2 replies
None
idontlikeregsidontlikeregs

Reply 2 months ago

Ah and don't forget that there are manufacturing tolerances for the supercaps which could lead each one to charge at a different rate in this circuit. This could allow a cap to charge to a voltage above rating.

None
idontlikeregsidontlikeregs

Reply 2 months ago

If you still want to do this kind of experiments without additional circuit (balancer, buck/boost converter, current limiter, etc) in a slightly safer way, you are better off connecting multiple 6V-rated supercaps in parallel (e.g. 10 x 5 Farad, 6 Volts, digikey 478-11310-ND) with a current limiting resistor in series (e.g. 5 Ohm, 5 Watt to allow 1 A).

None
seawalker

3 years ago

Excellent idea. I have been looking for this kind of thing for a long time now.
Although you have described the connections rather well, would you be so kind and make a small circuit diagram for it.
Many thanks!

None
MaryJ60

3 years ago

What I'd like to see is a development of this idea.

Something that could take power from a 5W solar panel for charging (up to 24v despite being a nominal 12v) for charging.

Then to have the capacity to charge a phone, MiFi pad and a tablet several times.

I'm building a motorhome and such a device would totally eliminate any need for batteries or generators and I'm at the stage where I don't yet have an internal electrical system.

None
gearup500

4 years ago on Introduction

I think that putting the LED is cool because it's good for knowing if you power supply has charge on it. Although I don't mess around when it comes to plugging things into computers this is a good instructable; I wish I had thought of this.

None
Wired_Mist

4 years ago on Introduction

Not a bad Idea. For a quick backup while switching power sources this could work great !