Header Ads Widget

Responsive Advertisement

Smart Medicine Reminder System


 

Smart Medicine Reminder System

Time-Based Automation with Arduino Uno, DS3231 RTC, & LCD Alert Interfaces

📊 Operational Overview & Video Guide System Live Demo

This embedded prototype is designed to alert users at scheduled daily intervals to take their medication. Utilizing high-accuracy tracking via a DS3231 Real-Time Clock (RTC) module and an Arduino Uno processor, the device compares local time coordinates continuously. When a scheduled time is reached, an active buzzer triggers alongside a visual 16x2 LCD alert prompt until acknowledged by a tactile cancel switch.

Standard Reminder Schedule
⏰ 08:00 AM | 02:00 PM | 08:00 PM
Interactive Fail-Safe
🛑 Audio alarm sounds continuously until button-press
🛠️ Structural BOM Requirements Hardware List

To construct this clinical notification alarm prototype, gather the following physical elements:

Target Component Label Structural Allocation Quantity Functional Deployment Purpose
Arduino Uno1 UnitPrimary system processor managing polling loops, temporal evaluations, and peripheral signaling.
DS3231 RTC Module1 UnitHigh-precision timekeeper keeping accurate system hours even when the primary board is unpowered.
16x2 LCD with I2C Module1 UnitPrimary user display output showing real-time clock cycles and specific alert messages.
Active Buzzer1 UnitGenerates high-frequency acoustic feedback during alarm status.
Tactile Push Button1 UnitProvides interactive button control to clear and silence the ongoing buzzer cycle.
🔌 Device Interface Pin Maps I/O Infrastructure

Connect your structural hardware units to the Arduino Uno exactly as structured in the deployment table below:

Interface Wiring Configurations:
Device Terminal Pin OutArduino Target Pin MappingFunctional Context
RTC SDA / LCD SDAAnalog Input Pin A4I2C Bus Serial Data Shared Channel
RTC SCL / LCD SCLAnalog Input Pin A5I2C Bus Serial Clock Shared Channel
Buzzer positive (+)Digital Output Pin D8Active Output Pin driving acoustic alarms
Push Button TerminalDigital Input Pin D7Configured via Internal Pull-up (D7 to GND)
💻 Optimized Production Code Engine Firmware Source

Flash this firmware code directly onto your target MCU within the Arduino IDE environment to boot your hardware system:

#include <Wire.h>
#include <RTClib.h>
#include <LiquidCrystal_I2C.h>

RTC_DS3231 rtc;
LiquidCrystal_I2C lcd(0x27, 16, 2);

// Pins
const int buzzerPin = 8;
const int buttonPin = 7;

// Alarm state
bool alarmActive = false;

// Medicine Times
const int medHour[] = {8, 14, 20};   // 8 AM, 2 PM, 8 PM
const int medMinute[] = {0, 0, 0};

void setup() {
  pinMode(buzzerPin, OUTPUT);
  pinMode(buttonPin, INPUT_PULLUP);

  digitalWrite(buzzerPin, LOW);

  lcd.init();
  lcd.backlight();

  Serial.begin(9600);

  if (!rtc.begin()) {
    lcd.print("RTC Error!");
    while (1);
  }

  // Uncomment ONLY once to set RTC to your PC's time,
  // then comment it again and upload.
  // rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));

  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Medicine");
  lcd.setCursor(0, 1);
  lcd.print("Reminder");
  delay(2000);
}

void loop() {

  DateTime now = rtc.now();

  // Display Current Time
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Time ");

  if (now.hour() < 10) lcd.print("0");
  lcd.print(now.hour());
  lcd.print(":");

  if (now.minute() < 10) lcd.print("0");
  lcd.print(now.minute());
  lcd.print(":");

  if (now.second() < 10) lcd.print("0");
  lcd.print(now.second());

  lcd.setCursor(0, 1);
  lcd.print("Waiting...");

  // Check Medicine Times
  for (int i = 0; i < 3; i++) {
    if (now.hour() == medHour[i] &&
        now.minute() == medMinute[i] &&
        now.second() < 10) {

      alarmActive = true;
    }
  }

  // Alarm
  while (alarmActive) {

    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("TAKE MEDICINE");
    lcd.setCursor(0, 1);
    lcd.print("Press Button");

    digitalWrite(buzzerPin, HIGH);

    if (digitalRead(buttonPin) == LOW) {
      digitalWrite(buzzerPin, LOW);
      alarmActive = false;
      delay(1000);
    }
  }

  digitalWrite(buzzerPin, LOW);

  delay(500);
}
Required Software Dependencies: Ensure that you add RTClib (by Adafruit) and LiquidCrystal_I2C libraries to your local library environment prior to compiling this project.

Post a Comment

0 Comments