KiYO - Smart Fish Keeper

Made by Chenyu Wang

KiYO is designed to help people automatically keep the water in the fish bowl within a comfortable temperature for their cute fish pet :-)

Created: January 29th, 2016

0

Goal

KiYO is designed to help people automatically keep the water in the fish bowl within a comfortable temperature for their cute fish pets :-)
0

Reflection

I love technology! I love how it helps people have a more enjoyable life! 

Are there anything better than really make a difference through your own work to make the world a better place?!

In the next step - focus on how to enhance users' experience

1. Research & have a better understanding of the users

2. More emotional/enjoyable appearance design

3. Hi-Fi prototype



0
// This #include statement was automatically added by the Spark IDE.
#include "OneWire.h"

// This #include statement was automatically added by the Spark IDE.
#include "spark-dallas-temperature.h"

// -----------------
// Read temperature
// -----------------

// Data wire is plugged into port 0 on the Arduino
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(D0 );

DallasTemperature dallas(&oneWire);
int servoPin = A5;
Servo myServo;
int servoPos = 90;

double temperature = 0.0;
double temperatureF = 0.0;

void setup()
{
  Particle.variable("temperature", &temperature, DOUBLE);
  Particle.variable("temperatureF", &temperatureF, DOUBLE);


  myServo.attach( A5 );

   Particle.function("servo", servoControl);


  dallas.begin();

  Serial.begin(9600);
  pinMode(D1, OUTPUT);
  pinMode(D2,OUTPUT);

}

void loop()
{

  dallas.requestTemperatures();


  float tempC = dallas.getTempCByIndex(0);

  temperature = (double)tempC;

  float tempF = DallasTemperature::toFahrenheit( tempC );

  temperatureF = (double)tempF;


  Serial.print( "Temp in C = ");
  Serial.print( tempC );
  Serial.print( "\t\t F = ");
  Serial.println( tempF );

  delay(5000);

  if(temperature<25)
  {
    digitalWrite(D2, HIGH);
    digitalWrite(D1, LOW);
    servoControl("10");
    delay(1000);
  }else if(temperature>25)
  {
    digitalWrite(D1, HIGH);
    digitalWrite(D2, LOW);
    servoControl("170");
    delay(1000);
  }
  else
  {
    digitalWrite(D1, HIGH);
    digitalWrite(D2, LOW);
  }
}

int servoControl(String command)
{

   int newPos = command.toInt();

   servoPos = constrain( newPos, 0 , 180);


   myServo.write( servoPos );

   return 1;
}
Click to Expand
x
Share this Project

Courses

49-713 Designing for the Internet of Things

· 4 members

This course charts the emergence of the now "connected world" to explore the possibilities for future products and connected spaces.


Focused on
Skills
Tools
About

KiYO is designed to help people automatically keep the water in the fish bowl within a comfortable temperature for their cute fish pet :-)