Happy Granny is your friendly medication buddy built for older adults who deserve simple routines, fewer worries, and more smiles. Instead of juggling pill boxes and guessing "Did I already take this?", users can quickly scan, schedule, and let the system handle the rest. The goal is comfort, confidence, and consistency, so daily medication feels less like a chore and more like "Grandma-level organized".
Original concept preserved:
- Scan pill using mobile app
- Send data via Bluetooth (BLE)
- ESP32 processes command
- Servo positions dispensing arm
- Motor moves pill into output
Mobile App -> BLE -> ESP32 -> Servo Control -> Motor Driver -> Pill Dispensing
- ESP32-S3
- TT DC Geared Motor
- L298N Motor Driver
- SG90 Servo Motors
- Jumper wires (male-to-male, male-to-female)
- Breadboard or PCB
- External power supply (recommended: 7V-12V for motor driver)
- 5V regulated supply for ESP32 and servos
- USB cable for programming ESP32
| Component | ESP32 Pin | Status |
|---|---|---|
| Servo 1 (active in firmware) | GPIO 10 | Used in current code |
| Motor IN1 | GPIO 5 | Used in current code |
| Motor IN2 | GPIO 4 | Used in current code |
| ENA (PWM, optional speed control) | GPIO 9 | Optional wiring |
NOTE: Verify pins with your actual hardware and firmware before final wiring.
- IN1 -> ESP32 GPIO 5
- IN2 -> ESP32 GPIO 4
- Motor terminals -> DC Motor
- VCC -> External power supply (for example 9V)
- GND -> Common ground with ESP32
- Servo 1 signal -> GPIO 10
- VCC -> 5V
- GND -> Common ground
- Powered via USB or regulated 5V input
IMPORTANT: All grounds must be connected together.
- Do not power motors directly from ESP32.
- Use external supply for motor driver.
- Servos may require a stable 5V supply.
- Ensure common ground between all components.
- Arduino IDE
- ESP32 board package installed
- BLE library
- Servo library (
ESP32Servo)
- Open
ESP32_Motor/ESP32_Motor.ino. - Select board: ESP32-S3.
- Install required libraries.
- Connect ESP32 via USB.
- Upload code.
ESP32_Motor/ESP32_Motor.ino-> Main entry pointESP32_Motor/ble.cpp-> BLE communication handlingESP32_Motor/servo.cpp-> Servo positioning controlESP32_Motor/motor.cpp-> DC motor control
- User scans pill via mobile app.
- App sends command via BLE.
- ESP32 receives signal.
- Servo aligns the correct compartment.
- Motor activates to dispense pill.
- System resets and waits for the next command.
The user uses a mobile application with camera and machine learning to scan and classify pills. The system identifies each pill individually.
After scanning, the application allows the user to schedule which day of the week to take the pills and completes the classification process.
The application sends the classified data to the ESP32-S3 microcontroller via Bluetooth.
The ESP32-S3 rotates the servo arm to the correct box position corresponding to the scheduled day.
After arm positioning, the motor runs to transport the pill to the designated compartment.
The Smart Pill Dispenser follows this workflow: Scanner -> Schedule -> Transmit -> Position Arm -> Transport Pill.
Adjust servo angles in code for:
- Closed/home position
- Open/dispense position
Tune delay values to control:
- Dispense duration
- Over-rotation prevention
Ensure servo positions align with physical compartments accurately.
| Team Member | Role | Main Contribution |
|---|---|---|
| Tasawar-Sanjar Rahman | Computer Vision and ML Engineer | Focused on scanner app integration and machine learning-based pill classification. |
| Thien Phong Dong | Embedded Systems and Electronics Engineer | Focused on BLE communication, motor and servo control, and electrical system integration. |
| Nhan Tran | Mechanical Design and Prototyping Engineer | Focused on DIY fabrication and mechanical design details of the product. |
- Voice assistant integration
- Reminder notifications
- IoT cloud synchronization
- Health monitoring integration