start	end	text
0	5540	And without further ado, let me introduce Jay Legorio. So, Jay is a software engineer,
5540	8940	independent security researcher, and he's been building computers and networks and writing
8940	13720	code for pretty much his entire life. He got his Bachelor of Science in Computer Science
13720	19500	from UMBC, Go Retrievers. In 2008, a Master's in Engineering from the Naval Postgraduate
19500	25870	School. Yeah, that's awesome. In 2015. So, without further ado, Jay Legorio.
31570	36890	All right. Hi, DEF CON. My name is Jay Legorio and I'm gonna talk about do-it-yourself
36890	41630	artificial pancreases and how you can build one of your own. So, I'll talk a little bit about
41630	45770	who I am, not as much because we've already gone over that. Uh, an introduction to diabetes,
45770	50730	let's all get on the same page. Uh, hardware, software and safety and the solutions, uh,
50730	56050	that we will engineer to achieve all of those. Uh, iterative improvements, uh, developed over
56050	61730	several years. Uh, a live demo, uh, which is starting, uh, starting at least now. Uh, we'll
61730	66230	see the results at the end. Uh, something I like to call exponential growth and, uh, and then I
66230	71630	will take questions. Uh, so we talked a little about who I am. Uh, I also have some, uh, some
71630	76930	various SANS certs, uh, and I'm a developer. I'm an IT consultant and I'm a private investigator
76930	81930	licensed out of DC. And, uh, and as a developer, I've always solved my, uh, my problems with
81930	87050	software. So, uh, when I first got this diagnosis, I was given a piece of paper and a table and they
87050	91930	said, use this to track your information. And that sounded ridiculous. So, uh, I wrote a web
91930	96530	app, uh, and it was great. And I thought, oh, look at that. I'm unique. It's the intersection of this
96530	101570	thing, uh, and computer science. And it turns out, uh, you are unique just like everybody else,
101570	107010	uh, because this is Scott Hanselman. He's a developer evangelist at Microsoft. And he says
107010	110610	the first thing every techie does once they've been diagnosed is they try to solve the problem
110610	116930	with software or hardware. So I'm no, I'm not unique. So let's talk about this disease. We'll
116930	121790	all get on the same page. Uh, diabetes affects nearly 200 million people worldwide. And there
121790	127710	are two types of them. The one which we'll talk about today is genetic. It's type 1 and it's a
127710	132390	deficiency in the pancreas to properly produce insulin. So you have to get it somewhere else. And
132390	137690	type 2 is also a deficiency, but it is in the rest of the body's ability to absorb that insulin.
137690	143410	We're not talking about that today. Uh, despite having a similar name, uh, to type 1, it is
143410	149110	actually very different. Um, so again, we're not talking about type 2 diabetes. Uh, and all of us
149110	153170	with this disease have heard the meme, there will be a cure in five years. And certainly 10 years
153170	158590	ago at a, at a hospital bedside, that is what the doctor told me, uh, nearly immediately. And five
158590	164330	years later and five years after that, there is still no cure. So insulin is a hormone required
164330	169090	to sustain human life and people with it must get it from somewhere else. And there are two types.
169090	174050	There's long acting that takes your, uh, your blood sugar and it kind of keeps it in check over
174050	179570	the course of 12 or 14, or sorry, 12 or 24 hours. And there's short acting, which is for things,
179570	183730	uh, like meals so that you can counteract, uh, the effect of carbohydrates on your body.
184710	194310	So you administer insulin with a complex formula, uh, taking into account, because this is all very,
194310	199270	uh, pre-existing insulin levels and adrenaline and your insulin sensitivity. Like I said,
199270	204990	it's all very easy. Uh, and you straddle this tenuous line, uh, between going too far high
204990	210650	and too far low. So what's normal for most of you, you're going to maintain and ride pretty
210650	215270	much right at a hundred, uh, the rest of your lives. And that's very good because too high,
215270	220810	uh, if you're, if your levels are too high or remain very high for a long time, uh, you can
220810	227390	have a, uh, a major impact on taking years off your life. Uh, in addition, it can cause strokes,
227390	233030	seizures, organ failure, brain damage, and death over a sustained period. But, uh, you think, okay,
233030	240170	well, we'll just go low. Well, low is even worse. Uh, after you, uh, uh, spend, let's say tens of
240170	245030	minutes progressing through anxiety, tremors, sweating, uh, dizziness, confusion, and heart
245030	250610	palpitations, right at about 35, you pass out. Uh, and that is when you will, you, uh, are much
250610	255550	more likely to die. This is the very acute way as opposed to the long-term way that people die
255550	260430	of this disease. Uh, and some people are hypo unaware, so they don't even feel those symptoms
260430	264650	when they're crashing down. Uh, that makes the technology we're going to talk about today,
264650	270010	uh, a real life requirement, uh, for those sorts of people. And it's a difficult balance to
270010	276130	maintain consistently. We talked about this equation, uh, and it's for the most part accurate
276650	283170	ish because certain things we can't measure. We can't measure, uh, sickness. I don't have
283170	288650	four six today. Uh, you can't measure adrenaline. Uh, mine is surging because I'm up in front of
288650	294850	all of you and I have no idea what that means. Uh, you also can't really measure exercise. Sure,
294850	299070	it takes twice the amount of work to go two miles versus one, but there's no real way to
299070	304710	quantify that, uh, as it impacts this disease. Uh, you also don't know when the carbohydrates
304710	309850	that you're eating are going to hit your system. So if you dose a bunch of insulin and the carbs
309850	314910	don't, don't take effect, your insulin levels are going to crash your blood sugar down before the
314910	319590	food even catches up. Uh, it also goes the other way more often than not, but you can't predict
319590	325650	that because even, uh, things that you do commonly and regularly and are very, uh, easily predictable,
325650	329390	they can come right out of left field, uh, and hit you when you don't expect it.
329450	334550	Your insulin sensitivity changes over time, over a period of weeks, and is sometimes different
334550	339950	throughout the day. Uh, and finally, you have to maintain safety at night. You don't get to
339950	346250	sleep through this. Uh, it's something that you pay attention to 24 seven. So this is living with
346250	352650	it, but how do we measure how well we're doing? The A1C blood test is a, it, uh, measures a
352650	358490	chemical that is, uh, related to your glucose with an impact of about three months. Uh, in
358490	362810	aggregate, it's a good approximation of how, uh, well you've been maintaining control of your
362810	367770	blood sugar. Uh, and you need to, and if you maintain control of that, of your blood sugar,
367770	374790	you'll get a good A1C test. Normal people, uh, should be about five to six. If you're diabetic,
374790	380670	it's probably higher than six. And after seven, it, uh, that's when it starts to indicate that
380670	385570	you're not managing your care very well. Uh, your blood sugar should not fluctuate wildly
385570	391170	during sleep. So as long as you go to bed in a good state, uh, you will probably add good time,
391170	398690	so to speak, to your A1C. Now there does exist some technology to make it easier to maintain
398690	402970	control of your, of your blood sugar, but it largely goes towards eating, easing burdens.
402970	408170	None of this stuff makes decision-making, uh, uh, none of this stuff takes a decision-making role
408170	413890	in management of the disease. So we replace injections, multiple injections, with insulin
413890	419070	pumps. Uh, I mentioned there were two types of insulin. With an insulin pump, it very slowly
419070	424370	microdoses, and not the Silicon Valley microdose, uh, it slowly microdoses insulin over the course
424370	431010	of the day to take that long-acting effect, uh, and use short-acting insulin, uh, to, to achieve
431010	435550	the same effect. And you're not, uh, you're not stabbing yourself all over the, uh, all over your
435550	440630	body all through the day. You put it in one day and maybe about three days later, uh, you change
440630	447990	it all up. Uh, we also have a continuous glucose monitor, and this takes the place, uh, or is
447990	452210	augmented by, uh, finger sticks. And that's exactly the thing that all of you know what I say,
452210	456170	what, what I mean when I say you prick your finger, put the blood in the meter, and, and all
456170	461350	that kind of thing. Uh, the sensors, uh, they vary, uh, de, uh, depending on the model. Uh, they
461350	466970	can stay in for seven days, 10 days, 14 days, it all depends. But generally, they all hold to this,
466970	472430	this one thing where, uh, you get a reading every five minutes, um, which is good because then you
472430	478270	can expose things like trends. It's not this point in time conte- uh, context-less, uh,
478270	484570	finger stick that doesn't tell you as much as you really want to know. So, uh, let's talk about some
484570	489890	tips. You don't get to have bedtime snacks because you don't know what it's going to do. Uh, you
489890	494050	intentionally go to bed on the higher end of the scale because the insulin pump is unthinking,
494050	498390	and it will slowly dose that insulin, and you don't want to wake up too low, and you don't
498390	504810	want your, your continuous glucose monitor to set off an alarm. Uh, and, uh, every meal, even the
504810	509090	ones that are usually predictable, can become an hours-long battle to get back to normal. And this
509090	515010	is just how it works. This is true mainly for everybody. Uh, and a rule of thumb, if you wake
515010	518770	up in a bad state, there really is no recovery during the day. You're always going to work to
518770	523850	fight your numbers down, uh, or bring them up throughout the day. And finally, I want to leave
523850	528810	the intro with a, with, uh, a graph of how hard this all is. This is from a study called the
528810	534290	Effect of Diabetes on Outcomes of Hyperglycemia in a Mixed Medical Surgery Intensive Care Unit.
534290	542210	It's from May of 2001, and if we define in range as between 80 to 180, uh, these folks in an ICU
542210	550310	were only in range about 65% of the time. How hard is it when we're in an ICU and doctors can't
550310	555870	even keep this thing in line? So that's what the rest of us live with. Uh, so now we'll talk about
555870	561790	hardware. We need to develop a solution that takes data from the CGM, processes it with what it
561790	567090	already knows about our bodies and its current state, predicts future effects, uh, based on the
567090	572050	existing state, any proposed changes like dosing insulin or eating, uh, and how the medicine
572050	576210	actually works, and finally delivers a command to an insulin pump that's something other than
576210	581770	that regular background, uh, insulin. And this requires us to, to overcome several technical
581770	587350	challenges. We need something small and low power. Uh, we need a visualization solution because this
587350	592650	thing needs to be monitored. And, uh, we need to collect blood sugar readings from an FDA-certified
592650	598490	CGM system. And finally, we need to query and control an FDA-certified insulin pump. And the
598490	605050	reason FDA certification is important here, uh, is because the quality of the measurements that you
605050	610670	get will directly impact the effect on your body. Uh, we're, many of us are developers, we understand
610670	615230	garbage in, garbage out. You need something that is giving you good data and then you need an
615230	619830	insulin pump that can, that can accurately take action. If you say dose one unit, you don't want
619830	627670	it to be 0.9 or 1.1 or maybe it's 5 today. You need something that is absolutely reliable. So,
627670	631770	nowadays, this is actually really easy. I think it's easier than it was 10 years ago. Uh, the
631770	635650	Raspberry Pi and the Edison are ultra-portable. You can get them anywhere, although the, uh, the
635650	640990	Edison is discontinued now. Uh, and it's great to run our code on. We can, we can get these anywhere.
641230	646330	Uh, they each have built-in Bluetooth and Wi-Fi, so they're eminently net, uh, networkable. You can,
646850	651150	you can tell it about all of your, your different Wi-Fi access points or you can tether it to your
651150	656570	phone when you're out on the go. And finally, uh, some, because Bluetooth is built-in, you can
656570	661370	collect CGM data directly from the transmitter that's attached to you, if it supports that. And
661370	666010	the solution we're talking about today does. Uh, and if not, you can plug the receiver, uh, into
666010	670790	the device, uh, and because they both support USB on the go. So, you can, you can download your
670790	676650	data directly from that. So, we talked about collecting CGM directly, but the insulin pump
676650	681910	we're going to talk about is, uh, it's a 900 megahertz, uh, radio. It's in the ISM band. Uh,
681910	686370	and the open source hardware community stepped up for us and developed the Explorer board for
686370	691750	the Edison and the Explorer hat for Raspberry Pi. Now, they're marketed as random 900 megahertz
691750	696270	radios that anybody can do anything with. And that's true. You can, but this was made for this
696270	701010	purpose, uh, and we really appreciate that. Now, I mentioned that the, uh, the protocol was
701010	705810	proprietary. It was reverse engineered over a period of years, uh, by someone known, known as
705810	710850	Ben West. Uh, none of this would be possible without his work. Uh, so it's, uh, uh, we really
710850	716330	appreciate it. Now, older insulin pumps have wireless connectivity and the manufacturers
716330	721090	allowed you to remotely control them. Uh, not from very far away, but you could still remotely
721090	726270	control them. And when they found out about this, uh, the fact that you could remotely control
726270	732130	them, thanks to a Black Hat 2013, uh, talk, they significantly limited how that functionality
732130	737990	can be used. So in newer pumps, you can still query, uh, for the state of the system, but you
737990	743010	can no longer remotely dose insulin. You have to find out of warranty pumps. You have to find
743010	747550	them anywhere that you can, uh, and then we'll use our custom hardware and software to talk to
747550	754050	them. So older devices, uh, are already hard to acquire. You have to scour eBay, Craigslist,
754050	761250	Mercari, uh, this website called MedWow. Uh, and because no one can resist the chance to take
761250	765950	advantage of an already disadvantaged community, there was price gouging. So you'd think these
765950	770750	older out of warranty pumps would be cheap because they are, because they are older and well
770750	775790	used. Uh, and the prices on these things that people wanted, uh, people who weren't even
775790	781070	interested in participating in this or weren't diabetic skyrocketed. So that was, uh, that was
781070	786830	really fun. So let's talk about software and safety because safety is a pretty critical factor
786830	793730	here. Our visualization stack is going to be built on Linux, Node and Go, Mongo, Python and
793730	799630	Bash, and it's called NightScout. It is purpose built, uh, to visualize the current state of a
799630	804650	diabetic system, uh, as well as dump, as, as well as serve as a holding place for historical
804650	809470	data so that you can bring, uh, you can bring reports to your doctor so that you're, you're not
809470	813270	giving them kind of, uh, lack of context for how you've been, you've been taking care of
813270	817850	yourself. Now everyone builds their own NightScout instance and it fits well on the free
817850	821530	tiers. Uh, I have a guide out where you can install it on private infrastructure. If you
821530	825850	choose to do that, I don't really like having stuff in the cloud. So this works, uh, on a
825850	830570	server in my basement. And NightScout is great for a point in time representation,
830570	834390	representation of how things are now. And again, you can generate reports to bring to your
834390	840010	medical, uh, your medical appointments. So, the solution that does all of the heavy
840010	846150	lifting is called the Open Artificial Pancreas System or OpenAPS. And it is built on, uh,
846150	850910	much the same group of, of, uh, technologies, Node, Python, uh, and Bash. And it runs on
850910	855910	Linux. Uh, so again, this fits well with our Raspberry Pis and our Intel Edisons. And it's
855910	861050	designed to acquire CGM data, process it using an algorithm, uh, and deliver a dosage
861050	865010	command to an insulin pump, which checks all the boxes, uh, for the things that we talked
865010	870370	about what we needed at the beginning. Now, more than 1,440 people have sort of raised their
870370	875410	hand and said, yes, I'm using this. But we know that there are more people than that, uh, who
875410	880430	are using it. Um, because it, it is, uh, uh, it's not required to get permission or anything
880430	886750	like that. Uh, so, uh, using those numbers, about 7, uh, 13.7 million person hours, uh, of
886750	892590	algorithm use, uh, have been, uh, uh, have been achieved. And, and so far, for the people who
892590	898810	are using CGM certified, uh, uh, I'm sorry, FDA certified CGMs and FDA certified pumps, no
898810	905690	one has gone to the hospital. Um, so a person can only be expected to do that equation that we
905690	910090	talked about really several times per day. Uh, and the fact that there are so many unknowns in
910090	915370	this equation, it's a, it's a, it's a wonder anybody does it right at all. Uh, but OpenAPS
915370	920330	can process that data every five minutes because that's when you get a glucose reading. And so
920330	925190	that's about 300 times per day that you, the patient, are not having to deal with the stress of
925190	933110	this stuff. And more importantly, it works when you're sleeping, which is awesome. So it, because
933110	938730	it is more aware of, of many things that the human cannot be aware of, uh, it makes better
938730	944790	decisions. So it knows, uh, the manufacturer provided, uh, equation that says, uh, when the
944790	949830	insulin will take effect and when it will start to taper off. And it can use that information to
949830	954190	make a better decision to say, okay, well, his, his blood sugar is rising a little high, but he
954190	958850	already has this much on. And according to this equation, well, I'll add a little more or I won't,
958850	962470	which is, uh, which is really good. And I mentioned that your insulin sensitivity varies over
962470	968310	time. So Auto-Tune will tune the algorithm to carbs and insulin over weeks. Uh, and
968310	973670	Auto-Sensitivity will tune the algorithm, uh, to you over, uh, several days. This is a very
973670	981150	person-centric disease. So you need person-centric, uh, uh, applications here and it gives you
981150	987370	advanced warning. So if, if it knows, because it, again, it knows how the insulin works, uh, to a
987370	991350	mathematical level, uh, it can send you a notification to your phone and say, Hey, you need to
991350	996210	eat carbs, uh, because otherwise in about 15 minutes or however you configure it, uh, you're
996210	1001810	going to have a low. Uh, so after this feature was implemented, uh, whenever, uh, uh, whenever it
1001810	1005850	would tell me that I needed to eat carbs, you're going to experience a low, uh, I didn't get that
1005850	1010950	low, which was great. That was really helpful. So let's talk, I already hinted at it, but let's
1010950	1015850	talk about the first benefit you get with this system. Someone running on manual mode, uh, can
1015850	1020430	normally be expected to wake up at least once or twice every night to alarms cause, uh, that
1020430	1025970	require your action. Uh, again, you don't get to sleep through this, but OpenAPS takes control of
1025970	1030910	this all night long. And sleep is one particular area of your life, uh, that improves
1030910	1036530	dramatically almost immediately. So, uh, after diagnosis and before starting this, uh, I went
1036530	1040770	from getting no more than six hours of uninterrupted sleep at a time, uh, to the first day I
1040770	1045610	slept 10 hours. And when I woke up, I was exactly where I wanted to be. And it was, it was
1045610	1051110	nothing short of incredible. I was a very tired person. So a sleeping patient isn't eating.
1051110	1055550	It's also easier for the, uh, for the system to maintain them within the range that you've
1055550	1060990	defined. Uh, and good time and range, especially at night, improves your A1C without any work on
1060990	1065570	your part. Uh, you're not struggling between the decision of, I'm starving, but still have
1065570	1069070	high blood sugar and need to wait to eat. You're generally not eating. So this is the only
1069070	1073990	factor that, uh, uh, that really comes into it. Uh, and I, I don't want you to think that this
1073990	1078790	is just my experience talking about how life changing the sleep is. Uh, this is generally the
1078790	1084330	first thing we hear from people is that the sleep is amazing. This person changed their
1084330	1089090	sensor and immediately went back to bed. Uh, and everything just worked. It just worked and it
1089090	1095410	was great. So we have been building the airplane while we've been flying it and
1095410	1100890	manufacturers don't really get that luxury. And safety is a critical factor in the way that
1100890	1104830	changes and features are implemented because we don't want to send somebody to the hospital.
1104830	1108330	So there are several checks and double checks before it makes an ins, uh, an insulin
1108330	1114310	decision. Uh, there are fallback behaviors defined. So should, uh, I be away, uh, should the
1114310	1119190	system be away from the insulin pump for hypothetically 30 minutes, uh, there's not much
1119190	1123890	difference between what 30 minutes with this system would have, would have caused and what 30
1123890	1128730	minutes without it. And after that 30 minutes, the pump reverts to its, uh, its normal, just
1128730	1134290	background insulin doing things manually. Uh, and features that have impact on the algorithm
1134290	1138330	are scrutinized heavily by a core team of developers. And I don't want you to think that
1138330	1143170	means, that means me saying, uh, oh, it's open source. So obviously there are all eyes on it.
1143170	1148730	Uh, you know, like we used to say about open SSL. Uh, but there are, there are people who are,
1148730	1152310	who are dedicated to that one part of the algorithm. There are no changes that are going to
1152310	1157970	go into that without their say so. Uh, now commands are delivered, uh, oh, I explained this
1157970	1163230	already. So when, uh, when the pump is out of range of the system, uh, it will default back to
1163230	1168550	factory behavior, which is great. Uh, and during sleep, the manufacturing provides CGM, which
1168550	1174970	will alarm, uh, it can be used as a fallback. So let's say, uh, Linux kills the, the open APS
1174970	1179910	process for some reason, who knows why? Uh, and it stops working. Well, if I start to go too
1179910	1185050	high or too low while I'm asleep, this thing is independent. It can still, you know, sound an
1185050	1191150	alarm, uh, and cause me to wake up and then take care of all this stuff. So sleeping just one
1191150	1194550	benefit to the, the patient. We also discovered something that kind of should have been a
1194550	1200190	little intuitive at the beginning. So normal routines operate by making drastic changes, uh,
1200190	1205450	and you can't undo them. You cannot undo, undose insulin and you can't take back the cheeseburger
1205450	1211370	that you just ate. I guess you can, but that's, that's gross. Um, actually just didn't think of
1211370	1216210	that until now. So, uh, so one indirect safety factor that was discovered through use of this,
1216210	1221430	it really makes sense when you think it through. You make small changes every five minutes and
1221430	1226190	then after just five more minutes, correct anything that may be out of place or that needs
1226190	1230390	to be done. So if you have a sudden rapid rise, you add more insulin. And if you have a sudden
1230390	1235970	drop, you suspend delivery. And this is key during meals. Don't take the entire insulin dose
1235970	1242530	because there is a nonzero chance that you're going to wind up, uh, on the floor. So open APS
1242530	1247770	actually mimics the pancreas is normal function by slowly dosing insulin as the body processes
1247770	1253470	carbohydrates and it keeps the patient's blood sugar from extremes. So lesser amounts of insulin
1253470	1258250	in the system, in the person's system at any given time reduces the likelihood that they
1258250	1265050	experience a blood sugar drop at all. So let's talk about iterative improvements. Um, I've made
1265050	1268730	several implementations over the last few years. I'm going to hold these up. Some of them are
1268730	1272950	large. They're, they have this big shave kit bag and you had to put it in a backpack. Uh, some of
1272950	1278890	them are still a little bulky, but much smaller. And some of them are very, very tiny. Uh, and
1278890	1283330	the one that I use now fits in my pocket and it, it, it's no bigger than my wallet. Uh, it doesn't
1283330	1288950	feel obtrusive. So each iteration and choice of component over the years reduced the size and
1288950	1292890	improved portability and battery life. And again, we're building the plane while we fly it. You
1292890	1298670	can make incremental improvements in these things as you go. So some contributions I've made to
1298670	1303810	these projects. Uh, somebody implemented an interactive setup script, uh, before you really
1303810	1308990	had to, uh, uh, do things in a certain order in the right way or the whole system just would
1308990	1313490	fall over, uh, fall out from under itself. Um, somebody dreamed up this interactive script
1313490	1317410	and it asks you some questions about the equipment you're using, uh, and you just tell it.
1317410	1320830	And then later on you can use command line switches when you want to update your software.
1321250	1326790	So I've, uh, I've tried to increase flexibility around connectivity, specifically, uh, with
1326790	1332230	Bluetooth tethering to, uh, to phones so that when, uh, you have flaky signal, like you're in,
1332230	1336130	uh, an underground tunnel, uh, like on a train or something, uh, the connection kind of
1336130	1340850	flapping there doesn't impact the communication with the server. Uh, and I've also added some
1340850	1348890	FDA, an, an FDA certified device. Um, this one here, it uses this receiver, um, to, uh, to dump
1348890	1353830	the data into the system, but, uh, it broke and so I needed to get a replacement. But the
1353830	1359630	replacement that they sent, that they sent me does not share, uh, its data in exactly the same
1359630	1364630	format. So I kind of had to bump around to add compatibility with the newer devices, uh, and
1364630	1369850	committed all that stuff up. So the systems work without a con, uh, connection to the
1369850	1374470	internet when one isn't available. And when you get back to civilization, uh, connect, the
1374470	1379190	connection returns and it dumps all its data into NightScout. So you can, and people
1379190	1384190	absolutely do, take these remote places to go, uh, hiking and all that kind of stuff. You're
1384190	1389190	all, you're all good to do it. And as long as it gets time on startup, because, uh, some of you
1389190	1393810	may know, none of these things have a battery for the real time clock. Uh, so when it starts
1393810	1398450	up, it starts up with a new date. So as long as it can get NTP time, uh, it doesn't need to be
1398450	1404530	connected, uh, continuously. And even if it can't get NTP time, say when you accidentally turn
1404530	1408770	it off, when you're on an airplane, you can SSH into your artificial pancreas and tell it what
1408770	1415230	time it is, uh, on the command line. So here are some images of the, uh, of these a little more
1415230	1420850	close up. Um, this is a 26 amp hour battery. Uh, this is the receiver that I told you about. Uh,
1420850	1425110	this is, this is an antenna that you could get from the manufacturer so that it would
1425110	1429430	communicate with us, with a web service that they run. And the web service would talk to this
1429430	1438310	thing through, I swear to God, JNI and Java. Uh, uh, and it's, it's something that I still to
1438310	1443490	this day don't know whether to, to, uh, uh, attribute to malice or incompetence. After one foot
1443490	1448790	or two feet away, this thing doesn't work. These things made by randoms on the internet work
1448790	1456210	like 10 feet away. I don't, I don't understand it. Uh, and this is a Raspberry Pi 2. And
1456210	1460510	something that I, I actually enjoyed doing, uh, in addition to all the straps that are inside so
1460510	1468210	that things don't bump around, uh, I, uh, on this side, I got these female, uh, female to male, uh,
1468210	1473270	short USB cables to plug into the dual charging ports of the battery. And instead of digging that
1473270	1477330	battery out at the end of every day and plugging stuff in, you just plug the, the bag into that.
1477330	1481550	And I thought that was a nice touch. That was very convenient. Uh, so this is what, uh, what
1481550	1487330	these systems look like. Uh, this one, um, this one here, that's this one, is, uh, is an
1487330	1493950	Intel Edison with the board under it and it does USB on the go. So you, uh, connect this onto
1493950	1499430	that and it's still kind of bulky. And also you do need a USB battery because you have to feed
1499430	1504150	five volts to, uh, to the USB on the, on the go device. So even though it has a lithium polymer
1504150	1509810	battery, uh, it's not enough if you want to connect to, uh, the receiver. But this one, which
1509810	1517090	is, uh, which is in here, this is a, uh, a Raspberry Pi zero with the board on top and it's a
1517090	1522450	lithium battery only because it's pulling, uh, the blood glucose meters, uh, um, measurements
1522450	1527390	directly off the Bluetooth transmitter. Uh, and I added a, a kill switch and, and the nice thing
1527390	1532370	about this is it has a screen. So even if you don't have night scout or access to any of that
1532370	1538510	stuff, you're not guessing, uh, to see sort of what the, what the decision loop is doing. And
1538510	1542490	the last thing which, uh, which I characterize is the difference between having your
1542490	1547170	speedometer in your glove compartment or your blood sugar in your pocket. Uh, this is a Fitbit
1547170	1551890	with a, with what's called the glance face and it shows you every, really everything that you
1551890	1556870	need to know. It shows how much insulin is active, uh, what carbs are left to be digested,
1556870	1560890	where your number is now, and a little graph to show where it has been, uh, and what the
1560890	1567070	change, that's that zero MGDL, uh, was from the, uh, the prior reading. Now I've mentioned
1567070	1572210	that all of this stuff is out of warranty, but after a breakthrough of literally years in
1572210	1578190	development, uh, this is called the, the Omnipod. Uh, it is manufactured today. It is, uh,
1578190	1583370	it's a tubeless insulin pump. So it sticks to your body. Uh, somebody figured out how to
1583370	1589670	control it. It, uh, it works in the 425 megahertz band. And so what people are doing now
1589670	1596110	is compiling this, uh, this middle screen here. Uh, it's an iPhone app called loop and it
1596110	1601150	sends a Bluetooth via Bluetooth commands to this relay thing. It's called a Riley link, which
1601150	1606250	then spits out the 425 megahertz commands to this thing. So it's everything that I've
1606250	1612670	described with warrantied hardware, which is nuts. Uh, I cannot tell you, uh, the, the
1612670	1617190	Herculean effort it took to figure this thing out. Um, there's proprietary crypto in there.
1617190	1622970	There's a, it, it was nuts. Um, so those people I hope feel very proud. So, uh, I promised you a
1622970	1631090	live demo and really the entire time has been the live demo. Um, so these are, uh, these are
1631090	1638930	live logs from what's going on with OpenAPS right now. So this one, if you notice here, it's
1638930	1644510	taking several, uh, several different ways to predict what my blood sugar may do based on
1644510	1651950	various factors. Uh, let's see, this is towards the tail end of the log. Uh, up at the top, it
1651950	1656910	has decided that it is going to change that background insulin, but it's not going to dose,
1656910	1662170	uh, more, uh, any more insulin, uh, with what's called a bolus. That's when it, uh, you're giving
1662170	1667050	yourself more than that background insulin. And on the right, this is a log from the
1667050	1672870	Bluetooth, uh, receiver. It's, uh, the project is called XstripJS. Uh, and that is live
1672870	1677910	communication, uh, every five minutes with the device whenever it wakes up. And, uh, oh, so
1677910	1682610	this is the beginning of the loop. What it's doing right now is making, uh, prechecks to make
1682610	1687990	sure it can communicate with, uh, with the device. It's seeing what has changed over the last, uh,
1687990	1692890	the last time that the loop ran. And then it's checking to make sure the, the time is correct.
1692890	1698110	And then it's going to refresh what it, uh, what it knows about the system. And that kinda, that
1698110	1702430	kinda takes a minute. So, uh, I was really hoping that we were gonna catch a new number on the
1702430	1711710	other side so you could see that log, uh, go crazy. But, uh, such is not that log. Uh, and the
1711710	1717970	other thing I wanted to show you was NightScout. So, uh, where do we start? So up over, uh, where
1717970	1723810	you see 109, that is my blood sugar right now. It's up five points. The amount of insulin on
1723810	1728930	board is actually negative 0.4. Uh, and I'll explain the reason for that in a minute. The
1728930	1734930	basal is set right at about 1.0 units per minute. And you can see that, uh, that drop down
1734930	1739610	icicle graph. And I haven't really been eating today, so there are no carbs on board. Uh, it
1739610	1744650	shows that the pump has 78 units in it. Uh, the battery is 1.26. Uh, the one thing I'll say
1744650	1748430	about the battery is that normally you get about two weeks with the battery. You get about
1748430	1752370	three days when you're running this thing. Uh, which is fine. It's a triple A battery. It
1752370	1757230	doesn't matter. Um, this right here shows that I, I did a finger prick and this is the
1757230	1763090	trend graph of what my blood sugar has been doing. And the, uh, uh, purple lines right
1763090	1768430	there, those are the predictions about what it is going to do. Uh, and here you can see
1768430	1777070	I've been, uh, on a Vegas diet, uh, kind of spikes. Um, but yeah, I think I got, oh, and, uh,
1777070	1787240	let's see, you can look at more. Uh, oh, this is, uh, uh, bolus right here. So I ate 45 carbs
1787240	1791400	and only took one unit. Uh, if any of you in the audience are familiar with that, that's
1791400	1797640	going to sound like a real underdose. And it was because then over here, open APS kicked
1797640	1802180	in and did the rest. So it spiked a little bit, um, but then it came back down pretty
1802180	1807920	rapidly and landed, uh, without, without too much, uh, without too much trouble right where
1807920	1820770	I wanted it to be. I think I just saw the log tick. Yeah. So that's it, uh, communicating
1820770	1825550	with, uh, with open APS and with the, uh, with the night and with the night scout server
1825550	1834970	there, um, to register a new blood, uh, blood measurement. All right. Live demo. My
1834970	1842370	internet works. That was great. So let's talk results. Two graphs up at the top in 2016, uh,
1842370	1848070	right. I want to say a three month period starting in April. You can see that, uh, for 69%
1848070	1853090	of the time I was in range and about 39, uh, 30% of the time I was high and I didn't have any
1853090	1858790	lows. And there's a reason for that. Uh, after a couple of very scary moments, uh, in
1858790	1864190	consecutive order, uh, I stopped really taking care of myself in terms of how high my blood
1864190	1869610	sugar got. And you can see that here where it says the average of the normal is one 50 and the
1869610	1877450	average of the high is about 200. Uh, that's not great. So, uh, from last week and then three
1877450	1884470	months prior is the lower graph and that's 89% of in range time, 3% of lows. But if you look at
1884470	1888290	the average and the median, those lows aren't that serious when you have something that is,
1888290	1892670	uh, micromanaging, uh, everything that it does every five minutes and a little bit of highs
1892670	1898770	because you're diabetic, you're never going to solve that. And this is just another way to
1898770	1903790	visualize the same thing per hour of the day. Uh, if you notice up at the top, it's largely
1903790	1912710	between one 50 and 200 and down at the bottom, it's largely between 100 and one 50. Uh, and
1912710	1919770	now let's look at a few raw results. Uh, there was no A1C estimate, uh, before 2016 because
1919770	1924790	there was no way to do that. Uh, so, uh, a couple of things that are important. This was
1924790	1930770	diagnosis. Uh, I mentioned that six is a good place for a diabetic person to be and that ain't
1930770	1936470	six. Uh, so that was a hospital visit, uh, and a surprise. Uh, but I quickly got it under
1936470	1942330	control, uh, because, uh, I am also a control freak. And, uh, and right about here was just
1942330	1947330	before those periods of, uh, let's say noncompliance, uh, with keeping your, your
1947330	1953310	numbers down. Uh, and that was, uh, that was due to something that happened at an IKEA and
1953310	1958610	very helpfully, uh, I'm sarcastic, this was the most unhelpful employee I've ever met, uh, at,
1958610	1963890	uh, at MGM, uh, at a DEF CON. Uh, not MGM, at a DEF CON. It was Mandalay at a black hat.
1963890	1970070	Yep. Uh, yeah, simple instructions were very difficult for that person. Um, now here, this
1970070	1976430	is, uh, if I started OpenAPS in April of 2016, uh, that's the difference between, uh, the one
1976430	1981870	right before it, uh, that's a, that's, that's point six. And that was only at night and doing
1981870	1986810	very little work on my part because OpenAPS was taking care of all of that. So, as soon as I
1986810	1991890	got the nights under control, I got an immediate benefit, uh, for, on my A1C. And then
1991890	1997470	continuing forward, uh, now it's down to about six three. And again, I don't do very much work
1997470	2003030	anymore. So, that's my personal change. Let's talk industry change. Previously, these were
2003030	2009330	monolithic systems. One device, one insulin pump, one sensor, none of it's interoperable. Uh, and
2009330	2014730	this thing, uh, it's as expensive as a regular insulin pump, uh, but it doesn't do, uh, it
2014730	2019970	doesn't do anything, uh, really other than freak out. Uh, in fact, 40% of people leave this
2019970	2024670	system, which is supposed to have a very tiny bit of automation, uh, because they can't keep
2024670	2029650	it, uh, they can't keep it working enough, um, to stay in that level of automation. And then it
2029650	2033690	pumps them out to manual mode and then what's the, you know, what's, why do they even have it?
2033690	2038470	Uh, it's not tunable and this is a very person specific disease and it doesn't handle meals for
2038470	2044030	you, which is probably a good 90% of why I love OpenAPS because I'm probably not gonna
2044030	2051530	overdose myself. Uh, so, now the FDA, what they are doing is, uh, is certifying devices
2051530	2056890	separately and making sure that they are interoperable. So, you have discreet CGM pumps,
2056890	2062550	uh, uh, CGM, uh, devices, pumps and algorithms, they get certified themselves and then
2062550	2068050	manufacturers get to make business decisions about which things interoperate. So, uh, the ICGM
2068050	2074070	is the first one, uh, there are alternate controller enabled, that's an insulin pump, which
2074070	2079650	allows an outside entity, uh, to control the insulin pump. The, the smarts don't have to be
2079650	2083950	integrated into the pump itself. Uh, and finally the eye controller, that's the algorithm, that
2083950	2090390	is what OpenAPS is, uh, but there are no certified products yet, uh, we think eventually, uh,
2090390	2095630	very soon there will be. Uh, and plug and play is important, FDA isn't going to get the
2095630	2100650	business of dictating which products, uh, work with, uh, with which other products so long as
2100650	2104610	the qualifications are met. And so none of this would be possible without the people behind
2104610	2109750	the hashtag, we're not waiting. Uh, it was a lot of people that were really tired of 90's
2109750	2115150	garbage tech not handling this, uh, when really that's the goal of technology is to make your
2115150	2119550	life better. We've all been told that there will be a cure in five years, uh, these people
2119550	2124790	were tired of being told that. Uh, one thing that I want to emphasize, this is a group of
2124790	2130110	non-doctors, um, these folks who started this changed an entire field of medicine, uh, and
2130110	2135650	they are not themselves doctors, and I think that's, uh, a huge, uh, a huge good thing. Yeah.
2135650	2145780	Yeah, thank you. So let's talk about exponential growth. Everyone needs insulin, this is a
2145780	2150800	biological fact. And lack of the hormone is not a question of lifestyles or choices, uh, or
2150800	2155220	what this person could have done better. Uh, it is a lightning strike that could happen to any
2155220	2162500	of you, uh, really at any moment. And people will die, it is like water and like air. So when
2162500	2167300	predatory prices are levied, uh, are levied on this drug, it is the financial form of your
2167300	2173060	money or your life, kid. Uh, it's not great. And it's not like, oh, people die of this. Uh, people
2173060	2181240	are dying now and it's 2019. Uh, so just, uh, uh, in Ju- just in June in California, three
2181240	2186780	people under the age of, uh, of 25 died because they did not have access to affordable insulin.
2186780	2193420	This guy died like three days ago because he changed insulin to save for his wedding. Uh, the
2193420	2200000	people that, that use the $25, uh, Walmart insulin as a, uh, something to point to, to say that
2200000	2205880	insulin is, is cheap and available. That's what this guy switched to. I mean, I'm not going to
2205880	2210780	use dog insulin because it's cheaper and it's insulin. Uh, that's basically what this guy had
2210780	2217440	to do. And, uh, and yeah. So I have a graph here of several things that are indexed to overall
2217440	2221500	inflation. That's that black line there. And we're doing great with some things. Uh, so like
2221500	2226560	TVs, that's that bottom line. Like there's never been a good time, a better time, uh, to buy a TV.
2226560	2231100	And then there are things, uh, that are below the line like cell phone service and new cars. Uh, food
2231100	2235780	and beverage and housing is right about at the middle line there. Wages are a little higher, but
2235780	2240880	then other essentials like, uh, like college tuition and childcare and medical care services,
2240880	2246580	they're up way, way high. Uh, and what I don't show you is the completion of that gold bar
2246580	2256160	because that gold bar is 100, uh, 1,175% increase for the same formulation of the same insulin by
2256160	2266360	the same brand, uh, 20 years later. So that's some shit. Uh, I, uh, I kind of subscribe, uh,
2266360	2270580	subscribe to this, uh, this Senator's feeling on this. Uh, Americans, Americans are getting
2270580	2275240	price gouged because our government lets it happen. Uh, other governments don't do that to
2275240	2280700	their citizens. Uh, this is not meant to be a, a political statement or anything like that. Uh, but
2280700	2286400	it's pretty evident that the, uh, the medical, uh, paradigm in the United States is kind of
2286400	2293180	busted. Uh, and this is one, uh, one symptom of that. So I want to take the time to acknowledge,
2293180	2299040	uh, the many people that contribute to these projects. Uh, and I am, uh, I'm not getting, uh,
2299040	2303980	the hundreds, the other hundreds of people that contribute to this. Um, so Ben West, like I said,
2303980	2310820	he's one of the, uh, one of the key players here. Uh, Dana and Scott, they're, they're, um, kind
2310820	2316220	of behind one of the ideas that, that, uh, that produced Night Scout. Scott Hanselman, uh, he's,
2316220	2320960	uh, again, that's the developer evangelist at Microsoft. He's got a huge megaphone. Uh, Xstrip
2320960	2325440	JS, those guys, uh, are the ones that enable you to get the, uh, the Bluetooth reading directly
2325440	2330760	off the device. Uh, Glance, that's its website. It's, uh, it's really cool and it's very handy.
2330760	2334940	Not at Defcon when you have all your radios off though, so that kind of sucks. Um, and then
2334940	2339600	there's the Night Scout project. And I figured since I cited a formal, uh, medical paper, I would
2339600	2344660	cite this one formally right here. Um, that is the, uh, uh, that graph at the first one that
2344660	2351580	showed 65%, uh, of, uh, of good results and, uh, or I'm sorry, of time within range. And
2351580	2355880	finally, I want to thank my doctor. Um, there are doctors that bounce their patients when they
2355880	2361860	find that they're doing this. Uh, this one is amazing. Uh, he's supportive of it. He's had me
2361860	2368100	show his students, uh, his medical students how it works and all about it. Uh, and I, man, he's
2368100	2373960	getting up there. I fear the phone call that he's retiring, um, like weekly. Um, but yeah, he's
2373960	2380280	amazing. Uh, he is, uh, uh, he's the chief of, uh, of endocrinology at a hospital and he is
2380280	2385960	wonderful. So, uh, talked a little about who I am, uh, and intro to the disease so we're all on
2385960	2390360	the same page. Uh, hardware and software and we talked about safety, uh, talked about
2390360	2394500	iterative improvements, you know, over the course of the year, uh, uh, few years and people
2394500	2398460	are welcome to come up and look at these, uh, at the end. Uh, talked about results, both
2398460	2403680	personally and industrial, uh, and we talked about exponential growth. And so finally, I'd
2403680	2406780	like to take any questions if I have time. Yes?
2413490	2417850	So the question was, what is the difference between the insulin, uh, that I mentioned at
2417850	2423470	Walmart and, uh, the one that he was using? And the, the difference really is, uh, how
2423470	2429110	precise it works on your body chemistry. Uh, the Walmart insulin does not give you the kind
2429110	2434370	of control that you can achieve with, uh, with other products. Uh, it also, uh, it takes
2434370	2439030	time for your body to adapt to a different formulation of insulin. Uh, and so that is,
2439030	2443250	that all of those things probably contributed to his death. Yes, sir?
2443250	2448310	Um, would you say just a few more words about how much of the processing is happening locally
2448310	2453590	and how much is happening on your server? So for the purposes of open APS, none of it
2453590	2457210	happens on the internet or on the server. Uh, the server serves as kind of a dumping
2457210	2462650	ground for data, uh, where, uh, where it houses all that stuff. Um, so everything that, that
2462650	2466470	this needs to know, as long as you tell it what time it is when it starts up, is actually
2466470	2477810	right here. Sorry, actually right here. So theoretically, if you had good dense data
2477810	2485870	storage, you wouldn't need your server anymore. I don't see why that is not true. Yeah. Yeah. Yes?
2485870	2492630	Um, one question, if you could have one other sensor or one other kind of input, um, that you
2492650	2497590	believe would help you control the situation even better, what would that be and why?
2497890	2503490	No one's ever asked me that. Uh, I would have something that was telling me the speed at
2503490	2508990	which my metabolism was operating, uh, because right now, uh, over several days of testing,
2508990	2515430	uh, with, with certain, um, pre, uh, measured amounts of carbohydrates, I know, uh, you
2515430	2521130	know, from, from some evidence how my metabolism works, but that's pretty general and every
2521130	2525410	food is different. Um, so yeah, I would have something that, that did that and kind of
2525410	2529090	informed this so that it could then, it could then say, oh, he's digesting things really
2529090	2536970	fast, just dump more insulin in. Yeah. Uh, right here? Oh wait, um, sorry, over there first.
2536970	2537810	One, one.
2538050	2543270	Um, have you ever had issues, uh, traveling or going through secure locations, having them
2543270	2548390	believe, hey, this is a medical device, given that it's a Raspberry Pi and, and it's got like
2548570	2556150	a, a battery tape to it with wires coming out of it. Yeah. Um, so, um, I'm going to, the short
2556150	2561510	answer is no. And the long answer is Dana, uh, who I mentioned earlier makes it her mission.
2561510	2566890	She does a lot of traveling and basically every time she gets on a plane, she like posts a
2566890	2571710	picture of it after airport security and is like, no one even bat an eye. And, uh, even
2571710	2576470	internationally that's been the case. Um, so I imagine if I had to go to secure locations,
2576470	2581690	which I suppose probably means no random electronics, right? Uh, this probably wouldn't be
2581690	2588030	allowed. Um, but, uh, uh, but yeah, in just in terms of like building security, uh, no, no
2588030	2592410	one's ever, uh, oh, well occasionally someone will ask about it and I say, oh, it's an
2592410	2597310	artificial pancreas and they go, all right. And just kind of hand it back to me. So thank you.
2597310	2604250	Yep. Thank you. And then you, sir. Last question. All right. Um, I guess this might be
2604250	2611070	related to the metabolic rate, but, um, how important is the amount of carbs that you put in
2611070	2615410	whenever you eat them? For example, after exercise, you'll have a different glycemic
2615410	2622050	response. Sure. So what I, what I didn't mention, and I'm actually doing this now, uh, you
2622050	2628410	can, uh, you give this thing, um, a target to hit a normal target to hit, but you can override
2628410	2635610	that temporarily. So what this is saying is until about five, uh, no, uh, all my clocks are
2635610	2640070	off. Okay. At least until about five local time, this is going to set a temporary target of
2640070	2645430	120. And so what that does is it say, okay, I'm going to go easy on the insulin. So if I know
2645430	2650270	I'm going to exercise, I'm going to want it to go easier on me. Uh, so I set one of these
2650270	2657990	temporary targets, uh, and then it abides by that. So I think I had, yeah, nope. Okay. I'm
2657990	2661110	sorry. Um, we can talk later. Uh, but yeah, thanks everybody.
