An embedded IoT system that combines real-time scheduling, event-driven sensing, and automated dispensing to improve medication adherence.
Medication adherence failures are common due to:
- Missed reminders
- Manual tracking inefficiency
- Lack of real-time feedback
This system provides a low-cost, automated solution that handles:
- Scheduling
- Alerting
- Dispensing
- Logging
The system integrates multiple subsystems:
- ESP32 → control + WiFi interface
- RTC (DS3231) → precise time scheduling
- Servo Motor → pill dispensing mechanism
- IR Sensor → user interaction detection
- Keypad → runtime configuration
- LCD Display → real-time feedback
- Buzzer → alert system
- Web Interface → monitoring + logging
User Input (Keypad / Web UI)
↓
ESP32 Controller
┌────────┼────────┐
↓ ↓ ↓
RTC IR Sensor Web Server (WiFi AP)
↓ ↓
Scheduler Event Trigger
↓
Control Logic
↓
Servo Actuation → Tablet Dispense
↓
LCD + Buzzer Feedback
- RTC continuously tracks real-time
- At scheduled time → automatic dispensing
- Daily reset of medication state
- IR sensor detects user presence
- Implements cooldown to prevent repeated triggers
- Enables manual override dispensing
- Keypad allows dynamic time setting
- No need to reprogram ESP32
- ESP32 hosts WiFi Access Point
- Browser-based logging interface
- No internet dependency
-
User sets schedule via keypad
-
RTC monitors real-time clock
-
At scheduled time:
- Buzzer alert triggered
- LCD displays reminder
- Servo dispenses tablet
-
IR sensor detects interaction:
- Allows manual dispensing
-
System logs and updates status
-
Upload firmware (
med_tracker.ino) to ESP32 -
Connect hardware components
-
Power system (external supply recommended)
-
Connect to WiFi:
SSID: MedicationTracker Password: 123456789 -
Open browser → ESP32 IP (shown in serial monitor)
-
Use keypad + web UI
| Component | Qty | Cost (INR) |
|---|---|---|
| ESP32 | 1 | ₹400 |
| RTC DS3231 | 1 | ₹120 |
| LCD (I2C) | 1 | ₹180 |
| IR Sensor | 1 | ₹60 |
| Servo Motor | 1 | ₹150 |
| Keypad (4x4) | 1 | ₹100 |
| Buzzer | 1 | ₹20 |
| Misc | - | ₹100 |
Total: ₹1200–₹1400
- Hybrid time-triggered + event-driven system
- Embedded real-time scheduling
- Local WiFi interface (no internet required)
- Automated dispensing mechanism
- Runtime configurable (no reflashing needed)
- Multi-modal feedback (LCD + buzzer)
- Accurate time-based dispensing achieved
- Reliable IR-based triggering with cooldown logic
- Stable ESP32 web server hosting
- Successful integration of hardware + UI
- No cloud sync (local-only system)
- No user authentication
- Open-loop system (no confirmation of pill intake)
- Cloud integration (Firebase / MQTT)
- Mobile notifications
- Multi-user support
- Intake verification (weight sensor / camera)
- Data analytics dashboard
This project demonstrates embedded systems integration, real-time control, and IoT-based human interaction design, combining hardware and software into a complete working system.