A prototype design of an automated system for urine bag emptying using an Internet of Things (IoT) based ultrasonic sensor has been developed. The system comprises an HC-SR04 Ultrasonic Sensor, an SG90 Micro Servo Motor, NodeMCU ESP8266, a Liquid Crystal Display (LCD), and Blynk integration. The servo motor is employed to open the valve for urine discharge and close it once the process is completed. The servo motor's movement is determined by the urine's detected height using the ultrasonic sensor, and it can be controlled through the Blynk platform. The reference heights for urine management are set at half the urine bag's capacity or 8 cm, triggering a 180º rotation of the servo motor, and at 0 cm, causing the servo motor to move to 0º. The measured urine height is displayed on the LCD and the Blynk IoT interface. The ultrasonic sensor's characterization results reveal an error percentage of 0.02%, a sensitivity value of 58.203 µs/cm, an offset value of 0.0123, and a coefficient of determination R2 of 0.9999. Based on the conducted measurements, analysis, and testing, it can be concluded that the system functions effectively.