Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key 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
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering

Medicine Reminder using Arduino

By Salman Khan

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
 

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.

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!


Featured Tutorials

  • PS2 Keyboard To Store Text In SD Card Using Arduino Circuit Setup On Breadboard
    How To Use PS2 Keyboard To Store Text In SD Card Using Arduino- (Part 42/49)
  • Wireless Path Tracking System Using Mouse, XBee And Arduino Circuit Setup On Breadboard
    How To Make A Wireless Path Tracking System Using Mouse, XBee And Arduino- (Part 43/49)
  • How to Make a Wireless Keyboard Using Xbee with Arduino- (Part 44/49)
  • Making Phone Call From GSM Module Using Arduino Circuit Setup On Breadboard
    How to Make Phonecall From GSM Module Using Arduino- (Part 45/49)
  • How to Make a Call using Keyboard, GSM Module and Arduino
    How To Make A Call Using Keyboard, GSM Module And Arduino- (Part 46/49)
  • Receiving SMS Using GSM Module With Arduino Prototype
    How to Receive SMS Using GSM Module with Arduino- (Part 47/49)

Stay Up To Date

Newsletter Signup

Sign up and receive our weekly newsletter for latest Tech articles, Electronics Projects, Tutorial series and other insightful tech content.

EE Training Center Classrooms

EE Classrooms

Recent Articles

  • Renesas delivers intelligent sensor solutions for IoT applications
  • Microchip Technology releases AVR-IoT Cellular Mini Development Board
  • Qualcomm acquires Cellwize to accelerate 5G adoption and spur infrastructure innovation
  • MediaTek’s chipset offers high-performance option for 5G smartphones
  • Nexperia’s new level translators support legacy and future mobile SIM cards

Most Popular

5G 555 timer circuit 8051 ai Arduino atmega16 automotive avr bluetooth dc motor display Electronic Part Electronic Parts Fujitsu ic infineontechnologies integratedcircuit Intel IoT ir lcd led maximintegratedproducts microchip microchiptechnology Microchip Technology microcontroller microcontrollers mosfet motor powermanagement Raspberry Pi remote renesaselectronics renesaselectronicscorporation Research samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • Thermal pad
  • lna+mixer noise figure problem
  • ADS Cascode Power Amplifier Loadpull Problem
  • SMPS topology
  • DC DC converter output voltage rise time

RSS Electro-Tech-Online.com Discussions

  • Where is the fuse ?
  • 500+V power supply from 9V battery using ZVS
  • Control Bare LCD With ATmega328p
  • undefined reference header file in proteus
  • Engine compression high voltage ignition voltage?
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2022 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 | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key 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
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering