Hardware Setup

The phone harness can emulate a phone/tablet battery (Up to 16V/5A, tested up to 35W). This is useful to have full control of the device power supply, and avoid potential fire hazards from one of more (old) lithium batteries left to charge for a long time.

This guide will explain how to setup a hardware testing setup using a phone-harness PCB and a phone or tablet.

If you have any questions or want to share your setup, you can join the Hardware CI Matrix channel.

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.

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

  • DUT Phone (Device Under Test)

  • Host computer: compatible with CI-Tron See Target selection

  • Phone Harness PCB

  • Power supply: PD with PPS 3.3V 5A

  • 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)

  • Host cable: USB-C to USB-C/A, USB3 if your phone has USB3

  • DUT BAT connector: Screw terminal 2 pin 3.81 pitch (Phoenix Contact 1803578 or equivalent)

  • DUT USB cable: USB-C to USB-C short cable USB3 if your phone has USB3

  • DUT Buttons cable: JST SH 6 pin 1.0 pitch 10cm

  • DUT UART cable: JST SH 3 pin 1.0 pitch 10cm

The power supply should be capable of Power Delivery PPS 3.3V 5A, double check on the specifications if you are not sure. We recommend the Anker 313 (Ace, 45W) as it’s accurate to 0.1V in PPS mode. Measure the voltage accuracy if using other power supply models.

Phone preparation

Dismantle the battery

We want to eliminate the lithium battery cell, but we need to keep the BMS board that’s attached to it, as the phone won’t work properly without one, and the battery connector is difficult to source.

Read all the steps before following the process.

  1. Discharge the battery below 25% 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

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 microPython for the Raspberry Pi Pico

  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. Flash the firmware to the phone harness, by running make flash from the firmware directory in this repository.

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 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 continue with the CI-tron setup.

CI-Tron usage

Follow the CI-Tron installation guide.