Twinkle-wear

Twinkle wear (otherwise known as T-Wear) is a wearable shirt designed for autistic children or children with anxiety disorders.

If you haven’t read previous documentation on how I have gotten this far, please at least  read these significant posts: Modifying FloraTests and prototypesSwitch upDesigning the strap. There was more behind project then this, but if you are strapped for time, these are the ones you need to read the most!

The wearable has 2 inputs and 2 outputs. A pulse detector  that measures the pulse rate and sends it to a Neopixel ring, which then moves in relation to the pulse – the more anxious the child is, the faster the lights move. When the child is anxious, they can press a button which switches on a DC motor to massage them.

I modified the Flora so that I the parent could change the wearable to suit the needs of each child that has it. Some autistic children may not like vibrations, so that could be taken off and replaced with a weight, or another form of haptic feedback or calming device.

Here are some pics of the final run before completion:

This slideshow requires JavaScript.

Super excited about my first wearable, here are some videos:

And here’s the code:

//this is a wearable that will detect anxiety for those who have anxiety related conditions
 //and for children who are on the autistic spectrum who have difficulties in expressing how they feel
 //and for the parent, so that they can visually see when the child is in distress
 //the 2 inputs are the pulse sensor and button
 //the 2 outputs are the Neopixel lights and the DC motor
 //the user can press a button which activates the DC motor to give them haptic feedback in the form of a massage
 //the pulse detector will move faster and have a different pattern when anxiety increases
 //the project is inspired by the squeeze vest http://www.squeasewear.com
 //also inspiration was taken by the 'reveal' pulse detector which detects anxiety from autistic kids and sends an alert to parents

#include 
 #ifdef __AVR__
 #include <avr/power.h>
 #endif

#define PIN 6

#define NUMPIXELS 16
 Adafruit_NeoPixel pixel = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

const int Pulse = A10;
 const int Button = A9;
 const int Motor = A9;
 int HR = 0; // heart rate
 int AR = 520; // anxiety rate
 int buttonState = 0;

void setup() {

pinMode ( Button, INPUT);
 pinMode (Motor, OUTPUT);
 Serial.begin(115200);
 pixel.begin();
 }
 void loop() {
 HR = analogRead(Pulse);

Serial.println(HR);

buttonState = digitalRead (Button);

for(int i=0;i<NUMPIXELS;i++){
 
if(HR < AR){
  pixel.setPixelColor(i,pixel.Color(0,255,0));
  pixel.show(); 
  delay(6);

 }else if( HR > AR){
  pixel.setPixelColor(i,pixel.Color(255,0,0));
  pixel.show();
  delay(2);

if ( buttonState == HIGH){
 digitalWrite (Motor, HIGH);
 } else{
 digitalWrite (Motor, LOW);
 }

}

}
 }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s