Elderly care is the fulfillment of the special needs and requirements that are unique to senior citizens.Elderly care emphasizes the social and personal requirements of senior citizens who need some assistance with daily activities and health care, but who desire to age with dignity.
This projects helps the elderly people who cannot move from their bed or anything, here the third person can helps them to turn on or off lights. This can also be used as controlling the lights while staying far from the home.
Here, the LDR senses the light and if the light intensity is large, then it sends the message to the user that "turn off the light" and if the light intensity is small then, it sends the message to the user that "turn on the light".
HARDWARE CONNECTION;
PROCEDURE:
Step1- after the connection of the hardware is completed. create new product in the bolt cloud, after the creation of the product, go to the code section in configuration and type the code for the html content of creating the webpage to create "ON" and "OFF" for the led used.
<html>
<head>
<title>Bolt IoT Platform</title>
<script type="text/javascript" src="https://cloud.boltiot.com/static/js/boltCommands.js"></script>
<script>
setKey('{{ApiKey}}','{{Name}}');
</script>
</head>
<body>
<center>
<button onclick="digitalWrite(0, 'HIGH');">ON</button>
<button onclick="digitalWrite(0, 'LOW');">OFF</button>
</center>
</body>
</html>
save the above code and exit.
step 2-Now, we use z-score analysis to analyse any deviation in the process and thus it identifies the deviations and notifies the same, in the form of message through "twilo"(we need to create an account in the twilio account). the code in this process is given below
#this is unique for everyuser,run it separtely
SSID = 'ACe293bb82d9f5fcf0fea18731cc18143b'
AUTH_TOKEN = 'b2d70cd613809c650dd3d89f39b0851a'
FROM_NUMBER = '+12058466229'
TO_NUMBER = '+917204962289'
API_KEY = '81130b89-fb97-4487-9988-1cae41b1d6fc'
DEVICE_ID = 'BOLT5778075'
FRAME_SIZE = 10
MUL_FACTOR = 6
#this is the main code
import conf, json, time, math, statistics
from boltiot import Sms, Bolt
def compute_bounds(history_data,frame_size,factor):
if len(history_data)<frame_size :
return None
if len(history_data)>frame_size :
del history_data[0:len(history_data)-frame_size]
Mn=statistics.mean(history_data)
Variance=0
for data in history_data :
Variance += math.pow((data-Mn),2)
Zn = factor * math.sqrt(Variance / frame_size)
High_bound = history_data[frame_size-1]+Zn
Low_bound = history_data[frame_size-1]-Zn
return [High_bound,Low_bound]
mybolt = Bolt(API_KEY, DEVICE_ID)
sms = Sms(SSID, AUTH_TOKEN,TO_NUMBER,FROM_NUMBER)
history_data=[]
while True:
response = mybolt.analogRead('A0')
data = json.loads(response)
if data['success'] != 1:
print("There was an error while retriving the data.")
print("This is the error:"+data['value'])
time.sleep(10)
continue
print ("This is the value "+data['value'])
sensor_value=0
try:
sensor_value = int(data['value'])
except e:
print("There was an error while parsing the response: ",e)
continue
bound = compute_bounds(history_data,FRAME_SIZE,MUL_FACTOR)
if not bound:
required_data_count=FRAME_SIZE-len(history_data)
print("Not enough data to compute Z-score. Need ",required_data_count," more data points")
history_data.append(int(data['value']))
time.sleep(10)
continue
try:
if sensor_value > bound[0] :
print ("The light level increased suddenly. Sending an SMS.")
response = sms.send_sms("turn off the light")
response = mybolt.digitalWrite('1','LOW')
print("This is the response ",response)
elif sensor_value < bound[1]:
print ("The temperature level decreased suddenly. Sending an SMS.")
response = sms.send_sms("turn on the light")
print("This is the response ",response)
response = mybolt.digitalWrite('1','HIGH')
history_data.append(sensor_value);
except Exception as e:
print ("Error",e)
time.sleep(10)
step 3- run the above code.
WORKING OF THE ABOVE PROJECT-Output -or you can use the model app "boltiot".
THANK YOU.
Comments