Body Temperature Monitoring has always been a matter of concern since medical science has grown up. For numerous reasons, body temperature of a patient needs to be monitored constantly in several diseases. Even if, constant care is taken by a human being, mistakes can occur and situation will not remain under control. The present pandemic situation seeks more attention from us, as the number of affected persons are increasing after each day and the workload on each and every medical personnel. Therefore, this project will focus on creating an automatic alarm system on two occasions, when the temperature of any particular patient 1) deteriorates at present or 2) tends to deviate from the normal specified range in near future. The main idea of the project can be used in many industrial applications also.
DEMONSTRATIONThe project basically consists 3 parts:
1) Sensing Body temperature.
2) Creating a sound alarm system, when the temperature of a patient changes suddenly.
3) Turning on a LED, when the temperature of a patient is predicted to be deteriorating in near future.
Firstly, LM35 temperature sensor needs to be placed in the patient body cavity, which will measure the actual body temperature. The data needs to be collected and stored for further analysis. Using this data, temperature readings can be predicted for next one hour or half an hour by any Machine Learning Technique. Some threshold upper and lower limits can be set. Therefore, two things will be performed simultaneously. The predicted values as well as the current values will be checked continuously, if those are staying between the threshold limits. If there is any discrepancy, alarms will be provided a positive signal.
The need for two separate alarm system is self-explanatory. The buzzer will seek immediate intervention, whereas the LED will help to take precautionary measures.
CIRCUIT CONNECTIONThe schematic hardware connection is shown below.
The connection may be described using the reference of the given schematic diagram. The input from the LM35 Temperature sensor is taken at analog pin A0. The two outputs are provided at digital pin 1 & 4, for LED & buzzer respectively.
LM35 is a temperature sensor, which outputs proportional analog voltage to a corresponding temperature. It is having 3 pins, Vcc is connected to 5V point of the WiFi module, GND is connected to Ground & output point is connected at A0, which reads the voltage. The actual temperature value is given by T=r/10.24, where r is the reading of the analog pin.
The LED is connected between Digital Pin 1 & GND along with a resistor (330 Ohm- to limit the current flow) in series & the buzzer is connected between Pin 4 & GND.
OPERATION AND CONTROL- Configuration File
The program for this project is done in python in Ubuntu. A configuration file is created which contains the details for WiFi module and several other details, required for the main program. The code in the file is given below.
API_KEY = "XXXX-XXXX..." //Bolt Cloud API Key
DEVICE_ID = "BOLTXXXXX" //Device ID of the Bolt Module
FRAME_SIZE = 10 //Frame Size of Z Score Analysis
MUL_FACTOR = 5 //Multiplication factor of Z Score Analysis
- Z Score Analysis
Z score Analysis is a tool, which is often used for Anomaly Detection. Although, here it is used for some different purpose. Let us discuss the algorithm first. Basically it gives us two optimum values as a range. This is values are called as upper bound and lower bound.
It takes some previous values into account and calculate its mean and variance and accordingly a distribution is created, which gives the range bounded by the two values. The Frame Size and Multiplication is dependent on user's choice.
- Complete Code
This code, as mentioned above does two jobs. Two pairs of preset values are given, one for comparing with present value and another for comparing with the predicted values.
- Algorithm
Say, x is the current value and x1, x2 are the range, obtained from Z Score Analysis. Also, a1, a2 are the preset minimum and maximum values for comparison with present value and b1, b2 are the preset minimum and maximum values for comparison with prediction value. Buzzer will be on, if x<a1 or x>a2 and LED will glow if x1<b1 or x2>b2. All the preset values are to be selected by experienced professionals.
- Possible Scenarios
Below some scenarios and their implications are mentioned.
1. LED glowing, Buzzer is off- The temperature of the patient is deteriorating slowly, so the predicted future values have gone out of specified values and hence precautionary measures are to be taken.
2. Buzzer is on, LED is off- Probability of this situation is very less, but if it happens, that implies the temperature has deteriorated suddenly, which needs immediate attention.
3. Both are on- This is also a critical situation and it seeks some amount of attention for some time, until situation is under control.
4. Both are off- This implies the temperature is under control.
Comments