Patient description: The patient is a 24-year-old man who has had type 1 diabetes for 11 years. He presents to the emergency room with hyperglycemia and concern for possible diabetic ketoacidosis after not taking his insulin for 3 days. The patient reports that he is currently homeless and has lost his supply of insulin, syringes, glucometer, and glucose testing supplies. The patient states that at the time of his initial diagnosis with type 1 diabetes he was hospitalized with a glucose value >1000 mg/dL. At the time, he was experiencing polyuria, polydipsia, and polyphagia. He reports that he has been on insulin since the time of his diagnosis, and he has never been prescribed oral agents for diabetes management. Most recently, he has been using insulin glargine 55 units once daily, and insulin aspart sliding scale 3 times daily. The patient has had previous episodes of diabetic ketoacidosis, for which he was hospitalized. With this episode of hyperglycemia, he is not experiencing any nausea, vomiting, or abdominal discomfort, and he appears well. His lab studies showed: A1c: 11.3% Creatinine: 0.9 mg/dL with eGFR >60 mL/min Aspartate aminotransferase (AST): 17 U/L Alanine aminotransferase (ALT): 14 U/L Beta-hydroxybutyrate: 0.1 mmol/L Bicarbonate: 25 mEq/L Anion

Clinical trial eligibility criteria: eligible ages (years): 21.0-65.0,  Diabetes Mellitus Clinical diagnosis, based on investigator assessment, of type 1 diabetes for at least one year and using insulin for at least 1 year and an insulin pump for at least 6 months for documented hyperglycemia (at least 1 must be met): i. Fasting glucose ≥126 mg/dL ii. Two-hour Oral Glucose Tolerance Test (OGTT) glucose ≥200 mg/dL iii. HbA1c ≥6.5% documented iv. Random glucose ≥200 mg/dL with symptoms v. No data at diagnosis is available but the participant has a convincing history of hyperglycemia consistent with diabetes for requiring insulin at diagnosis (1 must be met): i. Participant required insulin at diagnosis and continually thereafter ii. Participant did not start insulin at diagnosis but upon investigator review likely needed insulin (significant hyperglycemia that did not respond to oral agents) and did require insulin eventually and used continually iii. Participant did not start insulin at diagnosis but continued to be hyperglycemic, had positive islet cell antibodies consistent with latent autoimmune diabetes in adults (LADA) and did require insulin eventually and used continually 2. Age ≥21 to <65 years 3. HbA1c <10.0% 4. For females, not currently known to be pregnant If female and sexually active, must agree to use a form of contraception to prevent pregnancy while a participant in the study. A negative urine pregnancy test will be required for all premenopausal women who are not surgically sterile. Subjects who become pregnant will be discontinued from the study. 5. Demonstration of proper mental status and cognition for the study 6. Currently using insulin-to-carbohydrate ratio to calculate meal bolus sizes 7. Ability to access the Internet and upload CGM data via the DexCom company software during the data collection period. 8. Willingness to remain within approximately 30 miles radius of study site during the day time hours of Visit 4. 9. An understanding of and willingness to follow the protocol and sign the informed consent Additional for UVA subjects only who participate in the 5 days at-home portion Availability of a significant other or family member committed to participating in all training activities, knowledgeable at all times of the participant's location, and being present and available to provide assistance when system is being used at night Commitment to maintaining uninterrupted availability via cell phone and avoiding any overnight travel for the duration of the period of time using the closed-loop system at home Access to internet and cell phone service at home  Admission for diabetic ketoacidosis in the 12 months prior to enrollment 2. Severe hypoglycemia resulting in seizure or loss of consciousness in the 12 months prior to enrollment 3. History of a seizure disorder (except hypoglycemic seizure), unless written clearance is received from a neurologist 4. Coronary artery disease or heart failure, unless written clearance is received from a cardiologist 5. Cystic fibrosis 6. A known medical condition that in the judgment of the investigator might interfere with the completion of the protocol such as the following examples Inpatient psychiatric treatment in the past 6 months Presence of a known adrenal disorder Abnormal liver function test results (Transaminase >2 times the upper limit of normal); testing required for subjects taking medications known to affect liver function or with diseases known to affect liver function Abnormal renal function test results (calculated GFR <60 mL/min/1.73m2); testing required for subjects with diabetes duration of greater than 5 years post onset of puberty Active gastroparesis If on antihypertensive, thyroid, anti-depressant or lipid lowering medication, lack of stability on the medication for the past 2 months prior to enrollment in the study Uncontrolled thyroid disease (TSH undetectable or >10 mlU/L); testing required within three months prior to admission for subjects with a goiter, positive antibodies, or who are on thyroid hormone replacement, and within one year otherwise Abuse of alcohol or recreational drugs Infectious process not anticipated to resolve prior to study procedures (e.g. meningitis, pneumonia, osteomyelitis)