Enviando información de sensores a la nube


La telemedicina es el uso de las tecnologías de las telecomunicaciones y de la información con el fin de proporcionar atención clínica de la salud a distancia. Favorece la eliminación de las barreras de distancia y puede mejorar el acceso a los servicios médicos que no suelen estar siempre disponibles en lejanas comunidades rurales. También se utiliza para salvar vidas en cuidados críticos y situaciones de emergencia.

Aunque hubo precursores distantes de la telemedicina, que es esencialmente un producto de telecomunicaciones del siglo 20 y las tecnologías de la información. Estas tecnologías permiten la comunicación entre paciente y el personal médico con conveniencia y fidelidad, así como la transmisión de los médicos, la imagen y la salud informática de datos de un sitio a otro.

Sensores de la  plataforma eHealth permite compartir datos médicos con la nube, y realizar diagnóstico en tiempo real. Gracias a los módulos de comunicación puede enviar muchos datos a través de varios protocolos de transmisión

 

Wifi

Vamos a utilizar el módulo wifi Roving RN-171. Este módulo encaja en el zócalo XBee Shield de nuestra comunicación y permite conectar tu Arduino / escudo RasberryPi a una red WiFi.
e_health+placa
Example code
Wifi examples shows the way to communicate with the Arduino Wifi Demo Android and iPhone app.
Refer to Wifi tutorials (Arduino) (Raspberry) for more information.

Bluetooth

Módulos Bluetooth para Arduino / Netduino/Raspberry son capaces de estar conectados a la XBee Shield y obtener una comunicación serie entre el ordenador y una placa Arduino / RasberryPi a través de protocolo Bluetooth.
xbee2
Módulo Bluetooth para Arduino PRO soporta Serial Port Profile (SPP) para intercambiar datos con otros dispositivos. Este perfil permite crear conexiones a otro dispositivo usando el mismo perfil (p2p conexión). Se envía datos al dispositivo especificado. Este dispositivo es el que ha sido creado para la conexión.
 
Consulte tutoriales Bluetooth (Arduino) (Frambuesa) para obtener más información.

 

Zigbee / 802.15.4

El Arduino Xbee shield permite su Arduino / RasberryPi bordo para comunicarse de forma inalámbrica utilizando Zigbee.
xbee
Example code
This example shows the way to communicate with the Arduino using Zigbee protocol. Upload the next code:

Show Code

/*
 *  eHealth sensor platform for Arduino and Raspberry from Cooking-hacks.
 *
 *  Description: "The e-Health Sensor Shield allows Arduino and Raspberry Pi 
 *  users to perform biometric and medical applications by using 9 different 
 *  sensors: Pulse and Oxygen in Blood Sensor (SPO2), Airflow Sensor (Breathing),
 *  Body Temperature, Electrocardiogram Sensor (ECG), Glucometer, Galvanic Skin
 *  Response Sensor (GSR - Sweating), Blood Pressure (Sphygmomanometer) and 
 *  Patient Position (Accelerometer)."  
 *
 *  Explanation: This example shows the way to communicate with  
 *  the Arduino using ZigBee protocol. 
 *
 *  Copyright (C) 2012 Libelium Comunicaciones Distribuidas S.L.
 *  http://www.libelium.com
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see .
 *
 *  Version 0.1
 *  Author: Luis Martin & Ahmad Saad 
 */

#include
#include

char recv[128];
uint8_t cont = 0;

// Note : The Xbee modules must be configured previously.
// See the next link http://www.cooking-hacks.com/index.php/documentation/tutorials/arduino-xbee-shield

void setup()
{
Serial.begin(9600);

eHealth.initPulsioximeter();
eHealth.initPositionSensor();

//Attach the inttruptions for using the pulsioximeter.
PCintPort::attachInterrupt(6, readPulsioximeter, RISING);
delay(1000);

}

void loop()
{

//1. Read from eHealth.
int airFlow = eHealth.getAirFlow();
float temperature = eHealth.getTemperature();
float conductance = eHealth.getSkinConductance();
float resistance = eHealth.getSkinResistance();
int BPM = eHealth.getBPM();
int SPO2 = eHealth.getOxygenSaturation();
uint8_t pos = eHealth.getBodyPosition();

Serial.print(int(airFlow)); Serial.print(“#”);
Serial.print(temperature); Serial.print(“#”);
Serial.print(int(BPM)); Serial.print(“#”);
Serial.print(int(SPO2)); Serial.print(“#”);
Serial.print(conductance); Serial.print(“#”);
Serial.print(int(resistance)); Serial.print(“#”);
Serial.print(int(pos)); Serial.print(“#”);
Serial.print(“\n”);

// Reduce this delay for more data rate
delay(250);
}

void check(){
cont=0; delay(500);
while (Serial.available()>0)
{
recv[cont]=Serial.read(); delay(10);
cont++;
}
recv[cont]=’\0′;
Serial.println(recv);
Serial.flush(); delay(100);
}

//Include always this code when using the pulsioximeter sensor
//=========================================================================
void readPulsioximeter(){

cont ++;

if (cont == 50) { //Get only one 50 measures to reduce the latency
eHealth.readPulsioximeter();
cont = 0;
}
}

NOTE: The Xbee modules must be configured previously. See the next link http://www.cooking-hacks.com/index.php/documentation/tutorials/arduino-xbee-shield
Refer to XBee tutorials (Arduino) (Raspberry) for more information.

GPRS

Cuatribanda GPRS para Arduino/Netduino Módulo /Raspberry (SIM900) ofrece conexión GPRS a la placa Arduino / cartón RasberryPi. Usted puede enviar sus datos a través de SMS o de llamadas perdidas no de tu Arduino/netduino a los dispositivos móviles … oa otro Arduino / netduino/RasberryPi conectado a este módulo.
e_health+placa_Verde
Example code
This example shows the way to send a text message with the corporal temperature using the GPRS module. Upload the next code:

Show Code

/*
 *  eHealth sensor platform for Arduino and Raspberry from Cooking-hacks.
 *
 *  Description: "The e-Health Sensor Shield allows Arduino and Raspberry Pi 
 *  users to perform biometric and medical applications by using 9 different 
 *  sensors: Pulse and Oxygen in Blood Sensor (SPO2), Airflow Sensor (Breathing),
 *  Body Temperature, Electrocardiogram Sensor (ECG), Glucometer, Galvanic Skin
 *  Response Sensor (GSR - Sweating), Blood Pressure (Sphygmomanometer) and 
 *  Patient Position (Accelerometer)."  
 *
 *  Explanation: This example shows the way to send a text message with 
 *  the corporal temperature using the GPRS module. 
 *
 *  Copyright (C) 2012 Libelium Comunicaciones Distribuidas S.L.
 *  http://www.libelium.com
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see .
 *
 *  Version 0.1
 *  Author: Luis Martin & Ahmad Saad 
 */

// For more information about the GPRS shield please see our tutorial
// in cooking-hacks web site. http://www.cooking-hacks.com

#include

// the pin to switch on the module (without press on button)
int pinModuleOn = 2;

// ********* is the number to call
char phoneNumber[]=”**********”;

void switchModule(){
digitalWrite(pinModuleOn,HIGH);
delay(2000);
digitalWrite(pinModuleOn,LOW);
}

void setup() {

// UART baud rate
Serial.begin(115200);
delay(2000);

// Sitches the module ON
// switchModulo();

for (int i=0;i < 5;i++){
Serial.println(“Push the button”);
delay(5000);
}
// Sets the SMS mode to text
Serial.println(“AT+CMGF=1”);
delay(100);
}

void loop(){

delay(100);
float temperature = eHealth.getTemperature();

delay(1500);
// send the SMS number
Serial.print(“AT+CMGS=\””);
Serial.print(phoneNumber);
Serial.println(“\””);
// the SMS body
while(Serial.read()!=’>’);
Serial.print(temperature);

delay(1000);
//sends ++
Serial.write(0x1A);
Serial.write(0x0D);
Serial.write(0x0A);
delay(5000);

}

Refer to GPRS tutorials (Arduino) (Raspberry) for more information.

3G

El nuevo escudo 3G para Arduino / Netduino/Rasberry permite la conectividad a alta velocidad WCDMA y HSPA celulares con el fin de hacer posible la creación de un nivel superior de interactividad proyectos en todo el mundo dentro de la nueva “Internet de las Cosas” era..
gps_e_health
e_health_con_conectores
Example code
This example how to send data using 3G shield and making a connection to a server. Upload the next code:

Show Code

/*
 *  eHealth sensor platform for Arduino and Raspberry from Cooking-hacks.
 *
 *  Description: "The e-Health Sensor Shield allows Arduino and Raspberry Pi 
 *  users to perform biometric and medical applications by using 9 different 
 *  sensors: Pulse and Oxygen in Blood Sensor (SPO2), Airflow Sensor (Breathing),
 *  Body Temperature, Electrocardiogram Sensor (ECG), Glucometer, Galvanic Skin
 *  Response Sensor (GSR - Sweating), Blood Pressure (Sphygmomanometer) and 
 *  Patient Position (Accelerometer)."  
 *
 *  Explanation: This example how to send data using 3G shield and 
 *  making a connection to a server. 
 *
 *  Copyright (C) 2012 Libelium Comunicaciones Distribuidas S.L.
 *  http://www.libelium.com
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see .
 *
 *  Version 0.1
 *  Author: Luis Martin & Ahmad Saad 
 */

// For more information about the 3G shield please see our tutorial
// in cooking-hacks web site. http://www.cooking-hacks.com

#include

char data[512];
char tosend[128];
int led = 13;
int onModulePin = 2; // the pin to switch on the module (without press on button)

int x = 0;

char name[20];

char server[ ]=”192.198.1.1″; //Your server IP address
char port[ ]=”5555″; // Your port.

void switchModule(){
digitalWrite(onModulePin,HIGH);
delay(2000);
digitalWrite(onModulePin,LOW);
}

void setup(){

Serial.begin(115200); // UART baud rate
delay(2000);
pinMode(led, OUTPUT);
pinMode(onModulePin, OUTPUT);
switchModule(); // switches the module ON

for (int i=0;i< 5;i++){
delay(5000);
}

Serial.println(“AT+CGSOCKCONT=1,\”IP\”,\”internetmas\””);
Serial.flush();
x=0;
do
{
while(Serial.available()==0);
data[x]=Serial.read();
x++;
} while(!(data[x-1]==’K’&&data[x-2]==’O’)); //waits for response “Network opened”

}

void loop()
{
float temperature = eHealth.getTemperature();
int longitud = sprintf(tosend,”%d”, temperature);

Serial.print(“AT+NETOPEN=\”TCP\”,”);
//Opens the socket with the type of protocol and the port
Serial.println(port);
Serial.flush();
x=0;

do
{
while(Serial.available()==0);
data[x]=Serial.read();
x++;
}
while(!(data[x-1]==’K’&&data[x-2]==’O’)); //waits for response “Network opened”

Serial.print(“AT+TCPCONNECT=\””); //Connects with the server
Serial.print(server);
Serial.print(“\”,”);
Serial.println(port);

Serial.flush();
while(Serial.read()!=’K’);

Serial.print(“AT+TCPWRITE=”);
Serial.println(longitud, DEC); //Sends TCP data
Serial.flush();

do
{
while (Serial.available() == 0) {};
//Serial.println(char(Serial.read()));
} while(Serial.read()!=’>’);

Serial.println(tosend);

x=0;

do
{
while(Serial.available()==0);
data[x]=Serial.read();
x++;
}
while(!(data[x-1]==’K’&&data[x-2]==’O’));

Serial.println(“AT+NETCLOSE”); //Opens the socket with the type of protocol and the port
Serial.flush();
while(Serial.read()!=’K’);

while(1);

}

Camera for Photo Diagnosis

Este módulo permite la conexión de una cámara para grabar video y tomar fotos. Una vez guardado el archivo de vídeo o la imagen se pueden enviar a un servidor FTP o FTPS como se verá más adelante. Las imágenes con tutorial módulo 3G.
 
Cámara para el escudo 3G
3G camera
Inserte la cámara con los contactos metálicos hacia arriba
3G camera
Example Code
Take photos is very easy. Upload the next code.

Show Code

/*
*  Copyright (C) 2012 Libelium Comunicaciones Distribuidas S.L.
*  http://www.libelium.com
*
*  This program is free software: you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation, either version 3 of the License, or
*  (at your option) any later version.
*
*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with this program.  If not, see .
*
*  Version 0.1
*  Author: Alejandro Gállego
*/

int led = 13;
int onModulePin = 2; // the pin to switch on the module (without press on button)

int x = 0;

char name[20];

void switchModule(){
digitalWrite(onModulePin,HIGH);
delay(2000);
digitalWrite(onModulePin,LOW);
}

void setup(){

Serial.begin(115200); // UART baud rate
delay(2000);
pinMode(led, OUTPUT);
pinMode(onModulePin, OUTPUT);
switchModule(); // switches the module ON

for (int i=0;i < 5;i++){
delay(5000);
}

Serial.println(“AT+CCAMS”); //starts the camera
while(Serial.read()!=’K’);

Serial.println(“AT+CCAMSETD=640,480”); //sets VGA (640*480) resolution
while(Serial.read()!=’K’);

Serial.println(“AT+FSLOCA=0”); //stores the image file in the 3G module
while(Serial.read()!=’K’);

}

void loop(){

delay(1500);
while(Serial.available()!=0){
Serial.read();
}
Serial.println(“AT+CCAMTP”); //takes a picture, but not saved it
while(Serial.read()!=’K’);

Serial.println(“AT+CCAMEP”); // saves the picture into C:/Picture
Serial.flush();
while(Serial.read()!=’/’);
while(Serial.read()!=’/’);

x=0;
do{
while(Serial.available()==0);
name[x]=Serial.read();
x++;
}while(x < 19);

while(Serial.read()!=’K’);
Serial.println(name);

Serial.println(“AT+CCAME”); // stops the camera
while(Serial.read()!=’K’);

while(1);

}

Example picture 2: (Patient photo)
Snake bites occur when a snake bites the skin. They are medical emergencies if the snake is poisonous.
Sending images via 3g is a simple and rapid method for medical consultation
Refer to 3G tutorials (Arduino) (Raspberry) for more information.
Para saber más,pulse aquí