Connecting Devices¶
This guide will explain how to prepare a phone or tablet setup a hardware testing setup using a phone-harness PCB and a phone or tablet.
Warning
The process involves dismantling the battery and soldering wires to the phone. The process is reversible, but you will need a new battery. Use a dedicated phone for this, as it won’t be easy to make it portable again. A second-hand phone with a cracked (but working) screen is perfect for this and can be cheaper too.
Required Tools¶
Multimeter
Soldering iron with fine tip
Lead-free soldering tin
(Optional) Flux
(Optional) Desoldering braid
Clippers or electrician’s scissors
Isolating tape
Hot glue
Components¶
For a full setup you will need the following components:
Phone Harness PCB
DUT (Device Under Test)
Host computer: to control the PCB and the DUT
Host cable: USB-C to USB-C/A, USB3 if your phone has USB3
Power supply: The power supply should be capable of Power Delivery PPS 3.3V 5A
Important
We recommend the Anker 313 (Ace, 45W) as it’s accurate to 0.1V in PPS mode. Make sure to measure the voltage accuracy if using other power supply models to make sure it is within specs.
Power cable: USB-C to USB-C e-marked 5A (might be sold as 100W). A shorter cable is better to avoid excessive voltage drop (recommended: 0.9m)
DUT USB cable: USB-C to USB-C short cable USB3 if your phone has USB3
DUT BAT connector: Screw terminal 2 pin 3.81 pitch (Phoenix Contact 1803578 or equivalent)
(Optional) DUT Buttons cable: JST SH 6 pin 1.0 pitch 10cm
Depending on your device, you will also need, one of:
DUT UART cable: JST SH 3 pin 1.0 pitch 10cm
USB-Cereal Board and USB-C cable: for devices like the the Google Pixels, which expose UART through the SBU pins in the USB-C of the device.
Tested Devices¶
These devices have already been connected by somebody in the community. Their configuration is already tested, and there is documentation available. If you have one of these devices, you might be able to skip some of the steps, but we recommend reading the specific device page to read about any possible quirks or untested features
Tested Devices
Phone preparation¶
Dismantle the battery¶
We want to eliminate the lithium battery cell, but we need to keep the Battery Management System (BMS) board that’s attached to it, as the phone won’t work properly without one, and the battery connector is difficult to source
Warning
This is the highest risk procedure. Read all the steps before following the process.
Fully discharge the battery decrease risk in case of accidental short circuit during disassembly. This is the safest to avoid fire risk.
Follow a teardown guide to open the phone and remove the battery
Carefully remove the yellow kapton tape from the top of the battery
Flip over the BMS board to expose the folded battery cell contacts
Cut the cell contacts one at a time, to avoid shorting them. Cut near the BMS in case you need to solder again the cell
Note down the polarity symbols (+ and -) written on the battery to know the BMS contacts polarity
Prepare two lengths of wire (0.75mm² or thicker), better if black/red colored. Make the cable as short as possible, 10cm usually are sufficient.
Strip both ends of the two cables
Tin one end of both cables and solder them to the BMS board, following the battery polarity
Screw the other end of the cable to the screw terminal, matching the polarity marked on the PCB socket
Use some insulation tape to cover the BMS exposed contacts
Connect the BMS to the DUT motherboard again
(Optional) partially re-charge the battery cell for storage, see below.
It might be useful to hang on to the battery cell and re-connect it to the BMS board to fix situations where the battery management IC has ended up in an unexpected state. Partial re-charge should be done with a power supply that can limit the current (CC charging), up to 30 - 50 % state of charge. 3.6 V is a good target voltage. If you do not have a power supply or Li ion battery charger, then it is recommended to cover the battery cell tabs with tape, and then turning it in for recycling.
Measure voltages¶
Note
When your device has already been tested you can skip this section, as the voltages are already known
VBAT¶
Connect the device to the power supply with the BMS connected to the DUT motherboard, but not to the phone harness.
You should see the DUT detecting the power and showing some signs of life. It will likely be trying to detect and charge the battery.
Measure the voltage in the BMS contacts or the wires attached to it. You might see the voltage oscilate, as the BMS might be trying to detect the battery status and charge. Annotate the maximum voltage you see.
(When applicable) Connect UART¶
The UART pinout is always indicated relative to the host or device it’s marked on. To have a working connection you have to connect the host TX to device RX and host RX to device TX.
Locate the UART testpoints of your phone using a repair guide, your device wiki page or this wiki guide. Note down the UART voltage, it will be needed for firmware configuration. If Tauchgang (U-Boot) is available for your device, you can use the U-Boot console to locate the DUT RX pin.
Tip
Find a heavy object to put on any key of the keyboard, then try touching the test pads that have the voltage of VSOC with the host TX pin until one of them spams the console.
Note down the DUT UART cable colors corresponding to TX, RX, GND.
Strip and cut the wire ends to avoid shorting nearby contacts on the phone.
Figure out the wire positioning before soldering them
Solder the wires on the testpoints by pre-tinning the wires and heating it on the pad (setting the soldering iron to 450dC can help by heating fast and for short time)
Confirm with a multimeter that the wires make contact with the testpoints
Add a drop of hot glue on the wires near the testpoints to avoid mechanical stress that can break the testpoint pads.
Secure the rest of the wire to the phone using hot glue or isolating tape
Connections¶
The ports on the lower side are used to power the board and connection to the host. The ports on the upper side are used to connect the DUT (USB, battery, UART, buttons) and there is an extra USB port (AUX) connected to the internal hub.
Before powering the phone with the phone harness, double check the +BATT voltage on TP2 testpoint. It is safe to enable the BAT output without a phone connected.
To have a minimal setup you will need to connect:
DUT Battery
DUT USB
DUT UART
Host USB
PD Power
Firmware setup¶
In order to use the PDU, the firmware needs to be flashed to it. For that:
Download the tested microPython version for the Raspberry Pi Pico. Testing later versions is possible, but it might not be tested.
Connect the phone-harness HOST USB port to your computer, a Mass Storage Device should appear (UF2 bootloader)
Copy the microPython file to the Mass Storage Device, it will disconnect automatically as the board reboots
If your device has not yet been tested, create a new file under
firmware/deviceswith your device codenames, and modify the values of the different varibles accordingly.Flash the firmware to the phone harness, by running
DEVICE=device-code make flashfrom thefirmwaredirectory in this repository.device-codeis the code of the device under thefirmware/devicesfolder in this repository that defines the relevant configuration for the device.
To test that the firmware behaves as expected:
Connect the PDU to the power and to the DUT.
Install tio from your favorite package manager
Run
DEVICE=device-code make run. You should now be connected to the PDU. RunHELPorSTATUScommands to get more details, and test that you can power on and off the device with thePOWERcommand.If you want to access UART logs from the device, you can run
make devicein another terminal while you power the device on and off.
If the PDU is able to successfully control the device, and it appears in your ports, then you are ready to use the device for prolonged periods of time.