Smart Shower

Made by Shrey Agrawal, Tala Habbab and Melody Her

Found in DIoT - Augmented Objects · UNLISTED (SHOWN IN POOLS)

A shower system that changes color based on the water temperature and tells you how much water you've used up!

0

Problem Statement

Have you ever stepped into the shower on a cold crisp morning only to be greeted by freezing cold water? Have you struggled to find that temperature that’s just right for you because the shower knobs are too vague and confusing? Well so has Amrita. Although she loves taking showers, Amrita hates having to fiddle endlessly with her shower knobs and test the water temperature before getting in the shower. It ruins her shower experience, makes her late for class, and it adds to her water bill.

Amrita also deeply cares about the environment, and she doesn’t want to waste too much water. She wishes there was a way she could keep track of her water consumption while showering to try to be more aware of how much water she is using.

After listening to Amrita voice all of her shower concerns, it was clear she needed an IoT appliance that could get her to enjoy the entire shower experience while also getting her to become more aware of her water usage. Although Amrita specifically suffers from this problem, it is one that many people can also relate to, and it is of great significance. That is why we have chosen to focus on the creation of an interactive shower system that can take away all of her shower concerns.

0

Goal

The goal of this project is to create a shower system composed of a color-changing shower head, knobs, and meter indicator that will take away Amrita’s shower struggles while also making her more aware of her water consumption.

As Amrita turns on her shower knobs, a neopixel ring lining the shower head will change in color to indicate the temperature of the running water before she gets into the shower. Additionally, once she turns on her knobs, two potentiometers will be used to start recording the volume of water exiting the shower head. This volume can be viewed using a meter indicator that is linked to the potentiometers and consists of a range of water volume values.

This solution will provide Amrita with an exact indication for when to enter the shower without having to be greeted by an unpleasant water temperature. Additionally, it will nudge her to reduce her water usage and start saving on her water and gas bills as she tracks her water consumption. 

0

Storyboard

0

Approach

This solution is approached by creating a shower head that is lined with a neopixel ring, which is connected to a waterproof TMP temperature sensor. The neopixel light will turn blue when the water is first turned on and is still cold; it will gradually turn from blue to yellow to red as the water gets hotter. Blue indicates cold water; red, hot water; and yellow indicates the right temperature.

Once the potentiometer knobs are turned on, they will begin collecting information about the water volume exiting the shower head. This information is linked to a servo that will begin to change its angle as more water is used. This angle indicates the amount of water used on a meter indicator. 

0

Process

Water Consumption

The project started off by creating a circuit with two potentiometers, one representing a hot knob and the other a cold knob. We implemented a code that would start a timer whenever the knobs are turned on. Based on the angle at which the knob is turned on, the particle code will also record a reading from each potentiometer. This reading is meant to represent how much water is sent to the shower head from either the cold valve of hot valve. Since the use of water to test our device may damage our electronic devices and circuit board, we decided to simulate the flow of water using the reading from the potentiometer. When this reading is multiplied by the amount of time during which the knob has been turned on, the resulting value will represent the volume of water that has been used up. We encountered some challenges in this process while writing the code to ensure the volume measurement was accurate over time. Since the water consumption is not only a function of time but it is also a function of any previous knob readings; the code needed to continuously update the volume by recording the new volume reading and adding it to any previous volume readings.

Once the water volume is measured in one particle argon board (B1), this value will be sent to another particle argon board (B2). B2 consists of a servo and button. The water volume is translated into a value along the water consumption meter, and the servo acts as an indicator along this meter. As the volume changes, the servo angle changes to indicate that more water is being used up. A challenge with using the servo is that its movement is specific to the range of water volume displayed in the meter indicator; depending on the range we select, the servo may not be sensitive enough to detect minute changes in the consumption. The button on this board is used to reset the water volume reading when the user is done recording.

Temperature Indication

To help the user understand what the temperature of the water is before getting into the shower, we used a neopixel ring and a waterproof TMP sensor. Initially, we had planned to map the potentiometer readings to a temperature reading based on the angle at which the hot and cold knobs are turned to; however, based on the feedback we received, we decided to use a TMP sensor to record a temperature reading since this will provide a more accurate measurement of temperature for the user. As the TMP sensor measure a value between 10°C and 35°C, the neopixel ring will change in color from blue to yellow. Between 35°C and 60°C, the neopixel ring will change from yellow to red. Thus, as the temperature of the water approaches the normal body temperature (~35°C), the color of the neopixel ring approaches yellow. 

0
0

Implementation

List of Circuit Parts

  • Argon Particle Board with WiFi connector (x2)
  • Mini breadboard (x2)
  • USB cable (x2)
  • Servo
  • Servo attachment
  • Jumper wires
  • Male-to-female jumper wires
  • Neopixel ring
  • Button
  • Potentiometers (x2)
  • DC power supply

Circuits

Circuit #1 

 

Circuit #2

 

0
//Circuit #1
int buttonPiny = D2; 
int buttonPing = D3;
int ledPiny = D4;
int ledPing = D5;

int buttonStatey = LOW;
int buttonStateg = LOW;

long lastPublishedAt = 0;
 
int publishAfter = 1000;

void setup()
{
    pinMode( buttonPiny , INPUT_PULLUP);
    pinMode( buttonPing , INPUT_PULLUP);
    pinMode( ledPiny , OUTPUT );
    pinMode( ledPing , OUTPUT );
    Particle.variable("buttonG",buttonStateg);
    Particle.variable("buttonY",buttonStatey);
    Particle.subscribe(  "diot/2019/paired/" , handleSharedEvent );

}

void loop()
{
    buttonStatey = digitalRead( buttonPiny );
    buttonStateg = digitalRead( buttonPing );
    
    if (buttonStatey == 0 || buttonStateg == 0) 
    {
    publishMyEvent();

    // delay for a bit
    delay(100);
    }
    
    else {}

    // delay for a bit
    delay(100);
}


void publishMyEvent()
{

  if( lastPublishedAt + publishAfter < millis() )
  {
    String eventName = "diot/2019/paired/" + System.deviceID();
    Particle.publish( eventName, "data goes here" );
    lastPublishedAt = millis();
  }

}
void handleSharedEvent(const char *event, const char *data)
{
    String eventName = String( event ); // convert to a string object
    String deviceID = System.deviceID();

    if( eventName.indexOf( deviceID ) != -1 ){
      return;
    }
    else if ( eventName.indexOf( "e00fce68f98f1cc9288d63db" ) != -1){//melody's device
        digitalWrite( ledPing, HIGH);
        delay(1000);
        digitalWrite( ledPing, LOW);
        
    }
    else if ( eventName.indexOf( "e00fce68399c53fa4b94562a" ) != -1){//tala's device
        digitalWrite( ledPiny, HIGH);
        delay(1000);
        digitalWrite( ledPiny, LOW);
    }
    
}

//*****************************Code 1 end**************************************************



//**************************************************************
//Circuit #2
Servo myServo;
int servoPin = A3;
int servoPos = 0;
int newPos;
int showVolume = 0;
int waterVolume = 0;
int buttonPin = D2;
int buttonState=LOW;

long lastPublishedAt = 0;
//the time delay before publishing a new event from this device
int publishAfter = 10000;

void setup() {
    // attaches the servo on the A3 pin to the servo object
    myServo.attach( A3 );

    //Register Particle to control the servo
    Particle.function("servo", servoControl);
   
    //Keep cloud variables
    Particle.variable(  "servoPos" , &servoPos , INT );
    Particle.variable("button",buttonState);
    Particle.subscribe(  "diot/2019/smartShower" , handleSharedEvent );
    
    // sets button pin as input
    pinMode( buttonPin , INPUT_PULLUP);
}

void loop() {
    buttonState = digitalRead( buttonPin );
    //publish event when the button is pushed
    if( buttonState == 0 )
    {
        publishMyEvent();
    }else{}
}

int servoControl(String command)
{
    // Convert
    newPos = command.toInt();
    // Make sure it is in the right range
    //set the position
    servoPos = constrain( newPos, 0 , 180);

    // Set the servo
    myServo.write( servoPos );

    // done
    return 1;
}

void publishMyEvent()
{
  // check that it's been 10 secondds since the last publish
  if( lastPublishedAt + publishAfter < millis() )
  {
      String eventName = "diot/2019/smartShower" + System.deviceID();
      Particle.publish( eventName, "data goes here" );

      //capture publish time
      lastPublishedAt = millis();
  }
}

void handleSharedEvent(const char *event, const char *data)
{
    String eventName = String( event );
    // convert to a string object

    String waterVolumeIn = String(data);
    String deviceID = System.deviceID();

    if(eventName.indexOf( "e00fce68f3ec1a95fb53ad4c" ) != -1 ){
        waterVolume = waterVolumeIn.toInt();
        showVolume = map (waterVolume,0,6000,5,130);
        servoControl(String(showVolume));
    }
    else{
        return;
    }
}
Click to Expand
0

Next Steps

Going forward, we would like to improve our meter indicator for water consumption to make it more tailorable for the user and more quantitative. Currently, the range is displayed quantitatively, and it meant to record water use after one shower; however, the user may like to keep track of water consumption for longer periods, which would require a larger range of values; additionally, they may like a quantitative representation of consumption along with the qualitative.

Another addition may involve using music within the shower head. Our user indicated that she always listens to music in the shower. This could be one additional aspect that could be integrated into our design.

Reflection

Overall, the entire process went relatively smoothly. There were little challenges that could not be overcome or dealt with. We reached the final product that we set out to reach while also implementing changes based on feedback. We encountered a few challenges at the beginning. We experienced difficulties with running our code as certain naming conventions on the particle website would not work. We solved this problem by changing our variable names to not include words such as ‘time’ and ‘volume’.

References

https://www.washingtonpost.com/news/energy-environment/wp/2015/03/04/your-shower-is-wasting-huge-amounts-of-energy-and-water-heres-what-to-do-about-it/

x
Share this Project

This project is only listed in this pool. Be considerate and think twice before sharing.


Courses

49713 Designing for the Internet of Things

· 16 members

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


Focused on
About

A shower system that changes color based on the water temperature and tells you how much water you've used up!

Created

November 20th, 2019