Oh Fish!

Made by Sid Suri, Jake Maxfield and K P

People often use mental accounting models, such as weekly or monthly budgeting to reign in on their spending habits. Yet even disciplined spenders, have a trouble keeping count of their spending. The connected bowl collects the average of aggregate spending data, over the last 7 days, and displays it as the water level in a fish bowl. High spending, will lower the water level, while low spending would increase the water level.

Created: February 3rd, 2016

0

Overview

A little fiscal prudence goes a long way in keeping your gold fish comfy. Spend too much and the water level goes down (gasp). Yeah, life is cruel.


0

The Device

The device consists of a fish bowl, and a balancing tank. The water flows between the two tanks through a pump, connected to the particle photon. An H-bridge controller allows operation of the pump in both directions. The device is powered by a battery pack. We hacked a water level meter, using an insulated wire, connected to a series of 100k ohm resistors. The change in water level, changes the resistance of the array, and in turn the current that flows into the particle photon pin.

See it in action here: https://youtu.be/hfg41aO6DAY



You will need:

1 Breadboard with USB cable

1 Photon

2 – 6V DC power supply/battery pack

1 Peristaltic pump with silicone tubing

2 – Containers for water Fish tank and Balancing Tank

1 - H-bridge controller

2 – Insulated wire

2 - Alligator clip test leads

10 – Jumper wires

11 - 100kΩ Resistor

1 - Potentiometer

0

The Design Process

The idea was floated as part of the brainstorming session in the IoT class. We liked the idea of connecting spending data to the water level in a fishbowl. The mix of playfulness and severity of the consequences, is a persuasive tool for influencing people.

Initially discussions centered around the nature of data that the fish tank would react to. Two clear alternatives emerged. The first idea was to display water level as a function of remaining balance, in a mentally accounted monthly/weekly budget. The second alternative was to collect aggregate data, and display a trailing average weekly/monthly spending. We decided that having a "reversible" water level, was more persuasive and positive than a constantly falling water level.

Iterations

In our first iteration, we weren't confident about making the pump flow in both directions. We planned using a servo/solenoid valve to operate a latch within the balancing tank. This design imposed constraints on the form and design of the device.


Challenges

Finding the right amount of resistance to offer, to input a value into Photon was challenging. After much experimentation, with the number and type of resistors, we were able to create a functional sensor.

A lot of time was also spent linking the photon to google sheets, via RSS+IFTTTT, since this was our first attempt in downloading information from the web.

Another challenge, was to identify the right hardware to operate the pump in both directions, we eventually stumbled upon the dual H-bridge controller in the ideate lab, a quickly figured out how to wire it up.


0
Ambient Fish Tank
k4n56jk (2016) - https://youtu.be/hfg41aO6DAY
0

The Logic behind the water level.

We use google sheets to aggregate the daily spending data. A running average column, computes the average spending of the previous 7 days.

Every daily avg spending value is rated on a 10 point scale. IF statements are used to cap the max and min values of the rating.

=IF((DailySpending!A9-10)>10,10,IF((DailySpending!A9-10)<0,0,DailySpending!A9-10))

The resultant values on the 10 point scale, are inverted to correspond to the water level. A high spending rating of 9, will result in a water level of 1.

=10-AvgSpendingScaled!A8

0

Connecting to the Cloud

An RSS feed links the google spreadsheet to the photon. Everyday, a new cell will be added to the sheet, prompting a new feed. The feed triggers the Particle function "newData"/handledata .

Daragh Byrne's tutorial for RSS feeds was used this.

0
//int led = D0;
int s_avg=5; //default spending average will be 5.
//IMPORTANT High spending will result in low s_avg values, and vice-versa.
//Setting up the Pins----------------------------
int pumpIn = A2; //This direction pumps water into the fish tank and out of the balancing tank
int pumpOut = A0; //This direction pumps water out of the fish tank into the balancing tank
int sensePin = A5; //connected to the depth sensor
///int potePin = A1; //the pin for reading the potentiometer, this is for diagnostics only

//Setting up the Variables-----------------------
///int poteSense = 0; //get the number for the potentiometer, used for debugging
int waterSense = 0; //level of water as returned by the water senser
int waterLevel = 0; // variable to store the water level

void setup() {
  Serial.begin(9600);
  //pinMode(led, OUTPUT);
  Particle.function("newData", handleData);
  pinMode(pumpIn, OUTPUT);
  pinMode(pumpOut, OUTPUT);
  pinMode(sensePin, INPUT);
  //Particle.variable("user_budget", budget , &INT );
  //Particle.variable("spending", spendingdaily , &INT);
  //pinMode(potePin, INPUT); //Potentiometer used for debugging
Serial.begin(9600);

digitalWrite(pumpIn, LOW);
digitalWrite(pumpOut, LOW);
}
void loop() {
//-----------------------------Debugging code please ignore--------
  //digitalWrite(led, HIGH);
  //delay(500);
  //digitalWrite(led, LOW);
  //delay(sec);
  //delay(200);
  //Serial.println(sec);
  //poteSense = analogRead(potePin);
  //poteSense = map(poteSense, 0, 4000, 0, 10);
  //Serial.print("petentiometer, ");
  //Serial.println(poteSense);
//--------------------------------------------------------
  waterSense = analogRead(sensePin);
  //Serial.println(waterSense);
delay(1);
//delay(500);
//waterLevel = 0;
//----------------------------------------------
  //mapping the waterSense to the water level
  if (waterSense > 0 && waterSense < 415)
  { waterLevel = 1; }
  if (waterSense > 416 && waterSense < 430)
  { waterLevel = 2; }
  if (waterSense > 431 && waterSense < 460)
  { waterLevel = 3; }
  if (waterSense > 461 && waterSense < 500)
  { waterLevel = 4; }
  if (waterSense > 501 && waterSense < 600)
  { waterLevel = 5; }
  if (waterSense > 601 && waterSense < 700)
  { waterLevel = 6; }
  if (waterSense > 701 && waterSense < 900)
  { waterLevel = 7; }
  if (waterSense > 901 && waterSense < 1200)
  { waterLevel = 8; }
  if (waterSense > 1201 && waterSense < 2000)
  { waterLevel = 9; }
  if (waterSense > 2001 && waterSense < 4000)
  { waterLevel = 10; }
  Serial.print("waterLevel, ");
  Serial.println(waterLevel);
  //-----------Pump out the water--------------------
if (s_avg < waterLevel)
  {
   digitalWrite(pumpOut, HIGH);
   delay(1000);
  }
  else
  {
    digitalWrite(pumpOut, LOW);
  }

//-----------Pump in the water--------------------
if (s_avg > waterLevel)
  {
   digitalWrite(pumpIn, HIGH);
   delay(1000);
  }
  else
  {
    digitalWrite(pumpIn, LOW);
  }

//-----------DON'T pump the water--------------------
if (s_avg == waterLevel)
  {
   digitalWrite(pumpIn, LOW);
   digitalWrite(pumpOut, LOW);
   delay(1000);
  }
//delay(1000);
//if (4001 < waterSense < 4095)
//{ waterLevel = 10; }
//--------------------------
}
//tells the function that it takes in a string called command
int handleData(String command)
{
Serial.print( "Received = ");
Serial.println( command );
s_avg = command.toInt();
Particle.publish("Average Spending", "&s_avg");
// if the first row is an decimal number and we wanted to extract
// it from the string.. we would do this.
// find the index of the first comma in the string
/*int spacePos = command.indexOf(",");*/
// create a substring from the first character to the first comma
// and convert that to a floating point (decimal number).
/*float spend = command.substring(0, spacePos ).toFloat();*/
// Return 1 to say completed successfull
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.


Skills
About

People often use mental accounting models, such as weekly or monthly budgeting to reign in on their spending habits. Yet even disciplined spenders, have a trouble keeping count of their spending.
The connected bowl collects the average of aggregate spending data, over the last 7 days, and displays it as the water level in a fish bowl.
High spending, will lower the water level, while low spending would increase the water level.