Imagine a world... with toilets that illuminated.
The impossible has become a reality with the Asstron 3000. If you have ever used the bathroom at night, you know what a leap this is for mankind. To make your dreams come true, just follow the few simple steps of this project.
Using a simple PIR sensor for motion detection, two LED light strips placed within the toilet bowl can be illuminated upon entering the bathroom. And that's not all, the LED strips are equipped with a color change wheel located near the toilet so that the mood can be set for any sort of midnight pit stop.
The PIR Motion Circuit
This circuit is very simple involving only a PIR sensor. Connections include a ground, the Vin 5 volt power source, and finally to an analog pin A1. When motion is sensed, the sensor sends a full voltage signal to pin A1 which reads an analog value of 4095. The Motion Detector Code will examine the analog value and determine whether motion is detected or not. The resulting determination (motion or no motion) is sent to the other particle using a publish/subscribe system. The code will run in a continuous loop until motion is detected, and then a delay of about 7.5 minutes will occur. Since motion triggers the lights, they will stay on for 7.5 minutes once triggered (because we like to take our time on the throne). This circuit was placed right underneath the bathroom sink cabinet near the door, this way, as you walk into the bathroom or open the door motion is detected.
The Relay Circuit
This circuit is used to accept the data sent from the PIR circuit and translate it into the switching of a SPDT relay. Two small 12 volt batteries are used to power the two LED light strips inside the toilet (The large black rectangle on the side). They are connected across the "switching" tabs on the relay. Therefore, when the relay is triggered, the circuit is completed, allowing the voltage to pass through the color wheel controller and into the LED strips within the toilet. The relay will remain in this triggered position for a set length of time (7.5 minutes) due to the previously discussed publish/subscribe system within the code. This circuit was placed underneath the bathroom countertop using the sticky back of the photon breadboard.
Graphing
In this project, we used Ubidots to track motion in the bathroom. Using an analog pin on the Relay Circuit, data was sent to Ubidots. The A2 pin was directly connected to one side of the coil on the SPDT relay. When the coil was energized (due to detected motion), the A2 pin would receive a value of around 4000. Ubidots collects data every second using the values in our code, but this could be set to a longer period and still produce good data. Ubidots can be set up online to produce a graph that you need. The graph shown is only for a few seconds and isn't too exciting because the only data received is either 0 for no motion, or around 4000 for motion. We also set up Ubidots to send Ben a text message any time motion was detected in the bathroom. This way, he could tell when Robert was using the bathroom at any given time. A screenshot of the text message can be seen below.
The LED Strips
There are two LED light strips stuck to the underside of the toilet lid. They are wired around the toilet to a conveniently placed color wheel. This color wheel is the best thing since sliced bread. RED, GREEN, BLUE, AND EVEN DIFFERENT MODES!!! Folks, it really is unbelievable. Just a turn of a knob and you can set the mood for a bathroom break you'll never forget... well, maybe not that great, but it still beats the dark. Next time you wake up at 1:00am with an urge for going, don't turn on those dreadful lights, just make your way into a perfectly lit bathroom. Do yourself a favor... Go forth and build yourself the Asstron 3000.
Comments