Autonomous Medicine Dispensing Robot

Project case study

Autonomous Medicine Dispensing Robot

An autonomous medicine dispensing robot that receives patient and dosage data via a web-based interface, securely stores solid tablets or capsules, and accurately dispenses them in a controlled hospital ward setting to improve efficiency and reduce nursing workload.

6/6/2025

Overview

The Autonomous Medicine Dispensing Robot is a compact healthcare-automation concept designed for hospital wards facing workforce shortages, especially among nursing staff. Unlike large stationary pharmacy systems, it is designed to work in tighter ward environments while handling solid medications such as tablets, capsules, and pills.

The Challenge

Medication dispensing is repetitive, time-sensitive, and vulnerable to small workflow errors. The project explored how a compact autonomous system could reduce manual workload while keeping the dispensing process controlled, traceable, and simple for hospital staff to operate.

System Design

The prototype brings together mechanical actuation, embedded control, validation sensing, and a web-based workflow.

  • Modular feeder containers support different pill types.
  • Adjustable crank-slider actuators control pill release.
  • An IR sensor and trap-gate mechanism validate each dose before it is released.
  • A web interface manages patients, medicine logs, and dispensing schedules.
  • An ESP32 connects the robot to a local MySQL database.
  • Real-time clock synchronisation enables scheduled autonomous dispensing.

Results

The first prototype demonstrated that the concept was feasible despite mechanical constraints, including wear and a temporary feeder design.

  • Actuator 3 achieved 88.89% dispensing accuracy.
  • The validation mechanism achieved an average accuracy of 88%.
  • The software architecture reliably triggered dispensing based on scheduled times.

The result is a practical foundation for a safer and more scalable medicine-delivery system in hospital wards. Future iterations should focus on improving mechanical durability, feeder precision, and overall reliability.

What I Learned

Systems Integration

Mechanical tolerances, electronics, embedded logic, and software workflows must be aligned from the beginning. A small issue in a feeder slope or gate design can affect the whole system.

Hardware Reliability

Wear becomes significant in precision mechanisms, and sensor behaviour can change with the colour and material of the medication being detected.

Autonomous Control Logic

Using non-blocking millis()-based logic improved responsiveness. Designing clear actuator states and validation steps made the dispensing sequence easier to test and debug.

Real-Time Data Flow

The project required safe communication between the ESP32 and a database, including reliable JSON handling and scheduled behaviour through real-time clock integration.

Healthcare UX

The interface needed to be simple enough for non-technical staff. That meant designing clear workflows for medicine management, patient registration, and dispensing schedules.

Skills Applied

Robotics and Embedded Systems

  • Robotics hardware design, including actuators, feeders, and IR validation traps
  • Arduino Mega and ESP32 programming
  • Embedded C++ development
  • Servo control, motion sequencing, and real-time clock integration

Software and Data

  • JSON parsing and data structuring
  • HTML, CSS, and PHP for the web interface
  • MySQL database design and integration
  • Local server hosting and API handling

Engineering Practice

  • Designing autonomous workflows and validation mechanisms
  • Debugging mechanical and software constraints together
  • Technical documentation, project planning, and problem solving under hardware limits