Water is a precious resource that is taken for granted. As some of us know, California experienced a drought starting from 2011 thru 2016. One way we can prevent this is by reusing and giving clean water a second purpose. This project will focus on automating a process that is normally done by hand. In doing so I hope that more people will join the effort.
The idea came from using a bucket every day to dump unused shower water into the toilet tank. While this is effective, you take the risk of breaking the tank cover. Not only that, you have to carry the water which can get pretty heavy. With this project, the process of saving the shower water becomes simple and easy. Using the Cayenne App and an ESP8266 Thing Dev to control the flow, one only needs to press a button to save all the water.
Setting up the Cayenne AppI will assume that the Cayenne App has either been downloaded to your phone or installed on your computer. I would do both since it is a little difficult to setup the widgets on the phone app. I recommend that the basic structure be completed on your desktop. Then, you can just access the project from your phone.
If you haven't used Cayenne before, I would start by going to the documentation page for the Cayenne App at the link below:
https://mydevices.com/cayenne/docs/intro/
You will need to setup three widgets on the Cayenne Dashboard like the following:
- The System widget will control the on and off state of the whole system
- The Shower Valve widget will control the flow of water to the toilet tank
- The Toilet Valve widget will allow for the toilet tank to fill the tank using the water normally available
Two types of valves exists: latching and non-latching. The following will give a better explanation on which one is the best choice for your setup.
Using Latching ValvesI used latching valves since I had planned on having a battery setup in the future.
Latching valves need a pulse signal to activate. Once activated the valves will hold their position until a reverse polarity pulse is applied, releasing the valve from the latched state. This works very well in situations where power consumption needs to be reduced.
I have used pins 4, 12, 13 and 15 on the Thing Dev to make the connections to the MOSFET's. In the future I will add other sensors to the project and would like to reserve the IO pins for those purposes.
Each pin is connected with an N-Channel MOSFET and one relay. The following diagram shows how to make the connections.
What happens is that the relay will select from a positive or ground. This will give the valve the polarity it needs for latching into the open or closed state. The common pin will connect to one wire of the latching valve. The other wire for the valve will connect to a separate setup identical to the above diagram.
The following diagram illustrates how to connect the valve to the common pins.
Each relay is activated separately in order to control the polarity to the valve. Notice that when both relays are at Normally Closed position, the connections are both connected to ground thus the valve will not be activated. When the left relay is turned on, the polarity of the valve will be from + to - thus activating the valve in the open direction. Assuming that both relays are back to the Normally Closed position, when the other relay is turned on, the polarity will be from - to +, thus activating the valve in the closed direction.
Using Non-Latching ValvesIt is possible to simplify the circuit to just using two MOSFET's.
Non-latching valves need to keep the magnetic field on when activated which means they will consume power. If you have designed your setup with a power supply in mind, then this can work for you. It is possible to setup your board to work with a battery but you may find that you will be charging it constantly.
You can connect your valve in a similar manner to the following diagram.
I did my best to follow a color code convention, but in the end I ran out of colors. I used the white wires to connect to the Thing Dev pins. The wires connecting the Thing Dev to the white wires are routed underneath the board. These wires lead to the gate pin of the MOSFET. The yellow wire connects the circuits to the positive side (5 Volts USB) and the orange to the negative. I started using some of the orange wires to bridge the circuit between the MOSFET's and the relays. The green wire that is horizontal connects to the drain of the MOSFET while the source is connected to ground with the orange wires that are at a slight angle. On the back side of the relays are the connection to the 6 Volt power source (the battery pack).
I used what I called sticky pads (formally called mounting bases) to hold the wires and hose onto the wall of the shower. Before attaching the sticky pads to the wall surface, make sure you clean it off with alcohol or some soapy water to remove any dirt or debris. I spaced the pads 1.5 feet apart to ensure the wires do not sag. I placed one pad 6 inches away from every corner to hold the bend in place. The cable ties are initially left open to allow for the wire and hose to go through . Once they are in place, you can start cinching them down starting from the shower head. Afterwards you can cut the ends off for a neater finish.
We will first need to remove the original shower head from the shower rod and set it aside for later.
The shower valve and the diverter will need thread sealing tape to minimize leakage. Wrap the shower outlet and diverter outlet with about three to four turns of the tape. If you use too much, the coupling might fit too tight.
Next do the same with the shower valve.
Attach the brass coupling to the diverter outlet. Be careful not to over tighten on the diverter valve: since it is not metallic, it might break.
Attach the shower valve to the brass coupling. Use the crescent to hold the coupling in place while you twist the valve on.
Attach the other brass coupling to the output of the shower valve and tighten down with the crescent.
Attach the Quick Disconnect to the end of the second coupling. This will be the exit point for the saved shower water.
Attach the shower head to the forward end (outlet) of the diverter valve.
Before attaching the assembly to the shower rod, we first need to remove the old thread sealing tape: covering the old tape with new one would be pretty useless. You can use any sharp object that can get into the cracks and crevices. There is a before and after picture that will show the comparison.
Now that we have removed the old sealing tape, we can wrap the new tape onto the threads.
Finally attach the assembly onto the shower rod.
The toilet valve was not as much work luckily, as it was easy to attach the hoses in the correct places. The 3/8" side attaches to the manual valve. From there the 1/2" side connects to the toilet valve. On the other side of the valve, the other 1/2" hose attaches to opposite end of the toilet valve and finally the 7/8" side attaches to the toilet bowl. These threads will not need thread sealing tape since they contain sealing gaskets pre-inserted into the connection.
I soldered the connections of the wire to the valves. It's possible to use wire nuts and get away without soldering. I would recommend using the water proof wire nuts to make a seal. I then used heat shrink for safety and a clean finish.
The wires from the valve go to the common pins on the relay. The left side is the shower valve and the right side is the toilet valve.
Please refer to the image captioned Connection to the valve for more info on this setup.
The system is fairly simple to use. The Cayenne App that was built on the Dashboard should now look like the following on your phone:
The next sections describe how to utilize the app.
Taking a showerBefore entering the shower, make sure the diverter valve is set to direct the water to the toilet tank.
Press the shower valve button widget to open the valve. When the water starts to feel warm (you can feel the shower rod) or when the tank is full, then you can close the valve.
Filling the tank for a normal flushWhen the system is on, the toilet tank will normally be empty. To get around this situation, tap the toilet valve button to open the toilet valve. This will be a normal fill and the toilet will shut off with the float valve. Don't forget to turn off the valve from the app.
Disengaging the systemThere are occasions when you will have guest and there will be no need to have the system on since it will just be a nuisance. Simply tap the system button so that the toilet runs like normal.
Video DemonstrationSafety and precautionsSome of the directions here should go without saying but I will mention the following:
- Please wash your hands before touching any surface after using the restroom. By not conducting proper sanitation you are putting peoples lives at risk.
- Condensation tends to promote growth of bacteria and fungi. Please check periodically inside the toilet tank for signs of this as I have had the same situation.
- Some toilet tanks do not have the half-moon opening in the back like the one I have. Check your tank before embarking on the trail of using this system.
- If the toilet bowl does not have enough water, the sewer stench might creep into the restroom. Allow some water to overflow so that the bowl may fill to the water line when filling with the shower water.
- On the extreme side, if somehow the toilet tank overfills you will have a mess to clean up.
I had mentioned earlier that I purposely left out the IO part of the Thing Dev and reserved those pins. I intend to add a couple of capabilities to the project like the following:
- A passive IR sensor to detect when someone is near and automatically fill the tank
- Temperature sensor
- Automatic valve shutoff when engaged
- Data display on the Cayenne App to show amount of water saved since use
I hope to incorporate these ideas in the future time permitting.
ConclusionI hope that everyone finds this project useful and is able to spread the word about conserving water.
Comments