Introduction: EdiSafeCare
Using two Intel Edisons we built a monitoring solution for my Nana who has Alzheimer's after the recent passing of my grandfather last week.
The first Edison acts as a IPCAM to monitor the room visually.
The second Edison controls all the biometric sensors and GPS.
The cloud server allows for a backend that the user (myself and my mom) can monitor remotely for peace of mind.
Test messages alert us when something is wrong.
Step 1: Step 1
First things first, you will need the following:
2 - Intel Edisons
1 - Intel Edison Arduino Breakout Board
1 - Xadow Intel Edison Main Board
1 - IR Temp Sensor
1 - GPS Sensor
1 - OSRAM Optical BioMon Sensor
1- Webcam (linux compatible)
You will also need access to a Node server, some sort of noSQL database (we like CouchDB, but you can use Mongo or whatever), Intel XDK IoT edition, Arduino 1.6.5 compiler, twillio (or tropo, the people at tropo are really nice). lots of patience.
Step 2: Step 2
Download and install the Intel XDK IoT Edition : https://software.intel.com/en-us/iot/software/inst...
run:
sudo sh install.sh
If you dont have your edison yet, skip the flash and update firmware step in custom install. If you do have it connected this is an excellent time to update the firmware (although it will take longer).
make sure you install both the Intel XDK and the Arudino IDE's
you can then run the Arudino IDE with
sh ardunio<br>
from your install directory.
next download the appropriate Intel drivers for your board and connect your IDE. If you get a permission denied on your usb port (like we did) its possible there is a user permissions issue. DO NOT run the IDE with sudo to solve this. As this will make your life a living hell as every file you create will be admin only access and your libraries will hate you. instead you can fix the issue with the following:
sudo usermod -a -G dialout <username><br>sudo chmod a+rw /dev/ttyACM0
where is your literal username
boot up the intel XDK and connect your edison as per the user guide
Step 3: Loading Code From the XDK to the Edison Board
On the Intel XDK, and on the left top corner choose a New Project and click Templates and you should see the screen like the screenshot. Here you will see all sorts of sample code useful. Use this as reference.
For us, we started with a Server/Client template and then start integrating all the sensors into one project.
For us, we used
Temperature sensor
webcam
LED
GPS
accelerometer
The webcam will be installed on a separate edison and be used as a IP Webcam for monitoring the room.
The second unit will contain all other wearable sensors on the patient to monitor his/her activities.
Step 4: Adding Temperature Sensor
The temperature measures the resistance in order to determine the temperature.
For this you need to be aware of how to calibrate the resistance in terms you can understand as temperature:
resistance=(float)(1023-a)*10000/a; //get the resistance of the sensor;
temperature=1/(log(resistance/10000)/B+1/298.15)-273.15;//convert to temperature via datasheet ;
This will come in handy.
The temperature sensor is an analog sensor and you will need to poll the data off it onto the edison.
Step 5: Adding GPS Sensor
The GPS sensor will be tricky since it pushes data onto the edison, which means you cannot control when the data comes in.
So in the XDK setup a callback to listen for an "open" signal:
var SerialPort = require("serialport").SerialPort;
var serialPort = new SerialPort(serialPath, { baudrate: 9600 });
serialPort.on("open",function() { console.log("open"); console.log("Connected to "+serialPath); serialPort.on("data", function(data) { //Read available data from serial port console.log("GPS UPdated"); //console.log("data received: " + data); global_GPS = data; callback(); });
//callback(); });
Step 6: Adding LED's
Adding LED's are the easiest. If you look at the sample code given, it is exactly as is.
var mraa = require('mraa'); //require mraa
var myDigitalPin5 = new mraa.Gpio(3); //setup digital read on Digital pin #5 (D5) myDigitalPin5.dir(mraa.DIR_OUT); //set the gpio direction to output
//.... later in the code detect when the temperature is above normal
if (global_temperature > thershold)
{ myDigitalPin5.write(1); } else { myDigitalPin5.write(0); }