EdOliver
Created March 18, 2020 © MIT

The Health Jacket

A jacket that tracks temperature and some vitals and adjust its temperature. Powered by the RSL10-SENSE-DB-GEVK dev kit by ON.

AdvancedFull instructions provided13 hours108

Things used in this project

Hardware components

RSL10-SENSE-GEVK
onsemi RSL10-SENSE-GEVK
×1
heat pad
×1
Jacket
×1
Darlington High Power Transistor
Darlington High Power Transistor
×1
1N4007 – High Voltage, High Current Rated Diode
1N4007 – High Voltage, High Current Rated Diode
×1
Resistor 1k ohm
Resistor 1k ohm
×1
Photon
Particle Photon
×1
USB extension
×1

Software apps and online services

Node-RED
Node-RED
CloudMQTT
RSL10 application

Hand tools and fabrication machines

Plier, Needle Nose
Plier, Needle Nose
sewing needle
Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
3D Printer (generic)
3D Printer (generic)

Story

Read more

Custom parts and enclosures

Case for the Devkit Top

The stl file to 3D print the case 1 of 2

Case for the Devkit Bottom

2/2

Schematics

Heat pad architecture

The schematic to build the circuit to control the heatpad.

Code

Photon's Code for heat control

C/C++
This is the code to control the heating pad(s) via cloud.
// -----------------------------------
// Controlling the heating pads through the system
// -----------------------------------

// First, let's create our "shorthand" for the pins
// Same as in the Blink an LED example:
// led1 is D0, led2 is D7

int led1 = D0;
int led2 = D7;

// Last time, we only needed to declare pins in the setup function.
// This time, we are also going to register our Particle function

void setup()
{

   // Here's the pin configuration, same as last time
   pinMode(led1, OUTPUT);
   pinMode(led2, OUTPUT);

   // We are also going to declare a Particle.function so that we can turn the LED on and off from the cloud.
   Particle.function("led",ledToggle);
   // This is saying that when we ask the cloud for the function "led", it will employ the function ledToggle() from this app.

   // For good measure, let's also make sure both LEDs are off when we start:
   digitalWrite(led1, LOW);
   digitalWrite(led2, LOW);

}


// Last time, we wanted to continously blink the LED on and off
// Since we're waiting for input through the cloud this time,
// we don't actually need to put anything in the loop

void loop()
{
   // Nothing to do here
}

// We're going to have a super cool function now that gets called when a matching API request is sent
// This is the ledToggle function we registered to the "led" Particle.function earlier.


int ledToggle(String command) {
    /* Particle.functions always take a string as an argument and return an integer.
    Since we can pass a string, it means that we can give the program commands on how the function should be used.
    In this case, telling the function "on" will turn the LED on and telling it "off" will turn the LED off.
    Then, the function returns a value to us to let us know what happened.
    In this case, it will return 1 for the LEDs turning on, 0 for the LEDs turning off,
    and -1 if we received a totally bogus command that didn't do anything to the LEDs.
    */

    if (command=="on") {
        
        digitalWrite(led1,HIGH);
        digitalWrite(led2,HIGH);
        delay(3000000); /*change this timer for any duration you might want */
        digitalWrite(led1,LOW);
        digitalWrite(led2,LOW);
        return 1;
        
    }
   
    else if (command=="off") {
        digitalWrite(led1,LOW);
        digitalWrite(led2,LOW);
        return 0;
    }
    else {
        return -1;
    }
}

Node red Flow

JavaScript
This is the Node RED flow. Input your credentials to it.
[{"id":"17f026ef.dbc259","type":"inject","z":"53a4a2f2.bb0e4c","name":"","topic":"","payload":"on","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":199,"y":1171,"wires":[["4aea005b.24051"]]},{"id":"f796a21c.c185f","type":"debug","z":"53a4a2f2.bb0e4c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":983,"y":1262.1500244140625,"wires":[]},{"id":"a13ac883.173e28","type":"inject","z":"53a4a2f2.bb0e4c","name":"","topic":"","payload":"off","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":168,"y":1217,"wires":[["4aea005b.24051"]]},{"id":"3841d2de.a2e49e","type":"function","z":"53a4a2f2.bb0e4c","name":"","func":"if (msg.payload<=21 && msg.count !=null){\n    msg.payload= 'on'\n}\nelse{\n    msg.payload= 'off'\n}\nreturn msg;","outputs":1,"noerr":0,"x":429,"y":1247.300048828125,"wires":[["4aea005b.24051"]]},{"id":"45c26a4.0b81594","type":"debug","z":"53a4a2f2.bb0e4c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":530.5,"y":860,"wires":[]},{"id":"39f8829b.af69be","type":"delay","z":"53a4a2f2.bb0e4c","name":"","pauseType":"rate","timeout":"10","timeoutUnits":"seconds","rate":"8","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":551.5,"y":950,"wires":[["ec6782b1.2c6a3","edd94a48.9ca688","455414a3.c5ccdc","7e536e23.bdf1e","25fb93e4.59a1cc"]]},{"id":"2d290c21.ee4474","type":"debug","z":"53a4a2f2.bb0e4c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1048.5,"y":936,"wires":[]},{"id":"455414a3.c5ccdc","type":"function","z":"53a4a2f2.bb0e4c","name":"","func":"p=JSON.parse(msg.payload);\nnode.log(typeof p);\nmsg.payload=p[\"Air Quality_8\"];\nif (msg.payload === undefined) {\n   // se ejecutan estas instrucciones\n}\nelse {\n   return msg;\n}\n\n","outputs":1,"noerr":0,"x":783,"y":1100,"wires":[["911023f3.490e9"]]},{"id":"911023f3.490e9","type":"ui_gauge","z":"53a4a2f2.bb0e4c","name":"","group":"7cee3c8.62f33c4","order":7,"width":0,"height":0,"gtype":"gage","title":"Air Quality","label":"Quality","format":"{{value}}","min":0,"max":"500","colors":["#00b500","#e6e600","#ca3838"],"seg1":"100","seg2":"200","x":983,"y":1100,"wires":[]},{"id":"25fb93e4.59a1cc","type":"function","z":"53a4a2f2.bb0e4c","name":"","func":"p=JSON.parse(msg.payload);\nnode.log(typeof p);\nmsg.payload=p[\"Pressure_5\"];\nif (msg.payload === undefined) {\n   // se ejecutan estas instrucciones\n}\nelse {\n   return msg;\n}\n\n","outputs":1,"noerr":0,"x":896,"y":671,"wires":[["49e44ee1.3df69"]]},{"id":"ec6782b1.2c6a3","type":"function","z":"53a4a2f2.bb0e4c","name":"","func":"p=JSON.parse(msg.payload);\nnode.log(typeof p);\nmsg.payload=p[\"Humidity_7\"];\nif (msg.payload === undefined) {\n   // se ejecutan estas instrucciones\n}\nelse {\n   return msg;\n}\n\n","outputs":1,"noerr":0,"x":896,"y":791,"wires":[["82143107.d3de"]]},{"id":"edd94a48.9ca688","type":"function","z":"53a4a2f2.bb0e4c","name":"","func":"p=JSON.parse(msg.payload);\nnode.log(typeof p);\nmsg.payload=p[\"ALS-NOA1305_9\"];\nif (msg.payload === undefined) {\n   // se ejecutan estas instrucciones\n}\nelse {\n   return msg;\n}\n\n","outputs":1,"noerr":0,"x":896,"y":711,"wires":[[]]},{"id":"82143107.d3de","type":"ui_gauge","z":"53a4a2f2.bb0e4c","name":"","group":"af83231e.e6be9","order":7,"width":0,"height":0,"gtype":"wave","title":"Humidity","label":"%","format":"{{value}}","min":"0","max":"100","colors":["#a4a4a4","#2f87b7","#008ae6"],"seg1":"10","seg2":"66","x":1086,"y":791,"wires":[]},{"id":"7e536e23.bdf1e","type":"function","z":"53a4a2f2.bb0e4c","name":"","func":"p=JSON.parse(msg.payload);\nnode.log(typeof p);\nmsg.payload=p[\"Temperature_6\"];\nif (msg.payload === undefined) {\n   // se ejecutan estas instrucciones\n}\nelse {\n   return msg;\n}\n\n","outputs":1,"noerr":0,"x":798,"y":845,"wires":[["47f4d178.1fec","3841d2de.a2e49e"]]},{"id":"47f4d178.1fec","type":"ui_gauge","z":"53a4a2f2.bb0e4c","name":"","group":"af83231e.e6be9","order":7,"width":0,"height":0,"gtype":"gage","title":"Temperature","label":"Celsius","format":"{{value}}","min":"-10","max":"40","colors":["#6477ff","#ffff4a","#ff3535"],"seg1":"17","seg2":"30","x":998,"y":845,"wires":[]},{"id":"49e44ee1.3df69","type":"ui_gauge","z":"53a4a2f2.bb0e4c","name":"","group":"af83231e.e6be9","order":7,"width":0,"height":0,"gtype":"gage","title":"Pressure","label":"kPa","format":"{{value}}","min":"30","max":"200","colors":["#ff4a4a","#00e628","#2802ff"],"seg1":"40","seg2":"160","x":1086,"y":671,"wires":[]},{"id":"7602239c.fa5eec","type":"mqtt in","z":"53a4a2f2.bb0e4c","name":"","topic":"","qos":"2","datatype":"auto","x":283.5,"y":899,"wires":[["39f8829b.af69be","45c26a4.0b81594"]]},{"id":"e14628b7.a070e8","type":"mqtt out","z":"53a4a2f2.bb0e4c","name":"","topic":"","qos":"","retain":"","x":606.5,"y":728,"wires":[]},{"id":"4aea005b.24051","type":"particle-func","z":"53a4a2f2.bb0e4c","pcloud":"","devid":"","fname":"","param":"","productIdOrSlug":"","repeat":0,"once":false,"x":647.5,"y":1225,"wires":[["f796a21c.c185f"]]},{"id":"7cee3c8.62f33c4","type":"ui_group","z":"","name":"Air & P","tab":"c76005cb.7777a8","disp":true,"width":"7","collapse":true},{"id":"af83231e.e6be9","type":"ui_group","z":"","name":"HealthJacket","tab":"46ae3088.d7e8d","disp":true,"width":"6","collapse":false},{"id":"c76005cb.7777a8","type":"ui_tab","z":"","name":"FMP Reload","icon":"dashboard","disabled":false,"hidden":true},{"id":"46ae3088.d7e8d","type":"ui_tab","z":"","name":"HealthJacket","icon":"dashboard","disabled":false,"hidden":false}]

HealthJacket's Github

Github for the project.

Credits

EdOliver

EdOliver

38 projects • 73 followers
Engineer, Scientist, Maker. Entrepreneur and Futurist.

Comments