Project 04
UroLab
A low-cost device to measure urine flow and hydration at home, for patients with or recovering from an enlarged prostate. My masters design project, built with a multidisciplinary team.
- Role
- UroLab hardware and firmware, FlowMasta, the app link
- When
- Oct 2020 to Jan 2021
- Where
- University of Southampton, MEng
- Stack
- FreeRTOS, Bluetooth LE, Android, Python

The problem
The brief was two low-cost flowmeters for patients to use at home: UroScale, based on Bluetooth scales, and UroLab, which tests a new way of measuring flow with a drainage hole.
My part was UroLab, the FlowMasta test rig and the link between them and the Android app. It had to measure very low flow rates, around 1 mL/s, while the liquid drains out.
What I built
Firmware on FreeRTOS
A control task reads each command from Bluetooth and runs the device as a state machine, keeping pressure sampled at a constant rate. The device switches itself off after 60 seconds idle.
Flow from pressure
A hydrostatic pressure sensor tracks the height of the liquid as it drains, so flow rates around 1 mL/s can be measured continuously.
Hydration by colour
My own library for the RGB sensor. I moved the LEDs across the container to stop reflections and took readings with them off and on to cancel ambient light. It told apart all 8 hydration levels of the test chart.
A soft power switch
The board drew about 3 mA asleep, which would have needed a 24,000 mAh battery to last a year. A button and a MOSFET that the microcontroller holds on fixed it; I simulated it, then built it on breadboard and Veroboard.
FlowMasta, the test rig
A pump that plays flow profiles from a spreadsheet, through a serial interface and a Python app anyone in the team could run. I fixed its drift with a buffer tank and by breaking the siphon.
The Android link
Found why the app could not find the device on newer phones (Android 10's runtime permissions) and fixed it, and rewrote the flow calculation with a moving average of our own.
On the bench





Hardware and software
Building a device that needs an app?
From the sensor to the phone, I have done each part. Tell me what you are making.