utilizing a raspberry pi to make your home smarter · 2020. 2. 18. · 3.3 raspberry pi & home...

14
Utilizing a Raspberry Pi to make your Home Smarter Nivetha Karthikeyan [email protected] Lily Kwak [email protected] Sneha Rampalli [email protected] Varun Ravichandran [email protected] Anna Song [email protected] 1. ABSTRACT Water has decreased in abundance as communities around the world have faced severe droughts and shortages. The devastating effects of these events have led governments, researchers, and individuals to make significant efforts to conserve water. Conservation is hindered by the limitations of existing infrastructure and traditional human activities. This makes significant change difficult to achieve. By utilizing the potential of home automation, individuals can find ways to reduce their water usage without notably altering their daily lives. The Eco-Shower system invented in this project achieves just that by reducing the amount of water coming out of showers when individuals are engaging in non- rinsing activities. These tasks include applying shampoo, cleansing with soap, or other such activities that do not require the user to stand underneath the showerhead. This project traced the creation of Eco- Shower from the initial design concept through the building, wiring, coding, and testing of an alpha prototype. Final experimental results suggested that Eco- Shower can reduce the amount of water used in showers during non-rinsing activities by approximately 24.6%. The end result was a device that promotes increased water conservation by blending home automation with an environmental focus. 2. INTRODUCTION In the past few decades, environmental conservation has become a front-page issue as scientists and citizens have strived to conserve Earth’s natural resources. In particular, water conservation, even by singular households, can produce very meaningful results as nearly the entire population can get involved. One of the most common and resource-intensive uses of water around the house is showering, which accounts for nearly a fifth of an individual’s daily water usage. 1 Recent innovations in mechanical shower technology have allowed individuals to save many gallons of water, helping preserve existing water supplies. However, more progress can be made. With countless improvements in computing and robotics, home automation offers individuals simpler alternatives to traditional conservation methods. The Eco-Shower combines the idea of water conservation with the practice of home automation, creating a system that simply reduces the amount of water used in showers. As shown in Figure 1, the system consists of three main components: a pressure mat sensor placed under the flow of water, a solenoid valve unit installed into the piping of the shower, and a Raspberry Pi / XBee radio communication set that wirelessly connects the other two parts. When a user steps on the pressure mat

Upload: others

Post on 25-Sep-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Utilizing a Raspberry Pi to make your Home Smarter · 2020. 2. 18. · 3.3 Raspberry Pi & Home Automation The Raspberry Pi is a microcomputer that is capable of interacting with the

Utilizing a Raspberry Pi to make your Home Smarter

Nivetha Karthikeyan

[email protected]

Lily Kwak

[email protected]

Sneha Rampalli

[email protected]

Varun Ravichandran

[email protected]

Anna Song

[email protected]

1. ABSTRACT

Water has decreased in abundance as

communities around the world have faced

severe droughts and shortages. The

devastating effects of these events have led

governments, researchers, and individuals to

make significant efforts to conserve water.

Conservation is hindered by the limitations

of existing infrastructure and traditional

human activities. This makes significant

change difficult to achieve. By utilizing the

potential of home automation, individuals

can find ways to reduce their water usage

without notably altering their daily lives.

The Eco-Shower system invented in

this project achieves just that by reducing

the amount of water coming out of showers

when individuals are engaging in non-

rinsing activities. These tasks include

applying shampoo, cleansing with soap, or

other such activities that do not require the

user to stand underneath the showerhead.

This project traced the creation of Eco-

Shower from the initial design concept

through the building, wiring, coding, and

testing of an alpha prototype. Final

experimental results suggested that Eco-

Shower can reduce the amount of water used

in showers during non-rinsing activities by

approximately 24.6%. The end result was a

device that promotes increased water

conservation by blending home automation

with an environmental focus.

2. INTRODUCTION

In the past few decades,

environmental conservation has become a

front-page issue as scientists and citizens

have strived to conserve Earth’s natural

resources. In particular, water conservation,

even by singular households, can produce

very meaningful results as nearly the entire

population can get involved. One of the

most common and resource-intensive uses

of water around the house is showering,

which accounts for nearly a fifth of an

individual’s daily water usage.1 Recent

innovations in mechanical shower

technology have allowed individuals to save

many gallons of water, helping preserve

existing water supplies. However, more

progress can be made. With countless

improvements in computing and robotics,

home automation offers individuals simpler

alternatives to traditional conservation

methods.

The Eco-Shower combines the idea

of water conservation with the practice of

home automation, creating a system that

simply reduces the amount of water used in

showers. As shown in Figure 1, the system

consists of three main components: a

pressure mat sensor placed under the flow of

water, a solenoid valve unit installed into the

piping of the shower, and a Raspberry Pi /

XBee radio communication set that

wirelessly connects the other two parts.

When a user steps on the pressure mat

Page 2: Utilizing a Raspberry Pi to make your Home Smarter · 2020. 2. 18. · 3.3 Raspberry Pi & Home Automation The Raspberry Pi is a microcomputer that is capable of interacting with the

sensor, indicating that they are standing

directly under the showerhead, the

communication set sends a signal to the

solenoid valve, the component that controls

the amount of water flowing through the

showerhead. The command prompts the

solenoid valve to remain open and allow the

full volume of water to pass through. When

the user steps off the mat to shampoo or

perform other non-rinsing activities, the set

sends another signal to the valve, telling it to

rapidly open and close in order to decrease

the flow of water.

Figure 1: Eco-Shower Set-Up

3. BACKGROUND

3.1 Water Conservation:

According to environmental

researchers Evett and Kähler, water

conservation is defined as the “management

of water consumption in ways that minimize

waste, maximize efficiency, and help to

maintain adequate supplies of high-quality

water.”2 In 2000, the United States’ daily

use of water per capita was 1,430 billions of

gallons.2 Because the United States has been

using an extensive amount of water,

conservation of this natural resource has

grown increasingly important as states such

as California have faced historic droughts.

In order to combat this issue, California’s

state government passed the Water

Conservation Act of 2009 to dictate water

conservation targets and improve the

efficiency of water distribution for public

and agricultural use.3

Although legislation is being passed

to help preserve existing water supplies,

individuals can significantly reduce the

amount of water used overall. Anyone can

take action, which is often more feasible

than implementing water-supply

infrastructure on a large scale. According to

the Environmental Protection Agency

(EPA), individuals spend 16.6% of their

daily water consumption in showers,

meaning that the average family of four in

the U.S. uses 40 gallons per day showering.4

In total, nearly 1.2 trillion gallons of water

in the U.S. is used solely for showering.4

Reducing the rate of water consumption in

showers from 4.5 to just 2.5 gallons per

minute could save the average family of four

around 20,000 gallons of water per year,

clearly highlighting the potential and

importance of shower water conservation.5

3.2 Home Automation:

Home automation is the ability to

control certain aspects of the house through

the use of sensors and microcomputers. One

example is using a mobile application to

turn on the dishwasher or turn off the

television. Home automation uses sensors to

detect human actions and then inserts those

pieces of data into a “home network.” Once

Page 3: Utilizing a Raspberry Pi to make your Home Smarter · 2020. 2. 18. · 3.3 Raspberry Pi & Home Automation The Raspberry Pi is a microcomputer that is capable of interacting with the

in the “home network,” programs process

the stream of information to dictate

automatic actions around the household.

Recently, home automation has become a

popular field of study as it directly impacts

and greatly simplifies the average person’s

life. Its main goal is to improve the quality

of life by replacing complex human

interactions with programmable

microcomputers.

Home automation tasks can be

separated into two different types: event-

specific and ongoing. Event-specific

activities only occur at certain times, such as

lights turning on when motion is detected.

These activities, including the shower

automation task completed in this project,

involve binary sensors that are either on or

off based on a user’s action. Meanwhile, on-

going automation takes place in a

continuously detecting environment where

sensors are constantly sending data.

Automatic air conditioning and heating units

are examples of on-going automation

systems where temperature sensors send a

steady collection of data to a central unit. In

order to develop smart home databases and

allow these sensor inputs to be translated

into actions, algorithms must be made to

connect the microcomputers to different

sensors.6 Home automation simplifies

mechanical daily tasks so that they can be

completed by external devices.

3.3 Raspberry Pi & Home Automation

The Raspberry Pi is a microcomputer

that is capable of interacting with the outside

world and undertaking tasks that a regular

computer can accomplish. It has been used

many times in the field of home automation

because of its ability to enhance the quality

of life in houses with sensors. It supports a

large number of input and output

peripherals, devices that are used to put or

get data from a computer. This allows the

Raspberry Pi microcontroller to be a

practical device that is able to communicate

with different sensors. Its features can

therefore be easily utilized to save water in

the household. A significant amount of

water is wasted in the shower as people

often permit the water to run longer than

what is necessary. Pressure sensors used in

conjunction with the microcontroller provide

a viable solution to this pressing problem by

controlling the amount of water released by

the shower. Based off this premise of home

automation, a pressure mat sensor can be

effectively used to detect the individual’s

position in the shower. The pressure mat

sensor was used in conjunction with the

Raspberry Pi microcontroller, since the

microcomputer used the data communicated

to analyze and command the solenoid valve

to open and close.7

4. METHODOLOGY

4.1 Brainstorming

Home automation is a broad and

diverse category that encompasses

everything from controlling air conditioning

to opening garage doors. Therefore, this

project had a significant degree of freedom

with countless possibilities for final

products. The theme of conservation quickly

emerged as a focal point due to its relevance

in daily life, particularly with the rise of the

environmental movement. Automation is

useful in this matter as computer programs

can be utilized to control resource

consumption in households without

requiring external human input.

After a preliminary round of

research, it was discovered that

approximately 1,430 gallons of water are

used in the United States on a daily basis.8

Additional research revealed that showers

are a significant source of household water

usage and personal experience revealed that

Page 4: Utilizing a Raspberry Pi to make your Home Smarter · 2020. 2. 18. · 3.3 Raspberry Pi & Home Automation The Raspberry Pi is a microcomputer that is capable of interacting with the

water is often wasted when participating in

non-rinsing activities in the shower. This

combination of academic research and

independent experiences culminated to form

the idea for Eco-Shower.

4.2 Materials

4.2.1 Raspberry Pis and XBees:

The central parts of the Eco-Shower

system include two Raspberry Pis in the A+

model and two XBee Modules for wireless

communication. The Raspberry Pi A+

model is a microcontroller that is capable of

transmitting electric voltage, connecting

with USBs, and reading SD cards in addition

to processing and computing. Meanwhile,

XBees are wireless communication modules

that use the ZigBee wireless language

standard to connect with one another. In

addition, a USB to TTL cable, which

contains a USB-compatible end to another

end with four pins that can fit into the

General-Purpose input/output pins (GPIO

pins) of a Raspberry Pi microcontroller.

Therefore, one of these was used to connect

the Raspberry Pi microcontroller to the

computer so that coding could be completed.

The USB Explorer is a device that can

connect the XBees directly with the

Raspberry Pi microcontrollers.

4.2.2 Pressure Sensor Mat:

Cardboard was chosen to construct

the pressure mat sensor due to its cost-

effectiveness and flexibility. The planes of

the pressure mat sensor need to keep from

touching when laid flat, and only bend under

significant human pressure. Additionally,

cardboard is an inductive material; it allows

for the current to flow only when the two

sheets of aluminum foil touch. Otherwise,

the circuit is open with cardboard, and the

material can easily act as a framework to

separate the foil sheets in the absence of

human weight. The aluminum foil was also

readily available and malleable to the rigid

structure of the cardboard. The electrical

tape was used to connect the wires to the

aluminum foil because the tape conducts

current on one side without damaging the

wires. The tape reinforced loose wire

connections as well.

4.2.3 Solenoid Valve Unit:

As shown in Figure 2, the solenoid

valve consists of a metal solenoid head and

plastic valve below. A plastic plunger

normally blocks the inner valve opening and

separates the inlet from the outlet port. The

metal head responds to electromagnetic

fields, in which case it lifts the plunger back

into the head. When current no longer runs

through the solenoid head, the plunger drops

back into place by a coiled spring along the

valve to obstruct fluid flow. Current runs

through the solenoid head when a battery

pack connects to the head’s two metal

extensions via voltage and ground wires.

Both the solenoid valve and the pressure mat

sensor units are encased by waterproof

Ziploc bags.

Figure 2: Solenoid Valve Components9

Page 5: Utilizing a Raspberry Pi to make your Home Smarter · 2020. 2. 18. · 3.3 Raspberry Pi & Home Automation The Raspberry Pi is a microcomputer that is capable of interacting with the

4.2.4 Circuitry:

Assorted wires were used to connect

circuitry parts and carry current. A wire

cutter stripped the plastic coverings of wires

to expose more metal for circuitry.

Breadboards with indents for wire insertion

were included in the circuitry because they

helped solidify wire connection as a better

alternative than twisting wires together.

Indents on the same rows on breadboards

are also already connected in series by

embedded metal without additional

modification, and help organize circuitry

parts. The pressure mat sensor and the

solenoid valve unit used one breadboard

each.

Numerous 1K Ω resistors were

connected in the circuits as means to reduce

high voltages to prevent circuit blow-up and

short circuiting. In the Eco-Shower, these

resistors were utilized to lower 6V battery

packs to the acceptable 5V for the Raspberry

Pi in both the pressure mat sensor and

solenoid valve unit.

A pack of sixteen standard 1.5V AA

batteries were purchased to power the two

Raspberry Pis and solenoid valve in battery

packs. Battery packs connect all batteries

within their casing in series to produce

higher voltage. Two 6V and one 12V battery

packs were used to power the Raspberry Pis

and valve, respectively. The valve requires

more voltage to power the oscillations of the

plunger than the Raspberry Pi does in

signaling. The 6V battery pack can hold four

1.5V AA batteries, while the 12V can hold

eight. From each 6V battery pack, a red

power wire applies positive voltage to drive

current, and a black ground, uncharged wire

in turn accepts the flowing current. Though

the 12V battery pack in the solenoid valve

unit does not have wire extensions, a clip

collector with the red and black wires was

attached to the positive and ground metal

rings of the battery pack.

Specific to the solenoid valve circuit,

the NPN transistor splits into three prongs

and amplifies the current signal by accepting

the current through the middle prong,

sending the current to high voltage through

the upper prong, and grounding the current

to lower, zero voltage through the lower. A

20V flywheel diode was used in circuit to

direct the current only in one direction, since

the voltage drop across it is as strong as

20V, a large difference. Because the

solenoid valve circuit must be switched on

and off quickly, the diode prevents voltage

spikes in directing the current.

4.2.5 Shower model:

Due to the lack of availability of a

shower on which the solenoid valve could

be installed, a model of a shower was used

for experimental testing. The model was

built with rubber tubing, a funnel, and duct

tape.

4.3 Overview

Figure 3: Eco-Shower Flow Chart

Eco-Shower integrates both home

automation and water conservation. This

automated shower controls the volume of

water released, according to the location of

the individual in the shower. As shown in

Page 6: Utilizing a Raspberry Pi to make your Home Smarter · 2020. 2. 18. · 3.3 Raspberry Pi & Home Automation The Raspberry Pi is a microcomputer that is capable of interacting with the

Figure 3, when the user exerts pressure on

the shower mat, a solenoid valve installed in

the showerhead is signaled via Raspberry Pi

and XBee communication to increase the

volume of water released. Eco-Shower

consists of three main components: a

pressure mat sensor, Raspberry Pi and XBee

communication, and a solenoid valve unit.

4.4 Experimental Testing:

Difficulties involving the connection

between the Raspberry Pi and the computer

rendered the team unable to make the

Raspberry Pis run the appropriate code.

Subsequently, the wireless prototype could

not be prepared for the initial round of

testing. Therefore, data was collected

through a manual procedure that opened and

closed the solenoid valve to reduce water

flow. First, a length of rubber tubing was

attached to the solenoid valve, which

modeled the way the metal pipes of the

shower would connect to the valve in the

actual Eco-Shower. As shown in Figure 4, a

circuit was created by wiring the solenoid

valve to a battery supply. Water was then

poured into the rubber tubing and the valve

was placed over a labeled collection basin to

gather the volume of water that had been

released. A stopwatch was utilized to

measure the amount of time it took for the

water to fill up to 200 milliliters. This

procedure modeled the water flow rate in a

typical shower. In order to test the positive

impacts of the Eco-Shower, the same

procedure was repeated while opening the

circuit one out of every five seconds, which

drops the plunger and stops the water flow.

Once again, the procedure was timed until

200 milliliters of water had been collected

by the collection basin. The entire procedure

was repeated for a total of five trials, which

increased the data's precision.

Figure 4: Experimental Testing

5. PROJECT DESIGN & RESULTS

5.1 Pressure Mat Sensor

The pressure mat sensor is placed

directly under the showerhead away from

the toiletries to detect user position in the

shower setting. With its Raspberry Pi

connected in circuit, the pressure mat sensor

sends a signal to the Raspberry Pi in the

solenoid valve unit to allow normal water

flow in the presence of significant human

weight. In the absence of great pressure, the

mat signals the solenoid valve unit to reduce

water volume getting to the showerhead,

thus conserving water.

As represented in Figure 5, the

pressure mat sensor, which was constructed

from two pieces of stacked inducting

cardboard coated on the insides with two

sheets of conducting aluminum foil

separated by another cardboard frame. When

the user’s feet are placed on the mat, the two

cardboard planes are compressed until the

sheets of aluminum foil meet. This closes

the circuit and allows electricity to pass

through. The entire pressure sensor in circuit

is encased in an ordinary shower mat that

adds to the convenience of the system.10

The actual pressure sensor acts as an

on/off switch that closes and opens the

circuit. The GPIO pins of the Raspberry Pi,

Page 7: Utilizing a Raspberry Pi to make your Home Smarter · 2020. 2. 18. · 3.3 Raspberry Pi & Home Automation The Raspberry Pi is a microcomputer that is capable of interacting with the

which are used as generic pins for input and

output, are used to connect the pressure

sensor to the Raspberry Pi itself. In circuit,

the sensor is wired from the top to the 5V

pin on the Raspberry Pi where current is

supplied, and from the bottom to the GPIO

14 pin that detects the opening and closing

of the circuit through the current. This pin

then signals the pressure mat sensor

system’s XBee to communicate with its

solenoid valve XBee and Raspberry Pi

counterparts. The 6V AA battery used to

power the pressure mat sensor system’s

Raspberry Pi is wired through five 1K Ω

resistors connected in series that reduce its

voltage to the 5V that the Raspberry Pi can

accept. Wires, connected before and after

these resistors to pick up the new potential

difference, are then attached to the 5V and

GND pins of the Raspberry Pi to apply the

5V to the board.

Figure 5: Pressure Mat Sensor

5.2 Raspberry Pi/XBee Communication

If the pressure mat sensor is

activated by the user, the system must then

work to reduce the volume of water that is

released by the shower. As soon as the

pressure sensor sends a signal to the

Raspberry Pi, it must communicate with the

solenoid valve, which controls the water

flow. This can be achieved either with

extensive wiring or wirelessly with the

assistance of a second Raspberry Pi and a

pair of XBee modules. Due to the high

volume of water that will be present near the

Eco-Shower, wireless communication is the

optimal method of activating the solenoid

valve. XBees offer a cost-effective and

simple means of wireless communication

between microcontrollers and computers,

typically Arduinos and Raspberry Pis. As a

result, XBees are extremely well-suited to

connect two Raspberry Pis wirelessly over a

short distance.

The Raspberry Pi located within the

pressure sensor mat is connected to the

XBee Series 2 module by a USB Explorer,

which allows the XBee to connect and

communicate directly to the Raspberry Pi

through the Raspberry Pi’s USB port. This

setup is visualized in Figure 6, and the

Raspberry Pi is coded to accept a signal

from the pressure sensor, which causes it to

send an output signal wirelessly via the

XBee. The second Raspberry Pi is also

connected to another XBee module with a

USB Explorer. When the second Raspberry

Pi receives this signal as input, it is triggered

to produce voltage on a GPIO pin to

complete a circuit connecting the Raspberry

Pi, the battery supply, and the solenoid

valve. Please see Appendix 9.2 for code.

Figure 6: Raspberry Pis & XBee Radios

5.3 Solenoid Valve

The solenoid valve is signaled either

to open or close by the pressure mat sensor,

based on the user’s position in the shower.

The valve maintains normal water levels

Page 8: Utilizing a Raspberry Pi to make your Home Smarter · 2020. 2. 18. · 3.3 Raspberry Pi & Home Automation The Raspberry Pi is a microcomputer that is capable of interacting with the

when significant human pressure is sensed,

and decreases water volume flow otherwise.

The solenoid head is a part of the

circuit, while the valve is easily attachable to

shower systems between the showerhead

and connection. Inside the valve is a plunger

that is normally closed and obstructs water

from flowing out the showerhead. However,

when an electric current runs through the

solenoid valve, the plunger opens and allows

water to flow out normally. Oscillating the

valve plunger by switching the current on

and off results in a decreased water flow

rate.

Figure 7 displays the Raspberry Pi,

relaying pressure mat sensor signals and

changing current, connecting to a 1K Ω

resistor through GPIO Pin 18 to prevent

short-circuiting. The resistor is wired to a

NPN transistor that amplifies the current,

which branches off one way to be grounded

back to the Raspberry Pi to complete the

voltage drop, and another to the 12V

solenoid head of the valve through a 20V

flywheel diode. The valve is powered by a

12V AA battery pack, while the Raspberry

Pi is powered by a 6V AA battery reduced

effectively to 5V by six 1K Ω resistors.

Figure 7: Solenoid Valve Unit

5.4 Data

Five trials were conducted to test

both the control group, which did not use the

Eco-Shower, and the experimental group,

which did use the Eco-Shower. In Figure 8,

the time it took to release 200 mL of water

was recorded in seconds for each trial of

each group. In each trial, the experimental

group required a larger amount of time than

the control group did to release the full 200

mL of water. This was indeed the expected

result as the Eco-Shower system was

designed to release a smaller amount of

water by quickly opening and closing the

solenoid valve.

Comparative Flow Rate Times With and

Without Eco-Shower

Trials

1 2 3 4 5

Time to

fill 200

mL of

water

w/out

Eco-

Shower

(s)

415 407 399 365 448

Time to

fill 200

mL of

water w/

Eco-

Shower

(s)

583 568 468 505 583

Figure 8: Flow Rate Times

5.5 Mathematical Calculations

In order to calculate the individual flow

rates for each trial, the volume of water

collected (200 mL) was divided by that

trial’s recorded time. The percent

differences between flow rates were

Page 9: Utilizing a Raspberry Pi to make your Home Smarter · 2020. 2. 18. · 3.3 Raspberry Pi & Home Automation The Raspberry Pi is a microcomputer that is capable of interacting with the

calculated to determine the percentage of

water, which can be saved using the

solenoid valve since flow rate and water

volume are interchangeable with a set time

frame. The average of these five percent

differences was taken to find the mean

percent of water users can save while

showering with Eco-Shower when not

directly in the water’s line of flow. See

Appendix 9.1 for calculations.

6. CONCLUSION

6.1 Overview

Eco-Shower is designed to be a

simple addition to household showers that

enables water conservation by automating

the flow of water. Eco-Shower consists of

two primary parts: a pressure mat sensor that

keeps track of a user’s position, and a

solenoid valve that controls the water flow.

The two separate elements are programmed

via Raspberry Pis that communicate

wirelessly through XBee radios. Once the

user places the pressure mat sensor under

the stream of water and screws the solenoid

valve into the piping, Eco-Shower is fully

functional without further effort from the

user, which achieves a fundamental

objective of home automation.

Eco-Shower, as evidenced by the

initial round of testing completed on a

prototype model, is capable of reducing the

amount of water used in a shower during

non-rinsing activities by 24.6%. The

percent difference was used to calculate the

potential flow rate that would result if the

Eco-Shower was installed. Based on the

U.S.’s maximum shower flow rate of 9.50

liters per minute, the calculated flow rate

during non-rinsing activities was 7.16 liters

per minute.11 More than just impacting

showers, though, the technology used to

develop Eco-Shower could also be adapted

for use in washing dishes. Just as Eco-

Shower minimizes water wasted when a user

does not need to be rinsed, a similar kitchen

application could reduce water flow when

dishes are being cleaned and not rinsed. The

overall household effect of Eco-Shower and

similar technologies would be a reduction in

utility bills, a decrease in wastage, and an

advancement in water conservation.

6.2 Challenges Faced

Throughout the process of designing

the Eco-Shower system, several obstacles

delayed progress. Deciding how to detect a

user’s position in the shower involved

brainstorming what sensors could be used.

Multiple sensors were considered, such as

infrared and proximity sensors. However,

infrared would not be possible since it

detects the movement of any object in its

view, so it would mistake the water droplets

coming from the showerhead as the user’s

motions while showering. A proximity

sensor was not the appropriate sensor to use

because the user’s position in the shower is

constantly changing and is different for each

user. Additionally, it was difficult to test the

device on an actual showerhead. A model of

a shower was made by widely available

materials, such as rubber tubing and a

funnel, in order to collect data on how much

water would be saved using this device.

Another challenge confronted was

preventing the water flow from stopping. In

its natural state, the solenoid valve cuts

water flow completely, so it would not be

possible to close the valve partially and keep

a small stream of water flowing. As a result,

the solenoid valve was programmed to

constantly open and close, reducing the

amount of water passing through without

fully stopping the water flow.

The central components of the Eco-

Shower are the Raspberry Pis and the

XBees, but configuring these devices proved

Page 10: Utilizing a Raspberry Pi to make your Home Smarter · 2020. 2. 18. · 3.3 Raspberry Pi & Home Automation The Raspberry Pi is a microcomputer that is capable of interacting with the

to be a major challenge. While installing the

Raspberry Pis, it became apparent that the

devices could not connect to a television

monitor via HDMI. As a result, the

Raspberry Pis were connected to a laptop

through a USB to TTL cable. By far the

most significant challenge occurred when

the laptops began failing to recognize the

Raspberry Pis when connected. As a result,

uploading the code to the SD cards was not

possible and the wireless prototypes could

not be constructed for testing purposes. A

solution to this problem was achieved by

manually completing the circuit to open and

close the solenoid valve, which successfully

simulated the effect that the final Eco-

Shower would have.

6.3 Future Steps

In its current state, the Eco-Shower

system remains an alpha prototype that

serves as a proof of concept for

automatically creating dynamic water flow

in a shower. Now that initial testing has

successfully been conducted, however, Eco-

Shower is ready to be further developed into

a fully functional and user-friendly product.

Early steps into creating an advanced model

of Eco-Shower would involve replacing the

prototype’s simple, widely available

materials with sturdier, more durable ones.

The cardboard and aluminum foil pressure

sensor mat would be substituted out for a

flexible plastic and metal sheet sensor

encased within a usable shower mat.

Breadboard circuits would also be switched

out in favor of fully encased wiring systems.

The XBee radios are popular in “do

it yourself” home automation projects for

their simplicity. However, it would be more

practical to swap the XBee radios out for a

more modern Bluetooth communication

system, which is commonly used in

commercial products. While all material

replacements would require mechanical

changes, the Bluetooth switch would also

mandate a software update to account for the

difference in technology. The end result

would be a more professional and

marketable version of the original Eco-

Shower system that could be integrated into

real world showers.

7. ACKNOWLEDGEMENTS

The authors would first like to thank

their project mentor, Josh Binder, and

residential teaching assistant, Noah Lee, for

their guidance and support provided for this

project. They would also like to recognize

their mentors from Lockheed Martin

Engineers: Kyle A. Cavorley, Manu

Colacot, Joseph C. Ippolite, and Evan

Kesten. Not only did they provide the

resources necessary to complete the

prototype, but they also aided the process of

constructing the alpha prototype. They

delivered valuable insight to help the authors

understand the key components of the

project, including circuitry and XBees.

Additionally, the authors would like to

express gratitude toward the New Jersey

Governor’s School of Engineering and

Technology, the Director, Dr. Ilene Rosen,

and the Associate Director, Dean Jean

Patrick Antoine, for giving them the

opportunity to do research with helpful

mentors and fellow classmates. The authors

would also like to thank the sponsors of the

Governor’s School of Engineering and

Technology for providing them with the

opportunity to participate in research

projects and develop as future engineers:

Rutgers, the State University of New Jersey;

Rutgers School of Engineering; The State of

New Jersey; Silver Line Windows and

Doors; Lockheed Martin; South Jersey

Industries; Novo Nordisk Pharmaceuticals,

Inc.; and NJ Resources.

Page 11: Utilizing a Raspberry Pi to make your Home Smarter · 2020. 2. 18. · 3.3 Raspberry Pi & Home Automation The Raspberry Pi is a microcomputer that is capable of interacting with the

8. REFERENCES

1Environmental Protection Agency, Water

Use Today (2015). 2J. B. Evett and K. N. Kähler, Water

Conservation (2015). 3California Department of Water Resources,

The Water Conservation Act of 2009

(2013). 4Environmental Protection Agency,

Showerheads (2015). 5Environmental Protection Agency, Water:

Polluted Runoff (2015). 6I. Fatima, M. Fahim, Y. Lee and S. Lee,

The Journal Of Supercomputing 66,

(2013).

7V. Vujovic and M. Maksimovic, Raspberry

Pi as a Sensor Web Node for Home

Automation (2015). 8J. B. Evett and K. N. Kähler, Water

Conservation (2015). 9IHS Engineering360, Solenoid Valves

Information (2015). 10J. P. Smith, Use a DIY Pressure Plate

Switch to Automate Your Haunted

House (2013). 11Home Water Works, Showers (2015).

Page 12: Utilizing a Raspberry Pi to make your Home Smarter · 2020. 2. 18. · 3.3 Raspberry Pi & Home Automation The Raspberry Pi is a microcomputer that is capable of interacting with the

9. APPENDIX

9.1 Calculations

Flow rates

1 2 3 4 5

Flow rate without Eco-Shower (mL/s) 0.4819 0.4914 0.5479 0.5013 0.4464

Flow rate with Eco-Shower (mL/s) 0.3431 0.3521 0.4274 0.3960 0.3431

Percent difference 28.8% 28.3% 22.0% 21.0% 23.1%

Average percent difference between flow rates = 24.6%

Calculating flow rate:

f, flow rate (mL/s)

t, time (s)

𝒇 =𝟐𝟎𝟎

𝒕

Example (trial 1):

𝑓 =200 mL

415 s= 0.4819 mL/s

Calculating percent difference:

fwithout, flow rate without Eco-Shower

fwith, flow rate without Eco-Shower

p, percent difference between flow rates

𝒑 =(𝒇𝒘𝒊𝒕𝒉𝒐𝒖𝒕 − 𝒇𝒘𝒊𝒕𝒉)

𝒇𝒘𝒊𝒕𝒉𝒐𝒖𝒕× 𝟏𝟎𝟎

Example (trial 1):

𝑝 =(0.4819−0.4914)

0.4819× 100 = 28.8%

Calculating flow rate with Eco-Shower:

U.S. maximum flow rate = 9.50 L/min

p, percent difference between flow rates

w, the original flow rate

n, new flow rate

𝑛 = 𝑤 × (1 −𝑝

100) = 9.50 × (1 −

24.6

100) = 7.16 𝐿/𝑚𝑖𝑛

Page 13: Utilizing a Raspberry Pi to make your Home Smarter · 2020. 2. 18. · 3.3 Raspberry Pi & Home Automation The Raspberry Pi is a microcomputer that is capable of interacting with the

9.2 Code for Raspberry Pi

Page 14: Utilizing a Raspberry Pi to make your Home Smarter · 2020. 2. 18. · 3.3 Raspberry Pi & Home Automation The Raspberry Pi is a microcomputer that is capable of interacting with the