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.

  1. Fully discharge the battery decrease risk in case of accidental short circuit during disassembly. This is the safest to avoid fire risk.

  2. Follow a teardown guide to open the phone and remove the battery

  3. Carefully remove the yellow kapton tape from the top of the battery

  4. Flip over the BMS board to expose the folded battery cell contacts

  5. 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

  6. Note down the polarity symbols (+ and -) written on the battery to know the BMS contacts polarity

  7. 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.

  8. Strip both ends of the two cables

  9. Tin one end of both cables and solder them to the BMS board, following the battery polarity

  10. Screw the other end of the cable to the screw terminal, matching the polarity marked on the PCB socket

  11. Use some insulation tape to cover the BMS exposed contacts

  12. Connect the BMS to the DUT motherboard again

  13. (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

  1. Connect the device to the power supply with the BMS connected to the DUT motherboard, but not to the phone harness.

  2. 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.

  3. 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.

UART and Buttons (VDUT)

If you know the values of these via schematics or similar, you can skip this section.

  1. Connect the device to the power supply with the BMS connected to the DUT motherboard, but not to the phone harness.

  2. Measure the voltage on the UART and button contact points. They should be identical. Annotate the voltage.

(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.

  1. 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.

  1. Note down the DUT UART cable colors corresponding to TX, RX, GND.

  2. Strip and cut the wire ends to avoid shorting nearby contacts on the phone.

  3. Figure out the wire positioning before soldering them

  4. 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)

  5. Confirm with a multimeter that the wires make contact with the testpoints

  6. Add a drop of hot glue on the wires near the testpoints to avoid mechanical stress that can break the testpoint pads.

  7. Secure the rest of the wire to the phone using hot glue or isolating tape

(Optional) Connect the buttons

Button control is not required to run tests, though it can be useful for userspace testing: e.g. testing screen lock and volume change. If you want to start quickly, you can skip soldering the button pins.

  1. Locate the button testpoints of your phone: you can use a multimeter to check for a testpoint that changes voltage when you press the button with the phone turned on. Note down the polarity and voltage as they will be needed for the firmware configuration.

  2. Note down the DUT buttons cable colors. You will need to solder the DUT_VDN wire to the Volume Down testpoint, DUT_VUP on the Volume Up testpoint, and DUT_PWR+ and DUT_PWR- respectively on the higher and lower voltage tespoints corresponding to the two sides of the Power button. Make sure to follow the polarity of DUT_PWR+/- pins. DUT_GPIO can be used to drive an additional button, but it is not required.

  3. Strip and cut the wire ends to avoid shorting nearby contacts on the phone.

  4. Figure out the wire positioning before soldering them

  5. 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)

  6. Confirm with a multimeter that the wires make contact with the testpoints

  7. Add a drop of hot glue on the wires near the testpoints to avoid mechanical stress that can break the testpoint pads.

  8. 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.

phone-harness port description

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:

  1. Download the tested microPython version for the Raspberry Pi Pico. Testing later versions is possible, but it might not be tested.

  2. Connect the phone-harness HOST USB port to your computer, a Mass Storage Device should appear (UF2 bootloader)

  3. Copy the microPython file to the Mass Storage Device, it will disconnect automatically as the board reboots

  4. If your device has not yet been tested, create a new file under firmware/devices with your device codenames, and modify the values of the different varibles accordingly.

  5. Flash the firmware to the phone harness, by running DEVICE=device-code make flash from the firmware directory in this repository. device-code is the code of the device under the firmware/devices folder in this repository that defines the relevant configuration for the device.

To test that the firmware behaves as expected:

  1. Connect the PDU to the power and to the DUT.

  2. Install tio from your favorite package manager

  3. Run DEVICE=device-code make run. You should now be connected to the PDU. Run HELP or STATUS commands to get more details, and test that you can power on and off the device with the POWER command.

  4. If you want to access UART logs from the device, you can run make device in 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.