This is really two very, very small hacks smushed together, but I realised I never wrote them up.

In October, I made up a nicely finished version of a hack I’ve used lots of times before: a USB-A plug to convenient 5V output. I put male and female 5V and male and female ground DuPont wires on the end and used heat-shrink tubing to make everything look less bad. The nice woven USB lead that I started with makes everything look a bit nicer, IMHO.

USB to 5V

For Christmas, I got a 5000mAh* Xiaomi battery pack. There’s an asterisk there because it’s 5000mAh at 3.7V, and the actual rating of 3300mAh at 5.1V isn’t mentioned anywhere except on the bottom of the unit itself. About 10% of the capacity of the unit is lost to the boost convertor, which seems alright to me.

Let’s call it 16Wh.

I don’t actually need to charge my phone on the go very often, my sedentary lifestyle means I move from one place where I have access to power, to another. Work, home, coffee shop, transit. But I would like a source of 5V for electronics projects that doesn’t tie me to a desk or a power outlet.

The Xiaomi charger will turn off if it detects that the device it’s charging is “full”. It appears to do this by monitoring the average current draw. My Arduino projects don’t draw enough to keep it on; damn their efficiency.

By experimentation, I found that around 90mA is sufficient to keep the charger on: I just kept trying lower and lower resistors and measuring the current draw with a multimeter until the unit steadily stayed on.

Power sink

I’m using four 220Ω 1/4W resistors in parallel, so we divide the amount of resistance to get 55Ω and then divide that into the 5.1V to get our current draw:

5.1V / (220Ω / 4) = 0.093A

Okay, that’s good enough to keep the charger on. How much heat are we dissipating by doing this?

0.093A × 5.1V = 0.47W

Half a watt! That’s hot enough to cause the current sink to be uncomfortable to touch after a while, but not dangerous, and only half of what the resistors are rated for. This is why I used four larger resistance resistors, rather fewer (or one) lower ohm ones.

I added an LED, itself protected by a current limiting resistor, just to verify when the unit is on. The 1 and 4 pins on the East side of the board are connected to the 5V and ground inputs on the West side, or I can just use the male DuPont wires to power my projects. Simple but useful.