An ambient device that helps you maintain healthy sleep pattern if you care about your fish!

0
0

Intention:

Today we are spending too much time before sleep almost doing nothing but scrolling our timelines for hours before we fall asleep. Disturbed sleeping pattern does not only affect our sleep quality, but our overall productivity through the whole day as well. The intention of this project was coming up with a device that helps/motivates a student or an employee keep track and maintain a healthy sleeping pattern.

0

Design Process:

The initial concept was a sensing device that can sense when do you go to be and how long do you spend sleeping every day and then create a reward/punishment mechanism through an ambient device. The ambient device is something that a user would care about (a plant or a pet) and can be placed anywhere in the home or on a office or study room desk.
Initially, we wanted to design a plant that is watered/not watered depending on the user’s performance to maintain/enhance his sleeping pattern. However, it was easier to prototype with a motor pump, and from here came the idea of reducing the oxygen level of your fish if you don’t care about your sleep. 
0

How it works:

You go to sleep at 9 pm for instance, the time is recorded until you wake up and the duration is recorded as well. Sleeping at 9 for 8 hours guarantees a continuous oxygen supply for your fish. Later than 9 or less than 8, you start decreasing your fish oxygen supply gradually until you completely kill it.

Bill of Materials:

1. Photon Particle

2. Bread board

3. Jumping wires

4. Pressure sensor (FSR)
5. DIMINUS DC 6V Mini Air Pump Motor
6. Bottle (acting as a container for the fish)
7. 7 flexible transparent tube
8. A fish

0

Code

0
int prePin = D1;
int motorPin = D6;
int sleepTime = 0;
int a = 0;
int b = 0;
int Start_sleepTime = 0;
int End_sleepTime = 0;
int lag = 0;
int value = 0;

unsigned long lastTime = 0;
int state = 0;
int excute = 0;


void setup(){
 Time.zone(-5);
 Serial.begin(9600);
 pinMode(prePin, INPUT);
 pinMode(motorPin, OUTPUT);
}

void loop(){
int tTime = Time.hour();

if(tTime >= 22 and tTime < 24){
 int preState = digitalRead(prePin);
 if(preState >= 4096 and state == 0){
   state = 1;
   a = 25- tTime;
   Start_sleepTime = Time.hour();
   delay(100);
 }
}

else if(tTime >= 0 and tTime <3){
 int preState = digitalRead(prePin);
 if(preState == 1 and state == 0){
   state = 1;
   a = 1;
   Start_sleepTime = Time.hour();
   delay(100);
 }
}

else if(tTime >= 3 and tTime <= 6){
 int preState = digitalRead(prePin);
 if(preState == 1 and state == 0){
   state = 1;
   a = 0;
   Start_sleepTime = Time.hour();
   delay(100);
 }
}

else if(tTime > 6 and tTime <= 10){
  int preState = digitalRead(prePin);
  if(preState == 0 and state ==1){
    state = 0;
    End_sleepTime = Time.hour();
    delay(100);
  }
}

else if(tTime > 10){
 if(excute == 0){
   int preState = digitalRead(prePin);
   if(preState == 1){
     b = 0;
   }
   if(Start_sleepTime >6){
     sleepTime = End_sleepTime - Start_sleepTime + 24;
   }
   else{
     sleepTime = End_sleepTime - Start_sleepTime;
   }
   if(sleepTime == 5 or 6){
     b = 0;
   }
   else if (sleepTime == 7 or 8 or 9){
     b = 2;
   }
   else if (sleepTime == 10 or 11 or 12){
     b = 1;
   }
   value = a*b;
   excute = 1;
 }

 else if(excute == 1){
    if (value = 0){
      digitalWrite(motorPin, LOW);
    }
    else if(value == 1 or 2 or 3){
      digitalWrite(motorPin, HIGH);
      delay(5000);
      digitalWrite(motorPin, LOW);
      delay(10000);
    }
    else if(value == 4 or 6){
      digitalWrite(motorPin, HIGH);
      delay(5000);
      digitalWrite(motorPin, LOW);
      delay(100);
    }
 }
}
}
Click to Expand
0

Reflection:

One thing we felt about this project, is that from a designer perspective, everything sounds like a good idea and a promising device. It’s always fun to come up with the craziest ideas at the beginning. However, during implementation and user testing, new challenges arise and let us question not just our concept but also shows how narrow it is the window from which you can create a product that will actually last.

x
Share this Project

Courses

49713 Designing for the Internet of Things

· 25 members

A hands-on introductory course exploring the Internet of Things and connected product experiences.


Focused on
About

An ambient device that helps you maintain healthy sleep pattern if you care about your fish!

Created

February 7th, 2018