An iot-based pill management system for elderly