How to Monitor Elderly People's Safety and Comfort

by danelijis in Circuits > Wearables

2016 Views, 20 Favorites, 0 Comments

How to Monitor Elderly People's Safety and Comfort

FMWVP4ULDEJDOM1.jpg
`fellTell`

Hello makers!

We are Dan Elijis and Michelle Mendelzburg, two B.Sc. Computer Science students at Reichman University in Israel. During the last semester of our studies, we took part in an IoT course, led by Zvika Markfeld. In this course, we learned how to integrate fun and creativity to technology.

We realized that with the tools we were provided and the knowledge we acquired in this course, we can make an impact on our society, even in the smallest way.

Therefore, we decided to utilize our knowledge to help the elderly people with one of their biggest looming concerns: falls.

Naturally, as people age in their late decades, their physical and mental wellbeing becomes more fragile. As a result, it takes only a simple ground-level fall to lead to severe injuries in elderly individuals, and in worse cases, to death, whether caused directly or indirectly by this incident.

This subject is close to our hearts, since only a week before we started working on this project, Michelle’s grandmother fell, and this event reassured the need for an appropriate solution. 

While we cannot prevent these unfortunate incidents ourselves, we have developed several capabilities that warn of a potential falling incident, or ensure high responsiveness during the first critical moments, if such an incident occurred.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Meet `fellTell`, our extended solution to the presented problem. `fellTell` is a wearable tool, comprised of the following capabilities:

1) While attached to the elderly person's leg, `fellTell` will sense any slipping or falling incident. If such an incident occurs, `fellTell` will start beeping, to draw attention in case the elderly person is alone.

2) In case of slipping or falling, `fellTell` will also trigger an alert with high importance to a predefined emergency contact, requesting them to reply to that alert. When the reply is sent, `fellTell` will stop beeping.

3) If the elderly person fell, but feels ok, they can press a button, which will make `fellTell` stop beeping. `fellTell` will also trigger a message to a predefined emergency contact, letting them know that they are OK, but will still advise them to check up on the elderly person.

4) If the elderly person is lying in a cool space (cooler than room temperature), `fellTell` will trigger a message to a predefined emergency contact, advising them to check up on them, and make sure that they are warm and comfortable. To avoid alerting the guardian with an excessive number of alerts in a short time period, this type of alert is configured to be sent to them at most once, every 3 hours.

5) Every day, the elderly person receives a notification from a weather service to `fellTell`.The device will be illuminated in blue only if it is currently raining or snowing in their place, as a precautionary measure. This is because it is more likely to slip or fall in these weather conditions. An alert regarding these weather conditions will also be sent to a predefined emergency contact.

6) The events mentioned in paragraphs 2), 3) and 4), will automatically be logged to a Google sheet owned by the emergency contact, allowing them to monitor the elderly person's safety and comfort in the long term.

We encourage you to create `fellTell`, by following our tutorial step by step.

Supplies

CPX (1).jpeg
ESP8266.jpeg
Tools.jpeg

What will you need to make your own `fellTell`?

  • The relevant code file for Arduino IDE. It is attached to this section.
  • An 'Adafruit Circuit Playground Express' board
  • ESP8266 (a Wi-Fi microchip), soldered* to the 'Adafruit Circuit Playground Express' board between the following pairs of inputs (ESP8266 - 'Adafruit Circuit Playground Express' board):

1) TX-RX

2) RX-TX

3) G-GND

4) 3V3-3.3V

  • A USB cable
  • 3 AAA batteries
  • A battery storage case for 3 AAA batteries
  • A transparent water-resistant phone case (ideal measures: 13cm height X 7cm width)**
  • An elastic fabric band
  • Access to an Email account
  • Access to a Google Drive account


* The Soldering ensures bidirectional connectivity between the circuit and the internet network.

** Can be easily found online, or in different sporting goods retailers.

Downloads

Set the Environment Up

Software Tools.JPG

Arduino IDE

  1. Install Arduino IDE. Make sure that you download the desktop version, and not the editor.
  2. Install "adafruit_drivers_2.5.0.0.exe" (follow this step only if you have Windows OS).
  3. Follow the instructions under "Install SAMD Support".
  4. Install relevant "drivers" for the ESP8266 boards to your Arduino IDE.
  5. Install the following libraries:
  • “ESP8266_Lib”
  • ”BlynkSimpleShieldEsp8266”
  • “Adafruit_CircuitPlayground”

make.com

  1. Sign up to make.com.

Blynk

  1. Sign up to Blynk Cloud.

Set Blynk Up

Setting Blynk Up
Blynk web dashboard.JPG
Blynk config.JPG

In this step, we will set Blynk environment up. This is an important step, as Blynk will be in charge of passing data from the circuit to the web servers, and from the web servers to the circuit.

To follow the instructions, you can read the text below and check the attached screenshots, or alternatively, watch the attached video.

  1. Sign in to your Blynk user account that you created in step 1.
  2. Go to Templates and click on + New Template.
  3. Type a name of your choice under Name.
  4. Choose Arduino as your Hardware and WiFi as your Connection Type.
  5. Go to Web Dashboard and drag a Slider to the board.
  6. Hover over the slider and click on settings, change the name of the slider and create a Datastream of type Virtual Pin.
  7. Change the Max value to 3, then set the Default Value to 0.
  8. Make sure that Pin is V0, and Data Type is Integer, then press Create and Save.
  9. Go back to the Web Dashboard and add a Switch to the board which will show if the weather is showing signs of snow or rain.
  10. Hover over the switch and click on settings, change the name of the slider and create a Datastream of type Virtual Pin.
  11. Make sure that Pin is V1, and Data Type is Integer, then press Create and Save.
  12. Drag another Switch that would indicate if the guardian received the alert of the fall of the elderly person.
  13. Hover over the switch and click on settings, change the name of the slider and create a Datastream of type Virtual Pin.
  14. Make sure that Pin is V2, and Data Type is Integer, then press Create and Save.
  15. Go to Search and click on + New Device and click From Template and choose the template you have just created.
  16. Download the Arduino code file provided under "Supplies" section.
  17. Change the device name, copy the configuration snippet, and paste it in the Arduino code file, instead what is written in lines 9,10,11.

Set Up Make.com and Create the First Scenario of Alerting in Case of a Fall

Alerting the Guardian about a Fall
Step 4(1).JPG
Step 4.png
Step 4(5).JPG
Step 4(2).JPG
Step 4(3).JPG
Step 4(4).JPG

In this step, we will create our first scenario, in which a fall of the elderly person triggers an alert to their guardian.

To follow the instructions, you can read the text below and check the attached screenshots, or alternatively, watch the attached video.

  1. Sign in to your make.com user account that you created in step 1.
  2. Go to Scenarios and create a new folder.
  3. Go to the new folder you created and click on + Create a new scenario.
  4. Click on the +, choose Webhooks module of type Custom webhook, and edit its name.
  5. Copy the URL address that you have just received, open a new tab on your browser, paste the URL address (don't hit enter just yet), and append to the end of the URL address the following string: "?status=0". You should see the following response: "Accepted".
  6. Go back to make.com, click on Tools on the bar, choose Router and attach it to Webhooks.
  7. Click on the + sign located on the bar, add a Microsoft 365 Email module * of type Create and Send a Message, and attach it to the router.
  8. Click on the newly created module, and under Connection, create a connection to the Email server.
  9. For the falling alert, define the Subject, the Body Content (make sure that you ask to reply to this alert), the Importance and the Recipients.
  10. Click on the adjustable spanner icon on the link between the router and the Microsoft 365 Email module to add a filter.
  11. Choose the label of the filter and configure a new condition with "status" (prompted by Webhooks) and the numeric operator to Equal to and write 1.
  12. Click on Webhooks and copy again the URL address.
  13. Go to your Blynk user account that you created in step 1, and click on Settings (cogwheel icon).
  14. Go to Developers >> Webhooks >> + Create New Webhook. Under Webhook Trigger Event choose Device Sends Data To Datastream. Choose the webhook name, and connect it to the device name you created in step 2. Choose the datastream to be V0, and paste the webhook address that you have just copied, under Webhook URL.
  15. Configure Key under Query parameter to "status" (lower case!), and Value to device_pinValue (promoted), then click on Create Webhook.
  16. Finally, turn the scenario on.


* If you use an Email service different from Microsoft, then choose the right module for you under + sign.

Create a Second Scenario Where Guardian Replies to the Falling Alert

Guardian's Reply Triggers an HTTP request to Blynk
Step 4.png
Step 5(1).png
Step 5(2).png
Step 5(3).png
Step 5(4).png

In this step, we will create another scenario, in which guardian's reply to the falling incident triggers an HTTP request to Blynk.

To follow the instructions, you can read the text below and check the attached screenshots, or alternatively, watch the attached video.

  1. Go to make.com and under Scenarios, go to the folder you created in the previous step and click on + Create a new scenario.
  2. Change its name and add a Microsoft 365 Email module of type Watch messages.
  3. Click on the module, and configure Watch Messages to Only Unread, Mail Folder to /Inbox/ and Search to: "Subject:Re: {configured subject from step 4}" (example shown in the video).
  4. Click on the + icon on the bar, add an HTTP module of Make a request type and link it to the previous module.
  5. Go to your account on Blynk. On the bottom right corner you will see: "Region: {region}". Copy {region} to the URL address shown in instruction number 6.
  6. Configure URL to: "https://{region}.blynk.cloud/external/api/update". Make sure that Method is configured to GET. Click on Add parameter under Query String, and configure Name to "token", and Value to BLYNK_AUTH_TOKEN value that was copied to your code file in step 2.
  7. Click again on Add parameter under Query String, and configure Name to "V2", and Value to 1.
  8. Finally, turn the scenario on.

Extend the First Scenario With: the Elderly Person Informs That They Are Ok

Elderly Person Informs That They Are OK
Step 6(3).png
Step 6(1).png
Step 6(2).png

In this step, we will extend the scenario created in step 3, with a case where the elderly person informs that they are ok.

To follow the instructions, you can read the text below and check the attached screenshots, or alternatively, watch the attached video.

  1. Go to make.com and click on Scenarios, then go to the folder and scenario that you created in step 3.
  2. Create another Microsoft 365 Email module of type Create and send a Message, and link it to the router.
  3. Click on the newly created module, and under Connection, create a connection to the Email server.
  4. To alert that the elderly person is OK, define the Subject, the Body Content, the Importance and the Recipients accordingly.
  5. Click on the adjustable spanner icon on the link between the router and the newly added Microsoft 365 Email module, to add a filter.
  6. Choose the label of the filter and configure a new condition with "status" (prompted by Webhooks) and the numeric operator to Equal to and write 2.

Extend the First Scenario With: the Elderly Person Is Cold

`fellTell` Alerts Guardian that Elderly Person Is Cold
Step 7(3).png
Step 7(1).png
Step 7(2).png

In this step, we will extend the scenario created in step 3, with another case where an alert is triggered to the guardian, if the elderly person is lying in a cold room.

To follow the instructions, you can read the text below and check the attached screenshots, or alternatively, watch the attached video.

  1. Go to make.com and click on Scenarios, then go to the folder and scenario that you created in step 3.
  2. Create another Microsoft 365 Email module of type Create and send a Message, and link it to the router.
  3. Click on the newly created module, and under Connection, create a connection to the Email server.
  4. To alert that the elderly person is lying in a cold room, define the Subject, the Body Content, the Importance and the Recipients accordingly.
  5. Click on the adjustable spanner icon on the link between the router and the newly added Microsoft 365 Email module, to add a filter.
  6. Choose the label of the filter and configure a new condition with "status" (prompted by Webhooks) and the numeric operator to Equal to and write 3.

Create a Third Scenario Where Elderly Person Receives Rain or Snow Alerts

Rain or Snow Alerts to Guardian and Elderly Person
Step 8(14).png
Step 8(1).png
Step 8(2).png
Step 8(3).png
Step 8(4).png
Step 8(5).png
Step 8(6).png
Step 8(7).png
Step 8(8).png
Step 8(9).png
Step 8(10).png
Step 8(11).png
Step 8(12).png
Step 8(13).png

In this step, we will create our third and final scenario, in which the elderly person, as well as their guardian, receive an alert if it is raining or snowing in the elderly person's place.

To follow the instructions, you can read the text below and check the attached screenshots, or alternatively, watch the attached video.

  1. Go to https://openweathermap.org/ and create a user (it’s free). After signing up, you will receive an API key. You can find it under the confirmation email, or under your user details on openweathermap.org. Please note that it might take a few hours for your API key to get activated.
  2. Go to make.com, click on Scenarios, and go to the folder that you created in step 3.
  3. Click on + New Scenario, and change its name.
  4. Create an HTTP module of type Make a request, and schedule the request to fire every day in your preferred hour.
  5. Under URL, paste http://api.openweathermap.org/geo/1.0/direct to get the coordinates (latitude and longitude) of the elderly's person place.
  6. Under the Query String item, under Name type "q", and under Value type the city and country code of the elderly peron's place, in the following format: "{City/town name},{Country code}" (for example: "Toronto,CA", "Rome,IT").
  7. Add another parameter, in which under Name type "appid" and under Value insert the API key that you generated in instruction 1.
  8. Under Parse response, check Yes.
  9. Click on Run once (it's an important step, don't skip it!).
  10. Add a JSON module of type Create JSON, and link it to the HTTP module that you created in instruction 4. Click on Add, and choose a name for the data structure. Under Specification, click Generate. Go to Geocoding API - OpenWeatherMap, and copy the JSON sample data, which lies under Coordinates by location name >> Example of API response section. Paste it under the Sample data text box, which was prompted after clicking on Generate. Finally, click on Generate, and then on Save.
  11. Choose the data structure that you created in instruction 10. Under Lat choose lat (prompted under Data[]), and under Lon choose lon (prompted under Data[]).
  12. Add a JSON module of type Parse JSON. Link it to the JSON module that you created in instruction 10. Under Data structure, choose the one that you created in instruction 10. Under JSON string choose JSON string (prompted).
  13. Add an HTTP module of type Make a request, and link it to Parse JSON module.
  14. Under URL, paste https://api.openweathermap.org/data/2.5/weather 
  15. Under the Query String item, under Name type "lat", and under Value insert Lat (prompted). Add another parameter, and similarly, under Name type "lon", and under Value insert Lon (prompted). Add another parameter, in which under Name type "appid" and under Value insert the API key that you generated in instruction 1.
  16. Under Parse response, check Yes.
  17. Right click on the HTTP module, and select Run this module only. You will be prompted to insert Lat and Lon values. Insert any numeric value for both of them and click OK.
  18. Add a JSON module of type Create JSON, and link it to the HTTP module that you created in instruction 13. Click on Add, and choose a name for the data structure. Under Specification, click Generate. Go to Current weather data - OpenWeatherMap, and copy the JSON sample data, which lies under Weather fields in API response >> JSON section. Paste it under the Sample data text box, which was prompted after clicking on Generate. Finally, click on Generate, and then on Save.
  19. Choose the data structure that you created in instruction 18. Under Weather >> main choose Data.weather[]:main (prompted under Data[].weather[]).
  20. Add a JSON module of type Parse JSON. Link it to the JSON module that you created in instruction 18. Under Data structure, choose the one that you created in instruction 18. Under JSON string choose JSON string (the most recent one prompted).
  21. Add a Router tool and attach it to Parse JSON module created in instruction 20. Then, add an HTTP module of type Make a request, and link it to the router.
  22. Configure URL to: "https://{region}.blynk.cloud/external/api/update" ({region} is the same as in step 4, instruction 5). Make sure that Method is configured to GET. Click on Add parameter under Query String, and configure Name to "token", and Value to BLYNK_AUTH_TOKEN value that was copied to your code file in step 2.
  23. Click again on Add parameter under Query String, and configure Name to "V1", and Value to 1.
  24. Click on the adjustable spanner icon on the link between the router and the newly added HTTP module, to add a filter.
  25. Choose the label of the filter and configure a new condition with Weather[]:main: Weather[]:main Equal to (case insensitive) "snow" OR Weather[]:main Equal to (case insensitive) "rain".
  26. Right click on the newly created HTTP module, and select Copy module. Paste it, link it to the router, and change Value to 0 (where Name is V1).
  27. Click on the fliter (funnel icon), change the label and configure a new condition with Weather[]:main: Weather[]:main Not equal to (case insensitive) "snow" AND Weather[]:main Not equal to (case insensitive) "rain".
  28. Create a Microsoft 365 Email module of type Create and send a Message, and link it to the HTTP module that you created in instruction 21.
  29. Click on the newly created module, and under Connection, create a connection to the Email server.
  30. To alert the guardian that it is raining or snowing in the elderly person's place, define the Subject, the Body Content, the Importance and the Recipients accordingly.
  31. Finally, turn the scenario on (if make.com limits you with the number of scenarios turned on, then run this scenario once a day).

Log in the Previous Events to a Google Sheet

Logging the Events in a Google Sheet
Step 9(4).JPG
Step 9(1).JPG
Step 9(2).JPG
Step 9(3).JPG

In this step, we will extend the scenario created in step 3, by logging the events described on steps 3), 5), 6), to a Google sheet owned by the guardian.

To follow the instructions, you can read the text below and check the attached screenshots, or alternatively, watch the attached video.

  1. Create a Google sheet under your Google Drive account, and save it under your favorite path.
  2. Insert titles to the columns A, B and C: Event Type, Date, Hour (respectively).
  3. Go back to the make.com, go to the scenario that you created in step 3, create a Google sheet module of type Add a Row, and link it to one of the Microsoft 365 Email modules (doesn't matter which).
  4. Create a connection to your Google account, configure Choose my method to Select by path, Choose a drive to My drive, Spreadsheet ID to the path that leads to your sheet (prompted), Sheet name to the sheet name, and Table Contains Headers to Yes.
  5. Click on the text box under Event Type, and a window will be prompted. Go to General functions section (under the cogwheel icon), and click on switch function. Build the brackets as the following: "(1.status; 1; Elderly person fell; 2; Elderly person is OK; 3; Elderly person is cold)". Note that 1.status is prompted under the star icon.
  6. Click on the text box under Date, and the same window will be prompted. Go to Date and time section (under the calendar icon), and click on formatDate function. Build the brackets as the following: "(now; YYYY-MM-DD)". Note that now is prompted under Date and time section. Of course, you may use another date format, if you wish.
  7. Click on the text box under Hour, and the same window will be prompted. Go to Date and time section (under the calendar icon), and click on formatDate function. Build the brackets as the following: "(now; HH:mm; {your time zone})". Note that now is prompted under Date and time section.
  8. Right click on the newly created Google sheets module, and select Copy module. Paste it twice, and link each of them to the remaining Microsoft 365 Email modules (one pasted module for each Microsoft 365 Email module).

Run the Arduino File

Step 10(0).jpeg
Step 10(1).JPG
Step 10(2).JPG
  1. Open "fellTell.ino" code file that you were provided under Supplies section.
  2. Insert your network name and your password name in lines 24,25 (respectively). Make sure that they are inserted between quotation marks ("{insert}").
  3. Connect the board to your PC, using the USB cable.
  4. Configure your board under: Tools >> Board: >> Arduino SAMD Boards (32-bits ARM Cortex-M0+) >> Adafruit Circuit Playground Express
  5. Configure your port under: Tools >> Port: >> COM{number} (Adafruit Circuit Playground Express) ({number} could be any number offered by the Arduino, so just pick whatever is prompted).
  6. Click on the Upload button on the top-left part of the screen (a button with an icon of an arrow pointing to the right), and wait for the program to be fully uploaded.

Prepare the Hardware of the Device

IMG_9532.jpeg
IMG_9534.jpeg
IMG_9535.jpeg
  1. Unplug the USB cable from the board, and connect it to the battery storage case. Then, gently insert both the board and the battery storage case, to the transparent water-resistant phone case.
  2. Make sure that the case is sealed.
  3. Tie the elastic fabric band to the sealed phone case.
  4. Wrap the band to the elderly person's leg, and make sure that it is not too tight nor too loose.