Patient description: The patient is a 25-year-old man with type 1 diabetes confirmed with molecular analysis 7 years ago. He presents to the clinic with shortness of breath and fatigue during activities. He claims mild dyspnea after climbing 3 floors, no dyspnea at rest and no angina (New York Heart Association class 2). He is diagnosed with cardiomyopathy that will be treated with ACE inhibitors and Beta blockers. His takes 70/30 Insulin and vitamin D supplements. His past medical history is not significant for any other medical issues. His family history is positive for DM type 1 in his uncle and his grandfather. His lab study is as bellow: FBS: 100 mg/dl HbA1c: 6.5% Cholesterol: 190 mg/dl TG: 140 mg/dl LDL: 125 mg/dl HDL: 40 mg/dl

Clinical trial eligibility criteria: eligible ages (years): 18.0-999.0,  Type 1 Diabetes Type 2 Diabetes Type 1 Diabetes Subjects: Age ≥ 18 years and have had clinical type 1 diabetes for at least one year, and managed using an insulin pump for ≥ 6 months Type 2 Diabetes subjects: Age ≥ 18 years and have type 2 diabetes managed with rapid acting insulin in an insulin pump, or multiple daily injections including both long acting and short acting insulin Prescription medication regimen stable for > 1 month (except for medications that will not affect the safety of the study and are not expected to affect any outcome of the study, in the judgment of the principal investigator) Live within a 60 minute drive-time radius of the central monitoring location Willing to remain within a 120 minute drive-time radius of the central monitoring location throughout the study Have someone over 18 years of age who lives with them, has access to where they sleep, is willing to be in the house when the subject is sleeping, and is willing to receive calls from the study staff and check the welfare of the study subject if telemetry shows a technical problem or severe biochemical hypoglycemia without subject response and the subject does not answer their telephone (up to two individuals can share this role, but they must be willing to carefully coordinate with each other and the subject so that one of them is clearly designated as having this responsibility at any given time) Willing to wear two infusion sets and one CGM sensor and change sets frequently (at least one new glucagon infusion set daily during bi-hormonal arms, and insulin infusion set every other day throughout the study) Have a mobile phone they are willing to keep with them and answer calls from study staff  Unable to provide informed consent (e.g. impaired cognition or judgment) Unable to safely comply with study procedures and reporting requirements (e.g. impairment of vision or dexterity that prevents safe operation of the bionic pancreas, impaired memory, unable to speak and read English) Current participation in another diabetes-related clinical trial that, in the judgment of the principal investigator, will compromise the results of this study or the safety of the subject Pregnancy (positive urine HCG), breast feeding, plan to become pregnant in the immediate future, or sexually active without use of contraception Need to go outside of the designated geographic boundaries during the study Current alcohol abuse (intake averaging > 3 drinks daily in last 30 days), use of marijuana within 1 month of enrollment, or other substance abuse (use within the last 6 months of controlled substances other than marijuana without a prescription) Unwilling or unable to refrain from drinking more than 2 drinks in an hour or more than 4 drinks in a day or use of marijuana during the trial Unwilling or unable or to avoid use of drugs that may dull the sensorium, reduce sensitivity to symptoms of hypoglycemia, or hinder decision making during the period of participation in the study (use of beta blockers will be allowed as long as the dose is stable and the subject does not meet the for hypoglycemia unawareness while taking that stable dose, but use of benzodiazepines or narcotics, even if by prescription, may be excluded according to the judgment of the principal investigator) History of liver disease that is expected to interfere with the anti-hypoglycemia action of glucagon (e.g. liver failure or cirrhosis). Other liver disease (i.e. active hepatitis, steatosis, active biliary disease, any tumor of the liver, hemochromatosis, glycogen storage disease) may the subject if it causes significant compromise to liver function or may do so in an unpredictable fashion Renal failure on dialysis