Skip to content

alexrturner/IoT-Medication-Reminder-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IoT MedHelper

This project contains the hardware, software, prototype documentation and results for the report IoT-based Medication Reminder and Dispenser.

LICENSE

All Contributors

Overview

Medication adherence is necessary for the health and wellbeing of any individual taking prescription medication, however correctly managing medication can prove to be a stressful day-to-day challenge. This report outlines decisions made in the design of an Internet of Things (IoT)-based Medication Reminder and Dispenser system that is able to accurately dispense pills according to a schedule set by a user, detect whether a user has adhered to their medication plan, automatically remind patients of upcoming medication schedules, and notify caregivers when medication has been missed. In this report, the limitations of other medication dispensing and reminding systems are first assessed, and key aims and requirements are outlined for the proposed system. The system design is then comprehensively described. A complete overview of components involved in the system, a breakdown of production costs, the process of design, technical challenges encountered, and a description of how these components work together are detailed. An analysis of tests on the system is then presented and the design of the system is assessed. Finally, the significance of the design’s accomplishments and shortcomings are discussed, and future developments and ethical considerations are proposed. This device is comprised of: a motor-based dispensing system; an LDR-based sensing system for detecting the presence of pills; a WIFI-enabled gateway for communicating information over a network; a web-based user interface for users to input their specific medication requirements and contact details; and a server for storing user details and sending out email reminders and notifications.

System Architecture

Hardware

  • ESP8266 microcontroller (FireBeetle-ESP8266)
  • Servo motor (GPIO2) for dispensing
  • LED indicators (GPIO14)
  • Light sensor/LDR (ADC0) for pill detection
  • WiFi-enabled gateway for network communication

Software

  • Django framework
  • PostgreSQL database
  • REST API for hardware communication
  • Email notification system (SMTP)

Installation

Software Setup

  1. Clone the repository:
git clone https://github.com/yourusername/MedHelper.git
cd software
  1. Create and activate virtual environment:
conda env create -f environment.yml -n MedHelper
conda activate MedHelper
  1. Install dependencies:
pip install -r requirements.txt
  1. Configure environment:
cp .env.example .env
# Edit .env with your database and email credentials
  1. Set up PostgreSQL:
# Create database
createdb medhelper_db
  1. Run migrations and start server:
python manage.py makemigrations app
python manage.py migrate
python manage.py runserver

Hardware Setup

  1. Create config.py with your credentials:
class Config:
    API_ENDPOINT = "http://your-api-endpoint"
    API_USERNAME = "your-username"
    API_PASSWORD = "your-password"
    WIFI_SSID = "your-wifi-name"
    WIFI_PASSWORD = "your-wifi-password"
    DEFAULT_EMAIL = "patient@email.com"
    EMERGENCY_EMAIL = "emergency@email.com"
  1. Upload files to ESP8266 in this order:
    1. config.py
    2. urequests.py
    3. boot.py
    4. All other .py files
    5. main.py

Operation

The system operates in three phases:

  1. Initialisation:

    • Connect to WiFi
    • Sync time with NTP server
    • Check medication schedule from server
  2. Medication Management:

    • Dispense medication at scheduled times
    • Notify user
    • Monitor pill retrieval via light sensor
  3. Monitoring & Notifications:

    • Track medication adherence
    • Send emergency notifications for missed doses
    • Update server with status

Note: This system is designed to assist with medication management but should not be used as a replacement for professional medical advice or care.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published