EEVblog Electronics Community Forum
Electronics => Projects, Designs, and Technical Stuff => Topic started by: technix on June 14, 2015, 07:49:47 pm
-
From time to time I am forced to charge my battery packs from a externally powered USB hub. This made me wonder if I can make some use out of the USB signal lines while drawing lots and lots of juice from the power rail. Then this occurred to me: can I put a USB-enabled microcontroller into it, report the battery health, and maybe implement the USB Power Delivery protocols to allow safe supply of up to 10 (using traditional USB sockets) or maybe even 100W (using USB Type-C) of power.
The idea is to start with the TP4056 Li-ion charger chip (1A charging current maximum, but that is still larger than the 500mA standard USB current limit, so negotiation is still required), a digipot, and a USB-enabled microcontroller like ATmega32U4.
When power is applied to the device, the micro keep the battery from charging until it either finds out that it is connected to a wall charger, or it have negotiated with the power source over some protocol (supported: USB Power Delivery for hosts compatible of using this USB 3.0 over USB 2.0, out-of-band using USB Type-C connection, or the protocol used by Apple iPad to coax Macs into pushing extra juice through the USB port), or decided to settle down at 500mA. Then the charging current is adjusted to less than the negotiated current level.
If the micro found out that it is connected to a computer, it can present itself as either a HID or a serial port to allow computer software to monitor and control charging of the battery pack, and if the battery pack is in fact plugged to a USB Type-C port that allows a peripheral to power the host like the one on the new MacBook, to switch the battery pack into back-powering mode.
-
Not tried this, but could you detect the computer by simply watching the USB data lines for some voltage/clock etc?
Program the 4056 to be at say 500mA if a clock/data can be detected otherwise let it go at full 1A.
To force data you could throw a simple USB chip on the power data lines. A CH340 or something cheap.
Maybe just detecting the USB pulldowns on a computer would be enough to work?
Just thinking aloud at the moment. All untested. :D