IntroductionDo-it-yourself artificial pancreas system (DIY APS) is built using commercially available insulin pump, continuous glucose monitoring (CGM) and an open-source algorithm. Compared with commercial products, DIY systems are affordable, allow personalised settings and provide updated algorithms, making them a more promising therapy for most patients with type 1 diabetes mellitus (T1DM). Many small and self-reported observational studies have found that their real-world use was associated with potential metabolic and psychological benefits. However, rigorous-designed studies are urgently needed to confirm its efficacy and safety.Methods and analysisIn this 26-week randomised, open-label, two-arm, two-phase, crossover trial, participants aged 18–75 years, with T1DM and glycated haemoglobin (HbA1c) 7–11%, will use AndroidAPS during one 12-week period and sensor-augmented pump during another 12-week period. This study will recruit at least 24 randomised participants. AndroidAPS consists of three components: (1) real-time CGM; (2) insulin pump; (3) AndroidAPS algorithm implemented in Android smartphone. The primary endpoint is time in range (3.9–10.0 mmol/L) derived from CGM. The main secondary endpoints include percentage of sensor glucose values below, within and above target range; mean sensor glucose value; measures of glycaemic variability and centralised HbA1c. Safety endpoints mainly include the frequency of hypoglycaemia events, diabetic ketoacidosis and other serious adverse events.Ethics and disseminationThis study has been approved by the Ethics Committee of the Third Affiliated Hospital of Sun Yat-sen University. There will be verbal and written information regarding the trial given to each participant. The study will be disseminated through peer-reviewed publications and conference presentations.Overall statusRecruiting.Study start11 February 2023.Primary completion31 July 2024.Trial registration numberClinicalTrials.gov Registry (NCT05726461).