6-doc-microcontroller based patient medicine reminder system

Upload: aadhya-suman

Post on 03-Jun-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    1/59

    MICROCONTROLLER BASED PATIENT MEDICINE

    REMINDER SYSTEM

    B.Tech. MINI Project Report

    AMRITHA P.SHYAM

    GUJJULA KAVYA REDDYMONICA MADDUKURI

    DEPARTMENT OF BIO-MEDICAL ENGINEERING

    GOKARAJU RANGARAJU INSTITUTE OFENGINEERING AND TECHNOLOGY

    (Affiliated to Jawaharlal Nehru Technological University)

    HYDERABAD 500 090

    2010

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    2/59

    MICROCONTROLLER BASED PATIENT MEDICINE

    REMINDER SYSTEM

    Project Report Submitted in Partial Fulfillment ofthe Requirements for the Degree of

    Bachelor of Technology

    in

    BioMedical Engineering

    by

    AMRITHA P.SHYAM(Roll No. 07241A1102)

    GUJJULA KAVYA REDDY(Roll No. 07241A1114)MONICA MADDUKURI (Roll No. 07241A1118)

    DEPARTMENT OF BIO-MEDICAL ENGINEERING

    GOKARAJU RANGARAJU INSTITUTE OF ENGINEERING AND TECHNOLOGY(Affiliated to Jawaharlal Nehru Technological University)

    HYDERABAD 500 090

    2010

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    3/59

    Department of BioMedical EngineeringGokaraju Rangaraju Institute of Engineering and Technology

    (Affiliated to Jawaharlal Nehru Technological University)

    Hyderabad 500 090

    2010

    Certificate

    This is to certify that this project report entitled MICROCONTROLLER BASED PATIENT

    MEDICINE REMINDER SYSTEM by AMRITHA P.SHYAM(Roll No. 07241A1102)GUJJULA

    KAVYA REDDY(Roll No. 07241A1114),MONICA MADDUKURI(Roll No. 07241A1118) submitted

    in partial fulfillment of the requirements for the degree of Bachelor of Technology in BioMedical

    Engineering of the Jawaharlal Nehru Technological University, Hyderabad, during the academic year

    2010, is a bonafide record of work carried out under our guidance and supervision.

    The results embodied in this report have not been submitted to any other University or Institutionfor the award of any degree or diploma.

    (Guide) (External Examiner) (Head of Department)

    T.Padma T.PadmaAssociate Professor

    .

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    4/59

    ACKNOWLEDGEMENTS

    We wish to place on record our sincere thanks to,Ms. D.Swathi

    Assistant Professor, Bio medical Engineering Department, Gokaraju

    Rangaraju Institute of Engineering and Technology, Bachupally,

    Hyderabad for her valuable guidance to take up this project.

    We express our deep sense of gratitutde to , Mr E. Suresh Kumar Assistant Professor, Bio medical Engineering Department, Gokaraju

    Rangaraju Institute of Engineering and Technology, Bachupally,

    Hyderabad for his esteem guidance,and valuable comments throughout this

    dissertation.

    We wish to take this opportunity to express our immense gratitude to

    Smt.T.Padma, Associate Professor & Head of the Department at GRIET,

    Bachupally,Hyderabad for her constant support and encouragement.

    Last but not least we express our gratitude and indebtness to our

    classmates and to all the faculty members of Biomedical Engineering

    Department at GRIET, Bachupally,Hyderabad for their constant support

    throughout this entire period.

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    5/59

    CONTENTS

    ABSTRACT

    1. INTRODUCTION2. CIRCUIT DIAGRAM3. BLOCK DIAGRAM4. TOOLS USED

    4.1 SOFTWARE TOOLS4.2 HARDWARE TOOLS

    5. DECRIPTION OF COMPONENTS5.1 KEIL COMPILER

    5.2 AT89S52 MICROCONTROLLER

    5.3 DS1307 RTC

    5.4 24C04 SQUARE EEPROM

    5.5 11.0592 CRYSTAL OSCILLATOR5.6 MAX232

    5.7 ORCAD

    5.8 BUZZER

    5.9 LCD

    6. IMPLEMENTATION6.1 WORKING6.2 PROGRAM

    7. APPLICATIONS8. CONCLUSION9. REFERENCE

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    6/59

    ABSTRACT

    In general, most of the patients forget to take the appropriate prescribed medication at the

    required time. There are occasions when patients remember to take medicines at the stipulated time

    but forget which pill has to be taken at that particular time. This poses a big problem as it affects the

    dosage quantum required for the patient that results in not yielding the right recovery result. It is

    difficult for doctors/paramedics/attenders to monitor patients round the clock. In order to avoid these

    problems, we have implemented this patient medicine reminder system.

    The system allows the user to enter the prescribed timings, at which the patient has to take

    the medication.This is done using a few switches and the list of medicines to be administered is

    entered through the PC. This data will be stored in the EEPROM by the microcontroller. The

    microcontroller continuously reads the time from the RTC .When the timings read from the RTC

    equals the timings stored in the EEPROM, the system alerts the buzzer and displays the list of

    medicines to be taken at that particular prescribed time on the LCD. Thus, the patient can listen to

    the audio indication and see the name of the medicines on the LCD and take them on time.

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    7/59

    CHAPTER-1

    INTRODUCTION

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    8/59

    Patient monitoring and management in critical care environments such as the ICUs , SICUs

    and ANCUs involve estimating the status of the patient and reacting to events that may be life

    threatening. It is impossible to keep a tab on every patient throughout the day. New solutions are

    needed in this field to help the doctors and the nursing staff to monitor the patients.

    A critical element of this is the medicine administration and monitoring. This has been

    achieved by the patient medicine reminder system. This system consists of an 8-bit microcontroller

    with an in-built EEPROM and a real time circuit. This system is driven by an embedded program

    that inputs predefined parameters which is processed based on the input variables entered via a user

    interface device such as the PC. All the entries made by on the PC is concurrently and

    simultaneously displayed on the LCD panel of the device. The logic for the processing is built into

    the embedded program to initiate the alert through an audio alarm. Not only does it have an alarm

    system, but also an LCD display which displays which medicine is to be taken at the reminder time.

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    9/59

    CHAPTER-2

    CIRCUIT DIAGRAM

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    10/59

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    11/59

    CHAPTER-3

    BLOCK DIAGRAM

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    12/59

    Block diagram

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    13/59

    CHAPTER-4

    TOOLS USED

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    14/59

    4.1 Software Tools:

    1. Keil compiler2.

    Orcad.

    4.2 Hardware Tools:

    1. Microcontroller AT89S52.2. DS1307 RTC.3. 24C04 SQUARE EEPROM(memory IC)4. PC.5. Buzzer6. MAX232(RS 232)7. LCD8. 11.0592 Oscillator Crystal9. Resistors- 10k ohm , 330 ohm, 8.2k ohm.10.Capacitors- 33 picofarad , 10 microfarad.11.Step down transformer12.Regulator13.Reset switch

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    15/59

    Chapter-5

    DESCRIPTION

    OF COMPONENTS

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    16/59

    5.1 Keil compiler

    Keil development tools for the 8051 Microcontroller Architecture support every level of

    software developer from the professional applications engineer to the student just learning about

    embedded software development.

    The industry-standard Keil C Compilers, Macro Assemblers, Debuggers, Real-time Kernels,

    Single-board Computers, and Emulators support all 8051 derivatives.

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    17/59

    5.2 AT89S52 MICROCONTROLLER:

    A microcontroller (sometimes abbreviated C or uC) is a small computer on a single

    integrated circuit containing a processor core, memory, and programmable input/output peripherals.

    Prog ram memory in the form of NOR flash or OTP ROM is also often included on chip, as well as a

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    18/59

    typically small amount of RAM. Microcontrollers are designed for embedded applications, in

    contrast to the microprocessors used in personal computers or other general purpose applications.

    8-bit Microcontroller with 8K Bytes In-System Programmable Flash The AT89S52 is a low-

    power, high-performance CMOS 8-bit Microcontroller with 8K bytes of in-system programmable

    Flash memory. The device is manufactured using Atmels high-density nonvolatile memory

    technology and is compatible with the indus try-standard 80C51 instruction set and pinout. The on-

    chip Flash allows the program memory to be reprogrammed in-system or by a conventional

    nonvolatile memory pro- grammer. By combining a versatile 8-bit CPU with in-system

    programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful Microcontroller which

    provides a highly-flexible and cost-effective solution to many embedded control applications. By

    ATMEL Corporation

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    19/59

    5.3 DS1307-RTC

    A real-time clock( RTC) is a computer clock (most often in the form of an integrated circuit)

    that keeps track of the current time. Although the term often refers to the devices in personal

    computers, servers and embedded systems, RTCs are present in almost any electronic device which

    needs to keep accurate time

    Although keeping time can be done without an RTC, using one has benefits:

    Low power consumption (important when running from alternate power) Frees the main system for time-critical tasks Sometimes more accurate than other methods

    Most RTCs use a crystal oscillator, but some use the power line frequency. In many cases the

    oscillator's frequency is 32.768 kHz. This is the same frequency used in quartz clocks and watches,

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    20/59

    and for the same reasons, namely that the frequency is exactly 215 cycles per second, which is a

    convenient rate to use with simple binary counter circuits.

    SOME FEATURES OF DS1307

    Real time clock counts seconds, minutes ,hours , date of month ,day of weekand year with leap year compensation valid up to 2100

    56 byte nonvolatile RAM for general data storage 2-wrire interface (I2C) Automatic power fail detect Consumes less than 500 nA for battery back-up

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    21/59

    at 25'C

    5.4 24C04 SQUARE EEPROM(Memory IC)

    EEPROM (also written E2PROM and pronounced "e-e-prom," "double-e prom" or simply

    "e-squared") stands for Electrically Erasable Programmable Read-Only Memory and is a type of

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    22/59

    non-volatile memory used in computers and other electronic devices to store small amounts of data

    that must be saved when power is removed, e.g., calibration tables or device configuration.

    When larger amounts of static data are to be stored (such as in USB flash drives) a specific

    type of EEPROM such as flash memory is more economical than traditional EEPROM devices.

    EEPROMs are realized as arrays of floating-gate transistors.

    EEPROM is user-modifiable read-only memory (ROM) that can be erased and

    reprogrammed (written to) repeatedly through the application of higher than normal electrical

    voltage generated externally or internally in the case of modern EEPROMs. Unlike EPROM chips,

    EEPROMs do not need to be removed from the computer to be modified. However, an EEPROM

    chip has to be erased and reprogrammed in its entirety, not selectively. It also has a limited life - thatis, the number of times it can be reprogrammed is limited to tens or hundreds of thousands of times.

    In an EEPROM that is frequently reprogrammed while the computer is in use, the life of the

    EEPROM can be an important design consideration

    Features

    Low-voltage and Standard-voltage Operation

    2.7 (VCC = 2.7V to 5.5V)

    1.8 (VCC = 1.8V to 5.5V)

    Internally Organized 128 x 8 (1K), 256 x 8 (2K), 512 x 8 (4K),

    1024 x 8 (8K) or 2048 x 8 (16K)

    Two-wire Serial Interface

    Schmitt Trigger, Filtered Inputs for Noise Suppression

    Bidirectional Data Transfer Protocol

    100 kHz (1.8V) and 400 kHz (2.7V, 5V) Compatibility Write Protect Pin for Hardware Data Protection

    8-byte Page (1K, 2K), 16-byte Page (4K, 8K, 16K) Write Modes

    Partial Page Writes Allowed

    Self-timed Write Cycle (5 ms max)

    High-reliability

    Endurance: 1 Million Write Cycles

    Data Retention: 100 Years

    Automotive Devices Available

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    23/59

    8-lead JEDEC PDIP, 8-lead JEDEC SOIC, 8-lead Ultra Thin Mini-MAP (MLP 2x3), 5-lead

    SOT23, 8-lead TSSOP and 8-ball dBGA2 Packages

    Die Sales: Wafer Form, Waffle Pack and Bumped Wafers

    5.5 11.0592- Crystal Oscillator:

    Crystal oscillator creates an electrical signal with a very precise frequency 11.0952MHz

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    24/59

    Specifications:

    Model :CXO\VCXO

    Frequency range:1.000125.000MHz

    Supply voltage:3.3V dc+5% / 5.0V dc+5%

    Dimensions: DIP-14/ DIP-8

    Ts :4.5V(5.0V)/>2.4V(3.3V)

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    25/59

    5.6 MAX 232

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    26/59

    The MAX220MAX249 family of line drivers/receivers is intended for all EIA/TIA-232E

    and V.28/V.24 communications interfaces, particularly applications where 12V is not available.

    These parts are especially useful in battery-powered systems, since their low-power shutdown

    mode reduces power dissipation to less than 5W. The MAX225, MAX233, MAX235, and

    MAX245/MAX246/MAX247 use no external components and are recommended for applications

    where printed circuit board space is critical

    KEY FEATURES:

    For Low-Voltage, Integrated ESD ApplicationsMAX3222E/MAX3232E/MAX3237E/MAX3241E/MAX3246E: +3.0V to +5.5V, Low-

    Power, Up to 1Mbps, True RS-232 Transceivers Using Four 0.1F External Capacitors

    (MAX3246E Available in a UCSP Package)

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    27/59

    For Low-Cost ApplicationsMAX221E: 15kV ESD-Protected, +5V, 1A, Single RS-232 Transceiver with

    AutoShutdown

    APPLICATIONS:

    Battery-Powered RS-232 Systems Interface Translation Low-Power Modems Multidrop RS-232 Networks Portable Computing

    5.7 OrCAD

    OrCAD is a proprietary software tool suite used primarily for electronic design automation.

    The software is used mainly to create electronic prints for manufacturing of printed circuit boards, by

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    28/59

    electronic design engineers and electronic technicians to manufacture electronic schematics and

    diagrams, and for their simulation.

    The name OrCAD is a portmanteau, reflecting the software's origins: Oregon + CAD.

    The OrCAD product line is fully owned by Cadence Design Systems. The latest iteration has

    the ability to maintain a database of available integrated circuits. This database may be updated by

    the user by downloading packages from component manufacturers, such as Analog Devices or Texas

    Instruments.

    5.8 Buzzer

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    29/59

    A buzzer or beeper is an audio signaling device, which may be mechanical,

    electromechanical, or electronic$. Typical uses of buzzers and beepers include alarms, timers and

    confirmation of user input such as a mouse click or keystroke.

    5.9 LIQUID CRYSTAL DISPLAY

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    30/59

    A liquid crystal display ( LCD) is a thin, flat electronic visual display that uses the

    light modulating properties of liquid crystals (LCs). LCs do not emit light directly.

    They are used in a wide range of applications including: computer monitors,

    television, instrument panels, aircraft cockpit displays, signage, etc. They are common in consumer

    devices such as video players, gaming devices, clocks, watches, calculators, and telephones. LCDs

    have displaced cathode ray tube (CRT) displays in most applications. They are usually more

    compact, lightweight, portable, less expensive, more reliable, and easier on the eyes. They are

    available in a wider range of screen sizes than CRT and plasma displays, and since they do not use

    phosphors, they cannot suffer image burn-in.

    LCDs are more energy efficient and offer safer disposal than CRTs. Its low electrical

    power consumption enables it to be used in battery-powered electronic equipment. It is an

    electronically-modulated optical device made up of any number of pixels filled with liquid crystals

    and arrayed in front of a light source (backlight) or reflector to produce images in colour or

    monochrome.

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    31/59

    CHAPTER-6

    IMPLEMENTATION

    6.1 WORKING

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    32/59

    The working of this system is very simple and user friendly.

    When the ac mains is switched on, a 12 volts supply is given to the transformer. This voltage

    is then stepped down to 5 volts and sent to the power supply board. Here , the ac volt is converted to

    dc using a series of resistors and a rectifier network. The capactive network then filters the dc

    voltage. The regulated output is sent finally to the micro controller board.

    In the micro controller board the AT89S52 microcontroller is pre embedded with a software

    program using a keil compiler. The input of the micro controller is given from the oscillating crystal

    11.0592 via the pins X1, X2(18,19). The entire system is further interfaced to a pc using a MAX 232

    port to connect the RS232 cable. A 6 pin cable is used for the interconnection between the lcd and

    the micro controller via the pins (32-37). Next set of pins (8pin connectors) is used for interfacing

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    33/59

    between the RTC (Real Time Clock) and the micro controller. Apart from this the micro controller

    board is embedded with a reset switch.

    In the RTC board a series of 4 switches and a memory battery is connected to the EEPROM

    and the DS1307 RTC. Here, the time , date and year along with the entry data for medicines can be

    given as input to the EEPROM.

    When the power supply is given the leds will glow indicating that the system is running.

    Now, the RS232 cable is inserted into the RS232 port of the cpu. When this is done, a hyperterminal

    window is opened on the monior. The reset switch has to be turned on at this instant. The monitor

    then displays a welcome note. The next step is to switch on the EM(Enter Medicine) switch. When

    this is pressed, the monitor displays ENTER MEDICINE & DOSAGE TO BE GIVEN. At theprescribed timings (as prescribed by the doctor/physician) the buzzer gives an alarm, along with the

    simultaneous display of the name of the medication and the dosage on the lcd. The alarm can be

    turned off by pressing the EM switch once again.

    6.2 PROGRAM

    #include

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    34/59

    #include

    #include "lcddisplay.h"

    #define ldata P1 // P1 USED FOR LCD DATA

    sbit SCL=P3^5; // SCL OF RTC

    sbit SDA=P3^4; // SDA OF RTC

    sbit rs =P1^2; // REGISTER SELECT

    sbit en =P1^3; // ENABLE

    sbit enter = P3^3;

    sbit dec = P3^2;

    sbit inc = P3^1;

    sbit alarm_sw = P3^0;

    sbit bel = P2^0;

    void lcdcmd(unsigned char );

    void delay (unsigned int ) ;

    void lcddata(unsigned char );

    void msgdisplay(unsigned char b[]);

    void start(void);

    void write(unsigned char,unsigned char);

    unsigned char read(unsigned char);

    void ptos(unsigned char );

    void stop(void);

    void delay(unsigned int );

    void settime(void);

    unsigned char COUNT,dat,add,hr,min,x,binbyte,mem1[17],B1,B2,B3;

    unsigned int i;

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    35/59

    unsigned char ch,j,d11,d22,mem,zzz,msg[17];

    void delay1(unsigned int itime);

    unsigned char time[7],temptime[7],alarmcheck,day,type,xy;

    bit pm=0,pm1,dayselect;

    void daydisplay(unsigned char);

    void serial_com (unsigned char value)

    {

    SBUF=value;

    while(TI==0);

    TI=0;

    }

    void send_to_serial (unsigned char s[])

    {

    unsigned char r;

    for(r=0;s[r]!='\0';r++)

    {

    SBUF=s[r];

    while(TI==0);

    TI=0;

    }

    }

    void main()

    {

    unsigned char z;

    enter=inc=dec=alarm_sw=1;

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    36/59

    bel=0;

    dayselect=0;

    lcd_init();

    delay(100) ;

    lcd_init();

    TMOD=0X20;

    SCON=0X50;

    TH1=0XFD;

    TR1=1;

    alarmcheck=1;

    msgdisplay("welcome");

    send_to_serial("\r\n WELCOME......:\r\n ");

    z=read(0);

    bel=1;

    if(z==0x80)

    {

    alarmcheck=0;

    start: lcdcmd(0x01);

    msgdisplay(" SET THE TIME ");

    type=6;

    settime();

    write(0,0);

    delay(10);

    write(1,temptime[1]);

    delay(10);

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    37/59

    write(2,temptime[0]);

    delay(10);

    for(add=4;add

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    38/59

    lcdcmd(0x01);

    msgdisplay("Dt:");

    while(1)

    {

    lcdcmd(0x04);

    for(add=0;add

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    39/59

    while(enter==1)

    {

    lcdcmd(0x8d);

    lcdcmd(0xe);

    if(inc==0)

    {

    while(inc==0);

    if(day1)

    day=day-1;

    daydisplay(day);

    }

    }

    write(3,day);

    while(enter==0);

    dayselect=0;

    lcdcmd(0x0c);

    goto timedisp;

    }

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    40/59

    daydisplay(time[3]);

    if(alarmcheck)

    {

    xy=time[2];

    if(((xy==1)||(xy==3)||(xy==5))&&(time[0]

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    41/59

    {

    mem1[j]=read(i);

    i++;

    j++;

    }

    while(mem1[j-1]!=13);

    mem1[j]='\0';

    lcdcmd(0x1);

    msgdisplay(mem1);

    while(alarm_sw);

    bel=1;

    lcdcmd(0x1);

    msgdisplay("thank you!!!");

    delay(100);

    goto timedisp;

    }

    //lcdcmd(0xcf);

    //lcddata(' ');

    }

    if(alarm_sw==0)

    {

    while(alarm_sw==0);

    lcdcmd(1);

    msgdisplay("ENTER MEDICINES");

    send_to_serial(" WELCOME ");

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    42/59

    send_to_serial("ENTER MEDICENS TO BE TAKEN IN THE MORNING:\r\n ");

    i=0;

    do

    {

    while(RI==0);

    ch=SBUF;

    RI=0;

    msg[i++]=ch;

    }

    while(ch!=13);

    send_to_serial("\r\n STORING DATA:\r\n ");

    for(i=0;msg[i]!=13;i++)

    {

    write(mem++,msg[i]);

    delay(200);

    }

    write(mem,13);

    delay(500);

    //

    j=0;

    i=0x10;

    do

    {

    mem1[j]=read(i);

    i++;

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    43/59

    j++;

    }while(mem1[j-1]!=13);

    mem1[j]='\0';

    lcdcmd(0x1);

    msgdisplay(mem1);

    //

    send_to_serial("ENTER MEDICENS TO BE TAKEN IN THE AFTERNOON:\r\n ");

    i=0;

    do

    {

    while(RI==0);

    ch=SBUF;

    RI=0;

    msg[i++]=ch;

    }

    while(ch!=13);

    send_to_serial("\r\n STORING DATA:\r\n ");

    mem=0x20;

    for(i=0;msg[i]!=13;i++)

    {

    write(mem++,msg[i]);

    delay(200);

    }

    write(mem,13);

    send_to_serial("ENTER MEDICENS TO BE TAKEN IN THE NIGHT:\r\n ");

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    44/59

    i=0;

    do

    {

    while(RI==0);

    ch=SBUF;

    RI=0;

    msg[i++]=ch;

    }

    while(ch!=13);

    send_to_serial("\r\n STORING DATA:\r\n ");

    mem=0x30;

    for(i=0;msg[i]!=13;i++)

    {

    write(mem++,msg[i]);

    delay(200);

    }

    write(mem,msg[i]);

    send_to_serial("THANK YOU....GET WELL SOON:\r\n ");

    bel=1;

    alarmcheck=1;

    j=0;

    i=0x30;

    do

    {

    mem1[j]=read(i);

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    45/59

    i++;

    j++;

    }while(mem1[j-1]!=13);

    mem1[j]='\0';

    lcdcmd(0x1);

    msgdisplay(mem1);

    delay(1000);

    goto timedisp;

    }

    if(enter==0)

    {

    lcdcmd(0x01);

    msgdisplay("SET THE TIME ");

    while(enter==0);

    goto start;

    }

    }

    }

    void settime(void)

    {

    unsigned char keycount=0,h,g,cmd,uplimit;

    lcdcmd(0xC0);

    if(type==6)

    msgdisplay("hh:mmAM dd/mm/yr");

    while(enter==1)

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    46/59

    {

    lcdcmd(cmd);

    while((inc==1)&&(dec==1)&&(enter==1));

    if(inc==0)

    {

    delay(30);

    while(inc==0);

    if(h==uplimit)

    h=0;

    h=h+1;

    }

    if(dec==0)

    {

    delay(30);

    while(dec==0);

    if(h)

    h=h-1;

    else

    h=uplimit;

    }

    if(keycount==2)

    {

    if(h)

    {

    msgdisplay("pm");

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    47/59

    pm=1;

    }

    else

    {

    msgdisplay("am");

    pm=0;

    }

    }

    else

    {

    g=h;

    d11=g/10;

    d22=g%10;

    lcddata(d11+48);

    lcddata(d22+48);

    temptime[keycount]=g;

    }

    }

    keycount=keycount+1;

    delay(30);

    while(enter==0);

    }

    }

    void write(unsigned char add,unsigned char dat)

    {

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    48/59

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    49/59

    v=v

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    50/59

    if(day==7)

    msgdisplay("SAT");

    else;

    }

    //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ START FUNCTION$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

    void start(void)

    { SCL=1;

    SDA=1;

    _nop_();

    _nop_();

    SDA=0;

    SCL=0;

    }

    //aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa DATA SENDING TO EEPRAM IN READ MODEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

    void ptos(unsigned char a)

    {

    unsigned char i,c;

    for(i=0;i

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    51/59

    _nop_();

    _nop_();

    SCL=0;

    a=a

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    52/59

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    53/59

    void lcddata(unsigned char value)

    {

    unsigned char n;

    n=value;

    value=value&(0x0f);

    ldata = value;

    rs =1;

    en =1;

    en =0;

    value=n;

    value=value

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    54/59

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    55/59

    diseases, increased use of patient reminders can significantly improve delivery of preventive care

    services and treatment for chronic illnesses and can lead to long-term beneficial outcomes as well

    The applications of patient medince reminder system is been initiated in a wide range in the

    modern health care field. Its been implanted in most of the hospitals to ease the effort of the patient

    entourage. It is as well a second-hand for the aged and memory loss group.

    It is well known that patients who are prescribed medications, or who take over the counter

    (OTC) medications, should take such medications at pre-determined dosage time intervals as

    prescribed by the doctor or as indicated on the OTC medication package. Many drugs and

    medications currently prescribed by physicians must be taken at prescribed time intervals. If the

    patient ignores such instructions, for example, by taking the prescribed medication too often or tooseldom, this may result in serious adverse effects such as overdose risks or reduction in the

    concentration of medication in the body. Many patients miss dosages because they are distracted or

    forget about their medications at the correct dosage time. This is particularly true of elderly patients

    who may be taking more than one medication at different time intervals. Although patients may set

    an alarm clock or the like at a prescribed medication time interval, they may set the incorrect time

    interval or may forget to re-set the alarm after taking a medication dose, and may also be away from

    the alarm and not hear it when it goes off.

    When required to take medicine on a daily or hourly schedule, many people have a problem

    in recalling the time when the medicine was last taken. Similarly, many patients are unable to

    remember or determine the previous dosage of medication taken or whether it has been taken at all.

    This problem is particularly common among elderly patients, who may experience short-term

    memory loss or, because of their infirmities, confuse the dosage previously taken of each medication.

    Patients may also be unable to accurately read the medication containers themselves, and often have

    no means to determine whether they have taken the mandated doses at the prescribed time intervals.

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    56/59

    CHAPTER-8

    CONCLUSION

    The report contains a very different mix of studies varying from software to hardware. Vast

    research is being done in the field of healthcare and patient medicine monitoring. This project has

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    57/59

    given a basic insight into the bridging of technology and medicine. Patient medicine reminder

    system is a Cueing Support System for Evidence-Based Medicine practice.

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    58/59

  • 8/13/2019 6-Doc-microcontroller Based Patient Medicine Reminder System

    59/59

    o www.wikipedia.como http://www.faqs.org/patents/app/20090040874o ^ "Senior Care and Safety Check". Garland County Sheriff's Department.

    http://www.garlandcountysheriff.com/programs/seniorcare.html. Retrieved 2007-12-16.o ^ Fairfield County Sheriff's Office CARE! (Call Reassurance Program)o Celler, Branko, Nigel Lovell, and Daniel Chan. The Potential Impact of Home Telecare

    of Clinical Practice. The Medical Journal of Australia. 1999: 518-521.

    http://www.wikipedia.com/http://www.faqs.org/patents/app/20090040874http://en.wikipedia.org/wiki/Home_automation_for_the_elderly_and_disabled#cite_ref-Care3_0-0http://www.garlandcountysheriff.com/programs/seniorcare.htmlhttp://www.garlandcountysheriff.com/programs/seniorcare.html.%20Retrieved%202007-12-16http://en.wikipedia.org/wiki/Home_automation_for_the_elderly_and_disabled#cite_ref-1http://www.sheriff.fairfield.oh.us/subpages/programservices/care.aspxhttp://www.sheriff.fairfield.oh.us/subpages/programservices/care.aspxhttp://en.wikipedia.org/wiki/Home_automation_for_the_elderly_and_disabled#cite_ref-1http://www.garlandcountysheriff.com/programs/seniorcare.html.%20Retrieved%202007-12-16http://www.garlandcountysheriff.com/programs/seniorcare.htmlhttp://en.wikipedia.org/wiki/Home_automation_for_the_elderly_and_disabled#cite_ref-Care3_0-0http://www.faqs.org/patents/app/20090040874http://www.wikipedia.com/