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
Content Rating
Is this a good/useful/informative piece of content to include in the project? Have your say!
You must login before you can post a comment. .