Here is our project...
Set-up of FSR sleep-mat, breadboard, Raspberry Pi and Alexa Amazon Dot
The FSR takes in pressure input
Pin-out diagram for FSR to Raspberry Pi
Creating a circuit to be interpreted as digital input
Python scripts and server running on Raspberry Pi
Phrases to ask HomeCare
User-centered design brainstorming
Innovation canvas brainstorm
HomeCare is a new Alexa skill that assists caregivers, helping them prioritize care for their loved ones. The HomeCare Alexa skill communicates with a Raspberry Pi that tracks data delivered from a sleep-mat to monitor sleep status.
Parents who get children ready in the morning and caregivers who provide constant care to elderly loved ones must balance their own responsibilities with their dependent's needs. According to the Mayo Clinic article "Caregiver Stress: Tips for Taking Care of Yourself," about 1 in 3 adults in the United States provide care to others as informal caregivers and, according to the Harvard Medical School, more than 65 million Americans are caring for an elderly or disabled family member. To alleviate caregiver stress, the Mayo Clinic and Harvard Medical School recommend caregivers prioritize their health and enlist assistance from others.
The HomeCare skill will provide caregivers a way to enlist a virtual assistant, Alexa, and a hands-off, non-invasive monitoring system to improve care. With the HomeCare Alexa skill, a busy parent can ask HomeCare "Is my child out of bed?" and even sound an alarm to wake their still-sleeping child, all while multitasking in another area of the house. A caregiver can use HomeCare to gain insight into sleep pattern behavior which can improve monitoring of and care for elders.
What is HomeCare and how we built it
HomeCare is an Alexa skill that allows the user to check the status of force sensors to determine if a bed or space is currently occupied.
A force sensitive resistor (FSR) is connected to a "sleep-mat." The FSR is connected to the Raspberry Pi GPIO Pin via a capacitor, which is used in lieu of a ADC in order to measure the threshold of force needed to make a digital GPIO pin active.
The input from the GPIO pin can be accessed in a python script. In addition, an ngrok server is run on the Raspberry Pi in order to provide a http address through which Alexa can communicate with the python script. The python script uses Flask and Flask-Ask libraries, which allow for simple implementation of callbacks for Alexa intents.
The Raspberry Pi is also connected to a Jambox Mini speaker via a headphone jack, which allows the application to sound an alarm in the event that the user wants to wake their still-sleeping dependent.
The Alexa skill is run on Amazon Web Services, which allows users to run code in the cloud only when needed and in an abstracted manner. New Alexa skills can be created from the Amazon Developer portal, by providing information such as the name of the skill, intent schema, and http address to which Alexa should connect to in order to answer the user's question. We created the skill in this manner, providing the forwarding URL from the ngrok server on the Raspberry Pi as the http address to be used by Alexa.
We experienced a number of unforeseen challenges which turned into learning opportunities while working on this project.
Serially connecting to the Raspberry Pi in order to configure WiFi was one of our earliest challenges. After unsuccessful attempts to secure WiFi connectivity with a headless set-up, we used a monitor and keyboard set up and were successful in getting the Raspberry Pi IP address to then use then SSH into.
We had to overcome a lack of an analog to digital converter for our FSR as we did not realize that all of the Raspberry Pi pins only took digital input. We ended up solving this issue by creating a circuit which could be interpreted as digital input based on the amount of time taken to recharge the capacitor. The threshold for this timing input was interpreted in python by measuring the number of instructions required to recharge the capacitor; this number varies with change in pressure on the FSR.
Connectivity issues with WiFi to establish connection with the Pi and with Alexa led us to set-up a personal data hot-spot to provide reliable internet for this project.
Our HomeCare skill gives users the ability to track the sleep status of their dependents in a hands-off manner through the Alexa home personal assistant. This skill gives caregivers the ability to more easily multitask when providing care.
What we learned
- Python syntax and Flask-Ask syntax
- How to build an Alexa skill
- How to work with an ngrok server
- How to utilize the recharging of capacitors to provide analog-to-digital conversion
- How to configure and work with a Raspberry Pi 3
What's next for HomeCare
In order to expand the HomeCare experience, we plan to configure multiple FSR sleep-mats with Raspberry Pi boards to communicate with Alexa. This will allow parents to get feedback on the sleep status of multiple kids, caregivers to track multiple residents in a nursing home setting, and nurses and doctors to monitor patients in a medical setting. For example, in our demo we ask "Is my kid awake" and with the extension we can include "Is [name] awake?" where [name] is a look-up value that is corresponds with a certain FSR sensor.
Our FSR, Raspberry PI, and Alexa integrated hack has application beyond the sleep-mat. With modification to our Alexa skill, we could assist users in applications such as tracking whether pets are in their cages and monitoring sleep patterns with the hope increasing understanding of certain sleep disorders.