blog

Custom laptop charging: adding a USB charging port and module

by snm, December 16th, 2017

Continuing from Custom laptop power management: external activity, power on button, graceful power off, hard power switch.

micro USB cable Y splitter for external charging port

The Morphie juice pack I am using for this laptop battery has a female micro USB port for charging, and a female USB-A port for powering. The power port has to plug into the Raspberry Pi board to run it, but then the charging port isn’t accessible on the outside of the laptop cardboard box. So I purchased this micro USB cable:

It arrived after some time. One end of the cable is female micro USB, and it splits into two cables: the longer cable is for data and charging, the shorter is for charging only. I tested by plugging the female side into a charger, then each of the male ends into the battery pack: both succeeded in charging it. And I was able to power two devices at the same time, thanks to this splitter.

Y splitter cable

Cut a hole for the female port, to allow docking the laptop to charge the battery externally:

Cut micro USB female charging port hole

Lithium battery charging module

Also bought a lithium battery charger, 1PCS 5V TENSTAR ROBOT 1A Micro USB 18650 Lithium Battery Charging Board Charger Module+Protection Dual Functions TP4056. It uses a TP4056 1A Standalone Linear Li-lon Battery Charger with Thermal Regulation. Accepts micro USB charging input or +/- terminals, then outputs to B+/B- battery terminals and OUT+/- output:

TP4065 Lithium Battery Charging Board

Without a battery (need to acquire a 18650 lithium battery to charge), tested this charger board only plugged into USB power: Measured 5.1 V on the input:

Charger module USB input voltage

and about 4.112 V on the outputs:

Charger module OUT output voltage

Is it possible to undervolt the Pi, running it on less than 5 volts?

Attached a capacitor to the battery terminals, with large capacitance (1 F) the charge and standby LEDs would continuously alternate. Used a smaller 47 µF capacitance (rated for 50 V) and it seemed to be more stable:

Capacitor on charging board

Not sure if this is a good idea, but the battery charger is supposed to supply constant current and shutdown when current drops to a minimum value. Without a battery, the charge LED quickly yet dimly flashes, so I didn’t want to leave it open. In any case, for now I’m using the battery charger board as a dumb micro USB adapter, since I don’t have a battery and the output is less than the 5 V the Pi requires.

Put the charger board in the laptop, plugged into the Y splitter charger port. The other side of the Y splitter plugs into the Morphie juice pack, so external battery power both charges the juice pack and powers the Pi (via the lithium ion charging board, which I’m not using for charging at the moment, only for the micro USB port):

Y splitter to battery and board

Plug in external USB power to the micro USB port, the Pi powers up:

Powered up externally powered Pi

Front panel external power/charging LED

There’s a small problem. The charger board has a blue “charging” LED, but it is on the module which I put inside the laptop, so it isn’t visible on the outside. To fix this, soldered a cable across the LEDs and broke it out to the front panel:

Front panel blue LED

This LED joins the other front panel LEDs, now three total:

To switch to battery power, a cable has to be plugged into the battery and out to the charger port. Eventually I’d like to bring it out directly to the breadboard, but I’m waiting on those micro USB breakouts to do this. Importantly, the charging cable to the battery has to be unplugged or the Morphie juice pack will try to charge itself, intermittently blinking the power indicator, which can’t be good, and it won’t supply power. Making these configuration changes, the system boots up:

Laptop off power

Problems

This “laptop” is getting better, but still has a lot of problems compared to a real commercial production-quality laptop:

Nonetheless, it’s a start.