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.
Discharge the battery below 25% 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 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 microPython for the Raspberry Pi Pico
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
Flash the firmware to the phone harness, by running
make flashfrom thefirmwaredirectory in this repository.
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
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 continue with the CI-tron setup.
CI-Tron usage¶
Follow the CI-Tron installation guide.