Two independent events led me to make this.
1) My favourite 6inch micro USB cable got mashed in our overfull glove box on a climbing trip in
France. The micro connector was all bent, but I eventually got around to squishing it back into shape
with pliers. I'd ordered a new one by then anyway so this cable was now spare.
2) A while back I cobbled together a 5v (well, 4.8 I guess...) power supply/charger thing from 4 of those £1 solar garden lights (if you don't know how you should probably stop reading now). It charges the crappy 600mah NiMH batteries internal to them, and I made its output a female USB connector with only the 5v lines are connected. This means that only very simple things would draw power from it. Anything apply or androidy would just sit there, like a dick, connected to 5 Volts but refusing to drink because it's not the special 5 volts that it likes (or it has no idea how much current to draw so plays it safe, but I prefer to think of it as just being a dick).
The way to fix this issue is well documented (https://learn.adafruit.com/minty-boost/icharging http://int3.cc/products/usbcondoms http://www.instructables.com/id/How-to-get-your-iPod-to-charge-with-your-homemade-/) but I am cheap and lazy. Way too cheap to buy an extra thing, and way too lazy to carry it around if I did.
My answer then? I took a scalpel to the USB connector to see if I could bodge a couple chip resistors in there and put 2V on the data lines. A by-product of this is that I end up with the effect of a USB condom, because I'll cut the data lines to avoid pulling the pins low on whatever I plug this into.
I'm not gonna lie, these potted/moulded plugs are a bitch to get through. Took about 15 minutes of delicate hacking and I still nicked the insulation off most of the wires. Nae bother though, once I was clear what I was dealing with I found I could just cut the wire and reterminate from a clean end. It looks like once you get all the rubbery stuff off there's a standard part underneath, Ive seen these parts before, so with any luck this should work on more than one type of cable.
Unless you're a USB guru with the pinout etched on your brain, it's not a bad idea to mark polarity before you cut the wires loose. I used a red dot to save me looking it up later.
Once 4 wires were stripped, cleaned and tinned I had a look how much room there would be inside the plug for a couple of SMD resistors. They will fit but some plastic needs editing. Snips made short work of that. The data lines need shortening too, and their corresponding pins need to be brutalised so there's no chance of them touching later. Again, nothing the needle nose pliers and snips can't handle. Time to connect the power lines to their pins.
Next was the soldering in of the resistors. I chose 80k and 120k for 2V on both lines, which commands a 500 mA charge. It'll always work and it's more than none. (I want this to draw from my solar-charged charger, remember). Could've made it switchable I guess, but meh. Maybe Mk2.
Now all that's left is to beep through everything and close up, adding dabs of hot glue as appropriate.
Now, "Just F****** Charge You Little Bastard!!!"