Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

Medicine Reminder using Arduino

By Salman Khan April 21, 2008

Sometimes patients forget to take the medicine at the required time of medicines. And sometimes patient also forgets which medicine He/She have to take at required time. And it is difficult for Doctor/Compounder to monitor patients around the clock. To avoid this problem, we have made this medicine reminder system for patients using Arduino.

Block Diagram of Arduino based Medicine Reminder System

Fig. 1: Block Diagram of Arduino based Medicine Reminder System

 

Here are some snapshots depicting the project setup and working of medicine reminder using arduino board.

Prototype of Arduino based Medicine Reminder System

Fig. 2: Prototype of Arduino based Medicine Reminder System

Image of LCD Module showing initial messages on Medicine Reminder System

Fig. 3: Image of LCD Module showing initial messages on Medicine Reminder System

 

Image of LCD Module showing prescribed medical dose on Medicine Reminder System

Fig. 4: Image of LCD Module showing prescribed medical dose on Medicine Reminder System

Image of LCD Module showing time for medical dose on Medicine Reminder System

Fig. 5: Image of LCD Module showing time for medical dose on Medicine Reminder System

 

 

In this system we have used Arduino for controlling the whole system. Working of this project is very simple. In this system ds1307 real time clock chip is used for running the time accurate and to prevent the time after light failure by using 3 volt li-on battery connected with this real time clock chip at pin number 3. SDA and SCK pin of real time clock chip is directly connected with SDA and SCK pin of Arduino (A5 and A4) respectively. These two pins should be pull-up using 10K resistor.

 

When we start this system real time clock runs the time on 16×2 LCD. And if we want to set alarm time for medication we have to press set_mad buttons which is connected with pin number 8 of arduino. After pressing this button LCD shows Set Time 1. And then we can selects the time as we want to set for medication by using INC and Next button which is connected to pin 9 and 10 respectively of arduino. After set time 1, LCD shows set Time 2. Now using previous process set the time again. And after second time set, LCD shows again set time 3. And set this time like previous. In this system “Group medicine” indication (take group 1 medicine, take group 2 medicine and take group 3 medicine) is used instead of medicine name. When any alarm occurs LCD indicates Group medicine 1, Group medicine 2, Group medicine 3.

 

Medication alarm time is also feed in arduino’s internal eeprom to save from lose data after light failure. And real time is continuously checked with saved Arduino’s internal eeprom time. If any match occurs. LCD shows medication group name and buzzer starts beeping continuously. Buzzer is directly connected with pin number 13 of arduino for medication time indication.

16×2 LCD’s data pin D4, D3, D2, D2 are connected with pin5, 4, 3, 2 of arduino. And command pin RS and EN is directly connected with pin 7, 6 of arduino. RWpin of LCD is directly connected with ground.

Programming & Components

Programming

And programing part of this system is much simple. In this program some libraries are used given below:

1.      Wire.h:  for I2C interfacing

2.      RTClib.h: for RTC interfaicng

3.      LiquidCrystal: for 16X2 LCD interfacing

4.      EEPROM.h: for access the internal Arduino’s EEPROM for saving the alarm time.

for RTC interfacing, read real time clock interfacing with arduino previous article.

And for EEPROM interfacing read Internal EEPROM Interfacing using Arduino article on Engineers Garage website.

 

Components Used

1.      Arduino Pro Mini

2.      16X2 Liquid Crystal Display

3.      DS1307

4.      32.768 KHz Crystal Oscillator

5.      3 Volt li-on battery with holder

6.      Push buttons

7.      Buzzer

8.      Connecting wires

9.      Power supply

Project Source Code

###

#include <Wire.h>
#include<EEPROM.h>
#include <RTClib.h>
#include <LiquidCrystal.h>

LiquidCrystal lcd(7, 6, 5, 4, 3, 2); 
RTC_DS1307 RTC;
int temp,inc,hours1,minut,add=11;
int next=10;    
int INC=9;
int set_mad=8;

#define buzzer 13

int HOUR,MINUT,SECOND;

void setup()
{
 Wire.begin();
 RTC.begin();
 lcd.begin(16,2);
 pinMode(INC, INPUT);
 pinMode(next, INPUT);
 pinMode(set_mad, INPUT);
 pinMode(buzzer, OUTPUT);

   lcd.setCursor(0,0);
   lcd.print("Medicin reminder");
   lcd.setCursor(0,1);
   lcd.print(" Using Arduino  ");
    delay(2000);
    lcd.setCursor(0,0);
   lcd.print("By Saddam khan  ");
   lcd.setCursor(0,1);
   lcd.print("Engineers Garage");
    delay(2000);

 if(!RTC.isrunning())
 {
 RTC.adjust(DateTime(__DATE__,__TIME__));
 }
}

void loop()
{
   int temp=0,val=1,temp4;
   DateTime now = RTC.now();
   if(digitalRead(set_mad) == 0)      //set medicine time
   { 
     lcd.setCursor(0,0);
   lcd.print("  Set Medicine  ");
   lcd.setCursor(0,1);
   lcd.print("  Reminder time ");
    delay(2000);
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("Enter Time 1");
    defualt();
    time(1);
    delay(1000);
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("Enter Time 2");
    defualt();
    delay(1000);
    time(2);
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("Enter Time 3");
    defualt();    
time(3);
     lcd.setCursor(0,0);
   lcd.print("Medicin reminder");
   lcd.setCursor(0,1);
   lcd.print("  time has set  ");
    delay(2000);
 }
 lcd.clear();
 lcd.setCursor(0,0);
 lcd.print("Time:");
 lcd.setCursor(6,0);
 lcd.print(HOUR=now.hour(),DEC); 
 lcd.print(":");
 lcd.print(MINUT=now.minute(),DEC);
 lcd.print(":");
 lcd.print(SECOND=now.second(),DEC);
 lcd.setCursor(0,1);
 lcd.print("Date: ");
 lcd.print(now.day(),DEC);
 lcd.print("/");
 lcd.print(now.month(),DEC);
 lcd.print("/");
 lcd.print(now.year(),DEC);
 match();
 delay(200);
}

void defualt()
{
  lcd.setCursor(0,1);
  lcd.print(HOUR);
  lcd.print(":");
  lcd.print(MINUT);
  lcd.print(":");
  lcd.print(SECOND);
}

/*Function to set alarm time and feed time into Internal eeprom*/

void time(int x)  
{
  int temp=1,minuts=0,hours=0,seconds=0;
    while(temp==1)
    {
     if(digitalRead(INC)==0)
     {
      HOUR++;
      if(HOUR==24)
      {
       HOUR=0;
      }
      while(digitalRead(INC)==0);
     }     
lcd.clear();
      lcd.setCursor(0,0);
    lcd.print("Enter Time ");
   lcd.print(x); 
    lcd.setCursor(0,1);
    lcd.print(HOUR);
    lcd.print(":");
    lcd.print(MINUT);
    lcd.print(":");
    lcd.print(SECOND);
    delay(100);
    if(digitalRead(next)==0)
    {
      hours1=HOUR;
      EEPROM.write(add++,hours1);
     temp=2;
     while(digitalRead(next)==0);
    }
    } 
    while(temp==2)
    {     
if(digitalRead(INC)==0)
     {
      MINUT++;
      if(MINUT==60)
      {MINUT=0;}
      while(digitalRead(INC)==0);
     }
      lcd.clear();
      lcd.setCursor(0,0);
    lcd.print("Enter Time ");
   lcd.print(x); 
    lcd.setCursor(0,1);
    lcd.print(HOUR);
    lcd.print(":");
    lcd.print(MINUT);
    lcd.print(":");
    lcd.print(SECOND);
    delay(100);
      if(digitalRead(next)==0)
      {
       minut=MINUT;
       EEPROM.write(add++, minut);
       temp=0;
       while(digitalRead(next)==0);
      }
    }
    delay(1000);
}


/* Function to chack medication time */

void match()
{
  int tem[17];
  for(int i=11;i<17;i++)
  {
    tem[i]=EEPROM.read(i); 
 }
  if(HOUR == tem[11] && MINUT == tem[12]) 
  {
   beep();
   beep();
   beep();
   beep();
   lcd.setCursor(0,0);
   lcd.print("  Take Group One  ");
   lcd.setCursor(0,1);
   lcd.print("     Medicine     ");
   beep();
   beep();
   beep();
   beep();
  }

   if(HOUR == tem[13] && MINUT == tem[14])
   {
      beep();
   beep();
   beep();
   beep();
    lcd.setCursor(0,0);
   lcd.print("  Take Group Two  ");
   lcd.setCursor(0,1);
   lcd.print("     Medicine     ");
    beep();
   beep();
   beep();
   beep();
   }


   if(HOUR == tem[15] && MINUT == tem[16] )
   {  
     beep();
   beep();
   beep();
   beep();
    lcd.setCursor(0,0);
   lcd.print("Take Group Three ");
   lcd.setCursor(0,1);
   lcd.print("     Medicine    ");
   beep();
   beep();
   beep();
   beep();
   }
}

/* function to buzzer indication */

void beep()
{
   digitalWrite(buzzer,HIGH);
   delay(500);
   digitalWrite(buzzer, LOW);
   delay(500);
}
 

###

 


Circuit Diagrams

Circuit-Diagram-Arduino-Based-Medicine-Reminder-System

Project Video


Filed Under: Electronic Projects
Tagged With: Arduino, reminder
 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: 5G Technology
This Tech Toolbox covers the basics of 5G technology plus a story about how engineers designed and built a prototype DSL router mostly from old cellphone parts. Download this first 5G/wired/wireless communications Tech Toolbox to learn more!

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • mosfet driver problem in regeneration mode
  • What is the purpose of this relay?
  • Industrial Relay Board Design for Motorcycle Use
  • ADEM III ECM — No CAN Signal & Power Supply Issue
  • Snooping Around is All

RSS Electro-Tech-Online.com Discussions

  • Pic18f25q10 osccon1 settings swordfish basic
  • Sump pit water alarm - Kicad 9
  • Anyone jumped from Easyeda std to Easyeda pro?
  • turbo jet fan - feedback appreciated.
  • More fun with ws2812 this time XC8 and CLC

Featured – LoRa/LoRaWan Series

  • What is the LoRaWAN network and how does it work?
  • Understanding LoRa architecture: nodes, gateways, and servers
  • Revolutionizing RF: LoRa applications and advantages
  • How to build a LoRa gateway using Raspberry Pi
  • How LoRa enables long-range communication
  • How communication works between two LoRa end-node devices

Recent Articles

  • How IoT network topologies work
  • The top five AI startups to watch in 2025
  • STMicroelectronics unveils SoC based on secure MCU
  • Nexperia’s 48 V ESD diodes support higher data rates with ultra-low capacitance design
  • Taoglas releases Patriot antenna with 18 integrated elements covering 600 to 6000 MHz

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe