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.
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.
Fig. 2: Prototype of Arduino based Medicine Reminder System
Fig. 3: Image of LCD Module showing initial messages on Medicine Reminder System
Fig. 4: Image of LCD Module showing prescribed 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
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
Project Video
Filed Under: Electronic Projects
Filed Under: Electronic Projects
Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.