Chapter 10
Kidneys, gut, and hormones: the internal regulators The body's slow regulators, the devices around them, and the units that bite
Human Biology for the Medical Maker
Welcome to chapter ten. Chapter nine ended with a one-page map of the systems the book had not yet opened. This chapter opens three of them: the kidneys and urinary tract, the digestive system, and the hormone system. They share something that matters to an engineer. They are the body's slow regulators. Nerves act in milliseconds; these systems act over minutes, hours and days, keeping water, salt, potassium, acid, glucose and calcium inside the narrow ranges that cells tolerate.
Why this chapter exists Data : urine output, fluid balance, glucose, kidney function, hormone levelsDevices : catheters, feeding tubes, stomas, glucose meters, CGMs, insulin pumpsControl systems : gain, delay, and set point — literallyUnits differ between countries and laboratories Patients and families built working closed-loop insulin systems in open source before the first commercial one was approved.
You will meet these systems in three ways. As data: urine output, fluid balance, blood glucose, kidney function and hormone levels are among the most recorded numbers in medicine, and every one of them comes with units that differ between countries and laboratories. As devices: catheters, drainage bags, feeding tubes, stoma appliances, glucose meters, continuous glucose monitors and insulin pumps, used by millions of people at home. And as control systems. Hormonal regulation is feedback control with gain, delay and a set point. Automated insulin delivery is literally a control engineer's problem, and a community of patients and developers built working closed loops in open source before the first commercial system was approved.
The kidneys and urinary tract A filter followed by a refinery
We start with the kidneys: two fist-sized organs that receive about a fifth of everything the heart pumps.
Anatomy Two kidneys against the back wall, each about 11–12 cm and 150 g Receive 20–25% of cardiac output — about a litre a minute — to process it Ureters carry urine down by peristalsis to the bladder Urethra about 4 cm in women, about 20 cm in men That length difference shapes infection risk, catheter design, and continence products.
The two kidneys lie against the back wall of the abdomen at about the level of the lowest ribs, each eleven or twelve centimetres long and about a hundred and fifty grams. Together they receive twenty to twenty-five percent of the cardiac output, about a litre of blood a minute, far more than their own metabolism needs. That flow is there to be processed. Each kidney drains through a ureter, a muscular tube that pushes urine down to the bladder by peristalsis rather than gravity alone. The urethra then carries it out: about four centimetres long in women and about twenty in men, a difference that shapes infection risk, catheter design and continence products.
The nephron: filter, then refinery Filtration at the glomerulus (~180 L a day), then reabsorption and secretion along the tubule; ~1–2 L of urine
Each kidney contains around a million nephrons, and each one works in two stages. First, filtration. At the glomerulus, a knot of capillaries, blood pressure pushes water and small solutes through a filter while cells and most proteins stay behind. Across both kidneys that is about a hundred and twenty millilitres a minute, roughly a hundred and eighty litres a day. Your whole plasma volume is filtered about sixty times daily. Second, reabsorption and secretion. The filtrate contains everything the body needs, so the tubule spends most of its energy taking it back: more than ninety-nine percent of the water, all the glucose, most of the salt. Meanwhile it secretes hydrogen ions, potassium and many drugs into the urine.
Why such a wasteful design? Filter everything, then take back only what you mean to keep. A whitelist, not a blacklist. Toxins and drug metabolites the kidney has never met are removed by default.
This design looks wasteful. Filter everything, then laboriously take most of it back. It is in fact robust. Anything the body has not specifically decided to keep is removed by default, including toxins and drug metabolites the kidney has never encountered. A software engineer will recognise the pattern: it is a whitelist rather than a blacklist. A blacklist has to anticipate every harmful substance. A whitelist does not.
What the kidneys regulate Quantity Main control Water Antidiuretic hormone (ADH) and thirst Sodium and blood volume Renin, angiotensin, aldosterone Potassium Aldosterone; too high or too low disturbs heart rhythm Acid–base Reclaims bicarbonate; excretes 50–100 mmol of acid a day Calcium and phosphate Parathyroid hormone; vitamin D activation Red cell production Erythropoietin — why kidney failure causes anaemia Long-term blood pressure Largely a kidney decision
The kidneys regulate far more than water. They vary how much water the collecting duct reclaims, under antidiuretic hormone from the pituitary. They control sodium and so blood volume, through the renin, angiotensin and aldosterone system. They set potassium, and both too much and too little disturb heart rhythm. With the lungs they manage acid and base, excreting fifty to a hundred millimoles of acid a day. They handle calcium and phosphate and activate vitamin D. They release erythropoietin when oxygen delivery falls, which is why kidney failure causes anaemia. And long-term blood pressure is largely a kidney decision.
Watching and measuring kidney function Urine output Minimum about 0.4–0.5 L a day to clear waste Falling output can be the first sign of trouble Often recorded hourly from a catheter eGFR from creatinine Creatinine: muscle waste, filtered, barely reabsorbed Stages G1 (90 and over) to G5 (under 15) Least reliable at the extremes of muscle mass Feeds directly into drug dosing The kidneys must pass at least about half a litre of urine a day to clear the day's waste at maximum concentration. That is why urine output is watched so closely in unwell people; falling output can be the first sign that the kidneys are short of blood flow, and it is often measured hourly from a catheter. Filtration itself cannot be measured at the bedside, so it is estimated, usually from the blood level of creatinine, a muscle waste product. If filtration halves, creatinine roughly doubles. The estimate, called eGFR, stages chronic kidney disease. Because creatinine comes from muscle, the estimate is least reliable in frail older people, amputees, body builders and children. And eGFR adjusts drug doses, so it feeds straight into prescribing software.
Continence, and where design helps Type Mechanism Where design helps Stress Weak sphincter or pelvic floor Training aids, pads, supports Urge Overactive bladder muscle Toilet access, signage, reminders Overflow Bladder cannot empty Catheterisation Functional Mobility, dexterity, vision, or cognition A design problem : fastenings, rails, way-finding, one-handed urinals
The bladder fills quietly; a first urge comes at around a hundred and fifty to two hundred and fifty millilitres and typical capacity is four to six hundred. Emptying is a reflex, permitted or postponed by the brain. So continence depends on muscles, nerves, the brain, and the ability to get to a toilet in time and manage clothing. Stress incontinence is a weak outlet; urge incontinence an overactive bladder; overflow a bladder that cannot empty. Functional incontinence is the one to notice: the urinary system works, but mobility, dexterity, vision or cognition stop the person getting there. That is a design problem. Incontinence also drives skin damage and night-time falls.
Catheters, and the drainage rules Indwelling, intermittent, suprapubic, external A tube is a highway for bacteria; biofilms form on it Closed system · bag below the bladder · off the floor No kinks or dependent loops · empty without touching the outletIndwelling catheters are among the commonest causes of healthcare-associated infection.
A urinary catheter drains the bladder through a tube. An indwelling catheter is held in by a small water-filled balloon and drains continuously into a bag. Intermittent self-catheterisation uses a fresh catheter several times a day, a task needing dexterity, vision and privacy, and a frequent subject of adaptive aids. Indwelling catheters are among the commonest causes of infection acquired in hospital, because the tube is a highway for bacteria and biofilms grow on it. The drainage rules follow directly. Keep the system closed. Keep the bag below the bladder so urine cannot flow back. Keep it off the floor. Keep the tubing free of kinks. And empty the bag without touching its outlet to anything.
The digestive system A tube, its glands, and a lot of fluid
Now the gut: a tube from mouth to anus, with glands emptying into it.
The tube and its timings Mouth to anus: the stomach stores and acidifies, the small intestine absorbs nearly everything, the large intestine recovers water. Timings vary widely.
Transit times vary widely — orientation only.
The digestive system is a tube: mouth, pharynx, oesophagus, stomach, small intestine, large intestine, rectum and anus, with the salivary glands, liver, gallbladder and pancreas emptying into it. Strictly, food in the tube is still outside the body; only what crosses the lining is absorbed. The stomach stores, acidifies and churns for a few hours. The small intestine, three to five metres long in life, does nearly all the digestion and absorption. The large intestine recovers water and salt over one to three days. These timings vary widely between people and from day to day, so treat them as orientation only.
Stomach and small intestine Stomach Acid at pH about 1.5–3.5 Destination of feeding tubes Degrades many materials and drugs Confirm tube position before use Small intestine Duodenum receives bile and pancreatic juice Folds, villi, microvilli: three levels of area Surface area: 200–300 m² in old texts, about 30 m² in a 2014 re-measurement The stomach's acid, at a pH of roughly one and a half to three and a half, kills many microbes and starts protein digestion. For a designer it matters as the destination of feeding tubes, as an acid environment that degrades materials and drugs, and as the reason a nasogastric tube's position must be confirmed before anything goes down it. A tube in the airway delivers feed into the lungs. The small intestine receives bile and pancreatic juice and absorbs almost everything, across a lining folded three times over. How much area? Older textbooks said two to three hundred square metres, a tennis court. A careful 2014 re-measurement put it at about thirty. When a number is famous, check where it came from.
The fluid budget 9 L in, ~0.15 L out
About 2 L drunk and eaten plus about 7 L secreted into the gut each day; almost all reabsorbed
Lose that reabsorption — severe diarrhoea, a high-output stoma — and dehydration comes within hours.
The fluid accounting of the gut is striking. You drink and eat about two litres a day, and roughly seven more are secreted into the gut as saliva, gastric juice, bile, pancreatic juice and intestinal fluid. Normally all but a hundred or two hundred millilitres is reabsorbed. If that fails, in severe diarrhoea or from a high-output stoma, a person can lose litres of fluid and salt a day and become dangerously dehydrated within hours. The large intestine also houses most of the gut microbiome, tens of trillions of bacteria, roughly as many cells as the body itself. Antibiotics disturb them, which is one reason antibiotic use has side effects.
Liver, gallbladder, pancreas Liver about 1.5 kg; portal vein brings blood straight from the gut Stores glucose, makes clotting factors, clears drugs, makes bile First-pass metabolism removes much of some oral drugsPancreas: enzymes and bicarbonate, plus islets making insulin and glucagon The liver, about one and a half kilograms, is the largest internal organ. Most of its blood arrives through the portal vein straight from the gut, so everything absorbed passes through the liver before reaching the rest of the body. It stores glucose, makes albumin and most clotting factors, clears drugs, alcohol and toxins, and makes half a litre to a litre of bile a day to emulsify fats. Its first-pass metabolism removes much of some oral drugs before they reach the circulation. When it fails to process haemoglobin breakdown products you see jaundice. The pancreas is two organs in one: mostly digestive enzymes and bicarbonate, with small islets, one or two percent of its mass, making insulin and glucagon.
When the tube cannot be used normally Situation What is done Design-relevant point Cannot swallow safely Enteral feeding: nasogastric or gastrostomy tube Position checks; securing without pressure injury; feed pumps Gut cannot absorb Parenteral nutrition, intravenously Central access; infection risk Bowel removed or rested A stoma: colostomy, ileostomy, urostomy Adhesive appliances on skin that moves and changes shape
When the gut cannot be used normally there are three main responses. If someone cannot swallow safely, nutrition goes through a tube into the gut: through the nose, or for longer use through the abdominal wall into the stomach. That raises tube position, securing without pressure injury, and feed pumps. If the gut cannot absorb, nutrition goes into a vein, with all the infection risk of central access. And if part of the bowel is removed or rested, a stoma brings it out through the abdominal wall. Stoma appliances are adhesive, changed every day or few days, on skin that moves and changes shape: chapter five's contact problems in their hardest form.
The connector that cannot be connected wrongly Not a warning label, not a colour — a shape that makes the error physically impossible. ISO 80369 small-bore connectors; the enteral design is known as ENFit.
Feeding tubes once used the same connectors as intravenous lines, and people died when liquid feed, or drugs meant for the gut, were connected into a vein. The international response was the ISO eighty thousand three hundred and sixty-nine series of connector standards, which gives each application, enteral, respiratory, neuraxial and intravascular, a geometrically incompatible connector. The enteral one is widely known as ENFit. This is the top of the risk-control hierarchy: not a label, not a colour, but a shape that makes the error impossible. Anything you design for a feeding line must use the correct connector and must never include an adaptor that defeats it.
The endocrine system A broadcast channel with time constants
Hormones as a broadcast channel Nerves: wired, point to point, milliseconds Hormones: broadcast to every cell with the receptor Half-lives: adrenaline minutes, cortisol about an hour, thyroxine about a week Read the half-lives as time constants — they set how fast each loop can respond.
A hormone is a chemical messenger released into the blood that acts on any cell carrying its receptor. Where the nervous system is a wired network sending point-to-point messages, the endocrine system is a broadcast: slow to start, slow to stop, reaching everywhere at once. Hormones also differ enormously in how long they last. Adrenaline's half-life is two or three minutes, insulin's four to six, cortisol's about an hour, and thyroxine's about a week, which is why thyroid dose changes take weeks to settle. A control engineer reads that list as time constants, and they decide how often it makes sense to measure and adjust.
Axes: three-level cascades with feedback Hypothalamus signals the pituitary, which signals the gland Each level is inhibited by the product TSH is the usual first thyroid test — the controller's output Cortisol has a daily rhythm: record the sample time The hypothalamus, at the base of the brain, signals the pituitary gland beneath it, which in turn signals glands throughout the body. These form axes: three-level cascades with negative feedback at each level. The thyroid axis is the cleanest. The hypothalamus releases a hormone that makes the pituitary release TSH, which makes the thyroid release thyroxine, and thyroxine inhibits both levels above. Low thyroid hormone raises TSH, high suppresses it. That is why TSH is the usual first thyroid test: it is the controller's output, and it amplifies small changes. The adrenal axis has the same shape with a strong daily rhythm, so a cortisol sample's time must always be recorded.
Glucose: the most engineered loop in the body Insulin lowers glucose; glucagon raises it Fasting glucose about 4–6 mmol/L; below about 4 is hypoglycaemia HbA1c reflects the last two to three months Type 1: controller destroyed. Type 2: tissues resist insulin The brain uses about a hundred and twenty grams of glucose a day and stores very little, so blood glucose must be held up between meals and down after them. Two opposed hormones do most of the work: insulin moves glucose into tissues and tells the liver to store it; glucagon tells the liver to release it. Fasting glucose is normally about four to six millimoles per litre. Below about four is hypoglycaemia, with sweating, confusion and, if severe, seizures. Prolonged high glucose damages vessels, nerves, eyes and kidneys. In type one diabetes the immune system destroys the controller and insulin must be replaced for life. In type two the tissues respond poorly and the pancreas cannot keep up. Both are largely self-managed at home.
Engineering bridge Filters, transit, loops, and units
Now the engineering bridge: four ideas that turn this physiology into numbers.
Clearance, and what dialysis really replaces Clearance C = U × V / P Example: 10 × 1.2 / 0.1 = 120 mL/min — a normal GFR Healthy kidneys: about 1,200 L of plasma a week Haemodialysis at 200 mL/min for 12 h: about 144 L Dialysis replaces filtering, not hormones Clearance is the volume of plasma completely cleared of a substance per minute: urine concentration times urine flow, divided by plasma concentration. Urine creatinine of ten millimoles per litre, flow of one point two millilitres a minute, plasma creatinine of point one gives a hundred and twenty millilitres a minute, a normal filtration rate. The same equation describes an artificial kidney. Now compare totals. Healthy kidneys process about twelve hundred litres of plasma a week. Haemodialysis clearing two hundred millilitres a minute for twelve hours a week clears about a hundred and forty-four. Dialysis works, people live on it for years, but it is an order of magnitude less filtration, in pulses, with none of the kidney's hormones.
The glucose loop, natural and artificial Element Natural pancreas Automated insulin delivery Sensor Blood, continuously Interstitial fluid; lags 5–15 min; noise and drift Actuator Into the portal vein; minutes Under the skin; starts 10–20 min, peaks 1–2 h Feedforward Gut hormones warn of meals User announces meals and estimates carbohydrate Opposing actuator Glucagon Usually none — can stop insulin, cannot raise glucose
Delay is the enemy of control. Insulin already given cannot be taken back.
Every hormonal loop has a set point, a sensor, a controller with gain, an actuator, and delays. Delay is the enemy of control: long delay with high gain overshoots and oscillates. Compare the natural and artificial glucose loops. The pancreas senses blood directly and releases insulin into the portal vein, acting within minutes. A continuous glucose monitor senses interstitial fluid and lags blood by five to fifteen minutes. Insulin under the skin takes ten to twenty minutes to start and peaks after one to two hours. The gut warns the pancreas of meals; the user must announce them. And most systems have insulin only. Commercial algorithms are deliberately conservative, because insulin already given cannot be taken back.
Units: where this chapter's numbers bite Quantity Units Hazard Glucose mmol/L and mg/dL (×18) 6 is normal in one, dangerously low in the other Creatinine μmol/L and mg/dL (×88.4) 1.0 mg/dL is about 88 μmol/L HbA1c mmol/mol and % Non-linear; 48 mmol/mol is about 6.5% Insulin Units per mL U-100 is standard, but U-200 to U-500 exist: volume is not dose
Here a unit error is a dosing error, and a dosing error can kill within hours.
This is where the chapter's numbers bite. Glucose is reported in millimoles per litre or milligrams per decilitre, a factor of eighteen apart. A reading of six is normal in one and dangerously low in the other. Creatinine differs by a factor of eighty-eight. HbA1c has two scales with a non-linear relationship. Insulin is usually a hundred units per millilitre, but concentrated insulins exist, so a volume is not a dose unless the concentration is known. If you write software that touches any of these, store the unit with the value, reject ambiguous input, never infer the unit from the size of the number, show it every time, and treat any code that calculates a dose as a regulated medical device.
Where a maker fits Catheterisation and stoma trainer consumables: cast silicone, fabric-backed pads Adaptive continence and self-catheterisation aids — sewn, wire, sheet metal, moulded Bench dialysis and diffusion demonstrations in lab glassware Software on synthetic or public glucose data; unit-safe data types; accessibility Not: anything that calculates a dose, connects to a pump, or sits in a feeding line.
So where can you contribute? Physically: catheterisation and stoma trainer consumables, cast in silicone with fabric-backed abdominal pads; adaptive aids for self-catheterisation and continence, designed with an occupational therapist and the user, often sewn, bent wire, sheet metal or moulded; and bench demonstrations of diffusion and dialysis using laboratory glassware and tubing. In software: visualisation and education on synthetic or public glucose data, unit-safe data handling, and the accessibility of the diabetes apps millions rely on. And clearly not: anything that calculates a dose, connects to a pump, or sits in a feeding line.
Worked example: the drainage-bag hanger Below the bladder in every chair positionClear of the floor ; outlet accessible without touching anythingNo kinks or dependent loops in the tubing Measuring scale readable in place — hourly output is data Cleanable, no sharp edges, no snagging on transfers, a dignity cover A passive bracket sits in a closed fluid system with a flow direction, an infection risk, and a measurement role.
A ward sister asks for a clip-on hanger so drainage bags stop ending up on the floor when patients sit out in chairs. It sounds like furniture. Work through the physiology first. The bag must stay below the bladder in every chair position, so urine cannot flow back. It must be clear of the floor, with the outlet reachable for emptying without touching anything. The tubing must have no kinks or dependent loops. The measuring scale must be readable in place, because hourly output is clinical data. It must be cleanable, free of sharp edges near fragile skin, not catch on hoists or transfers, and offer a dignity cover. Then test it on the real chairs with the staff who empty the bags.
Workshop exercise and exit criteria Clearance arithmetic — including one deliberate unit error Bench dialysis: tubing, salt, starch, a conductivity meter A toy glucose loop with sensor and actuator delays — labelled toy model A unit-carrying glucose type with tests Draw a nephron; explain the thyroid axis and the glucose loop as control systems For the exercises: calculate clearance for three invented cases, one with a plasma value entered in the wrong unit, and comment on the result. Run a bench dialysis with dialysis tubing, salt and starch, measuring conductivity over an hour, then stir, then replace the water, and explain the difference. Build a toy glucose loop in a spreadsheet or Python with sensor and actuator delays, vary the gain, and label every output as a toy model. Write a glucose type that cannot exist without a unit. To finish, draw a nephron from memory and explain the thyroid axis and the glucose loop as control systems.
What this chapter does not establish You cannot interpret kidney, liver, or hormone results You cannot manage catheters, feeding tubes, or stomas You cannot design dosing software or insulin algorithms for anyone's use The toy glucose model is not physiology Next — How disease works: from mechanism to symptom.
The limits. You know what the tests measure, but what a result means for a person is a clinical judgement. Inserting and caring for catheters, feeding tubes and stomas are clinical and nursing skills learned under supervision. Building something people rely on to dose insulin is regulated medical-device work with a clinical and regulatory team; the open-source projects are explicit that their users take responsibility only for themselves. And your toy glucose model shows the shape of a control problem, not physiology. Next, how disease works.