Back to Parent

Outcome


Context

With more and more applications and other forms of entertainment available on smartphones today, more and more people are carrying their phones when they go to the bathroom and spend way more time than needed on the toilet. This causes a lot of inconvenience to others, especially if the bathroom is shared.

Conceptual Design

This device notifies people when they spend more than a specified amount of time on the toilet by using a light and speaker system installed in the bathroom. The light gradually changes color from green to red over a period of 10 minutes, which allows the user to keep track of time. When the light turns red a speaker system starts playing a song which only stops if the user gets off the seat. The device also sends the user a notification on a phone as a warning. This encourages people to vacate the toilet as soon as they are finished using it.   

Image uploaded from ios %283%29
Show Advanced Options

Process

Our initial idea was to use a pressure sensor to detect if someone was sitting on the toilet. But we soon realized an IR distance sensor will be easier to incorporate in the design.

We started with coding for the IR distance sensor and the NeoPixel. When the IR distance sensor detects the user the NeoPixel lights up, and fades when the user moves out of range. If the user stays put for a certain amount of time the NeoPixel will transition from Green to Red. We used the following code as reference. 
(http://tronixstuff.com/2011/06/22/tutorial-arduino-timing-methods-with-millis/)

We then integrated the DF mini player and a speaker to play a sound file on activation. However we met with problems when we were coding for the speaker as it required us to use a library which we were unaware of. We later found a great way to play an audio file. We referred to the following code. 
https://community.particle.io/t/a-great-very-cheap-mp3-sound-module-without-need-for-a-library/20111.   

We also published it to the particle cloud and integrated a notification function using IFTTT. It will send a notification to the users phone to warn him that time is almost up. The issue with using IFTTT for this application is that it could take up to 15 minutes for it to poll the Particle console. Although the majority of the time it will poll within a minute, it is not guaranteed and thus is not dependable.

After testing to make sure everything worked as intended we then built a casing around the circuit board and its other components. This casing houses the speaker and the IR distance sensor as well. We then put the completed product to test in the bathroom and confirm if it actauly worked in the environment and context it was built for

Show Advanced Options
Can bb
Show Advanced Options

Part List

TF Card U Disk Mini MP3 Player x 1

Micro SD Memory Card x 1

Samsung 15318680 8Ω 1.5w+ Speaker x 1

Sharp 2Y0A02 F 69 Proximity Sensor x 1

NeoPixel Ring x 1

Photon x 1

Breadboard x 1

Jump Wires x 13

Show Advanced Options
Photo2
Show Advanced Options
Show Advanced Options
Screen shot 2018 02 07 at 10.05.16 pm
Show Advanced Options
Image uploaded from ios
Show Advanced Options
Wechatimg50
Show Advanced Options

Workflow

When the IR distance sensor detects an object within range the NeoPixel lights up in green. If the object is moved away from the sensor the light switches off again. 

If the object stays within range for a while, the green transitions to red. This happens over a course of 10 minutes. 

Just before 10 minutes elapse the user gets a notification from IFTTT telling him/her to hurry up.When the NeoPixel is completely red the speaker system starts playing a song which is stored in an MMC in the DF Mini player. 

In order to turn the sound off , the object has to move away from range.


Show Advanced Options

Reflection

Coding to link the IR distance sensor with the DF mini player, speaker and the NeoPixel was very challenging. It was a steep learning curve, but we managed to sync all the sensors and other parts of our final circuit and have them work together as intended. We adjusted the code to reduce the actual time the light would take to transition from green to red in order to make testing easier. 

In an ideal scenario we want IFTTT to send notifications instantly but as of now it takes anywhere from 1 minute to sometimes even 15 minutes. In future iterations we would like to ad a network of lights which can be placed in different parts of the house and ad additional features like bathroom occupancy detection.


Drop files here or click to select

You can upload files of up to 20MB using this form.