In these modern times, technologies are used to efficiently monitor the location of people. In this project,geofencing technology is used to locate and monitor theLocation of hospital patients. With Geofence the movement of patients can be virtually concentrated within the Hospital premises without hindering real activities by placing boundaries near the patient\'s area. By using Global Positioning System (GPS) tech, signals of a patient\'s device can be traced and monitored. If the patient goes beyond the geofenced area, the administrator will receive a SMS from the device and could handle the situation so that the patients don\'t get lost. Patient\'s location can be tracked by the device by using the GPS fitted on the patient\'s device, and the patient is unaware of it. To satisfy these conditions, essential processes must be done, such as Analysis of Geofenced area and Sending SMS or notifications on the desired Mobile Phone that is with the administrator. All of this will create an environment that can supervise patients that could be of any programmed distance, In this project for demonstration we have taken geofence radius as 30 metres. This device will receive a message automatically when the patient is out of the Geofenced area. The shortest distance between the patient and the administrator is calculated by using Haversine formula.
Geofencing combines awareness of the user's current behaviour. location with awareness of the user's proximity to a location that may be of interest . Geofencing consists of establishing a virtual perimeter around a geographical zone and then connecting mobile devices.
The geofencing technique has defined the method to give the virtual fence on the specified location. It automatically detects every object which moves into the virtual fence and leaves the fenced area. This technique has been used for some cases such as in monitoring system technology for dementia home care and also for Alzheimer's disorder monitoring system . Geriatric patients with dementia and Alzheimer's disease can be associated with several genetic and environmental factors in patients. Dementia includes memory disorders, behavioural problems, and mental symptoms . Dementia and Alzheimer's patients often have difficulty remembering conversations conducted by patients in short periods, such as names, places, times, and events. This problem is an initial symptom experienced by patients, such as apathy and depression, which is also an early symptom experienced . Due to memory problems experienced, patients often behave straying when outside the home . It causes the patient to remain in a safe area, and most of the time, under the supervision of home care services because it requires constant care and supervision from caregivers. Home Care can provide services to patients who are at home without having to go to the hospital, but caregivers who come to the patient's home and caregivers who are in the homecare service are quite a lot.
This research was conducted because the supervision of patients with dementia and Alzheimer's is still fairly minimal, so there are still many patients with the disease getting lost in a place that is much cheaper than a place far away and not known to caregivers. This research is carried out now because many people with dementia and Alzheimer's disease are disappearing and increasing from year to year, as is the case in articles , where in the article many cases of dementia and Alzheimer's sufferers were lost and lost. In research conducted by Yatawara, in the study, there were 28% of the total of 96 patients who were recorded as missing or lost . Therefore, by utilising Geofencing technology in supervising patients, it is expected to minimise things that can make patients lost or lost. So that it can bring a system that can help patient movement with technology and a method that can calculate the closest distance between the patient and the caregiver, so that when leaving the system area, the patient can know the patient's distance from several caregivers in the system.
A Wireless Sensor Network (WSN) consists of individual sensor nodes that are able to sense the environment, collect physical parameters, perform simple data processing, and finally transmit required data to a sink. WSNs are very powerful to support a lot of different real world applications. The WSN-based technology has invaded the Medicine and Health Care scopes 
This study will not only be for dementia and Alzheimer's patients, but it can be used in several cases such as in mental hospitals, prisons, and others because this research is not just supervising objects, but like a virtual prison for supervised objects 
II. PROPOSED MODEL
Alzheimer’s is a very prevalent disease now-a-days. 1 out of 9 people suffer from Alzheimer .In this disease patients often forget things and the activities they carry out. So in order to keep a track on these patients a device which works on the geofencing technology is made . Geofencing is a technology which tracks or monitors a patient's activity using GPS .
In this paper the proposed model is based on the geofencing technology .In geofencing a virtual boundary called as geofence is created using google maps . It tracks the position of the patient using GPS . It sends SMS on the caretaker’s phone if the patient tries to escape the geofence.
The components used in this device are GPS module , GSM module, arduino nano, 3.7V battery , buzzer , breadboard and jumper wires. The GPS module is used to get the location coordinates , GSM module is used for getting the Short Messaging Service(SMS) on the phone , arduino nano is the main board for code uploading and executing ,buzzer is used for the alarm and breadboard and jumper wires are used for the connections. The connections done are given in the fig1.
In this study, several stages were carried out to achieve the goal of applying Geofencing , where the phases carried out included analysing Geofencing areas, automatic notifications using GSM and calculation of the closest distance to Haversine.
A. Area Geofencing Analysis
The depiction of the Geofencing area in the map is made in the form of a circle, wherein the depiction of the shape of this circle is an object on the map with latitude and longitude coordinates.The patient’s location is taken as object of research and the radius of hospital is taken into consideration . The area of Geofencing can be changed to be wider or smaller. The researcher analyses the distance that the patient can access. Here, the researcher analyses the safe distance for the patient.Then the researcher analyses patient as centre and a circle of radius upto 50 metres is considered. The circle is the area which the patient can access.
B. Automatic notification
The geofence created on the google maps is using Global Positioning System(GPS) .The initial location coordinates are set with respect to the patient’s latitude and longitude. The patient can access the geofence area and if it goes out of the boundary there generates an automatic notification on the administrator’s mobile phone through Short Messaging Service (SMS). This SMS on the mobile phone is generated through the GSM module which consists of a SIM card.
C. Haversine formula
The Haversine formula is a method to find out the shortest distance between two points .It is used to calculate the closest distance between two object positions based on latitude and longitude. Haversine formula is used to find the closest distance like find the closest restaurant based on person’s latitude and longitude.
Haversine formula used (1)-(4)
Before location data is entered into the Haversine equation, location data must first be converted into radians by multiplying with numbers 0.0174532925.
The above given flowchart shows the software process. In this research we have used Arduino IDE and C++ language.
III.RESULT AND DISCUSSION
Finally the results we get through experiments is by getting the closest distance between the patient and the administrator , it can speed up the administrator in handling the patient over the Geofencing area boundary.In this study, there is a weakness in terms of the accuracy of taking the patient's location, because the device used to pick the GPS signal uses a mobile device so that the level of accuracy is not too high.It is a drawback because the system will not monitor patient movements.
In our work, the results of distance measure by using Haversine formula is to find the nearest distance between patient and administrator. By knowing the nearest distance between the patient and administrator, we can increase the speed of administrator in controlling the patient over the geofenced area. The researchers envision further research to put a danger area for the patient and send some more additional notification when the patient is out of the fence for 10 minutes.
With that, future researchers can continue the research by meeting the shortcomings that have not been reached by this paper.