Author Options:

How to build an Arduino controlled 120VAC relay with an indicator LED? Answered

I am working on a project where I am going to collect grey water under my sink and use an Arduino to run two relays. One relay will turn on a pump that will move the water in the reservoir to the tank of the toilet. The other relay will turn a valve connected to the municipal water supply of finish filling the tank if necessary. The float valve in the toilet will make sure the water does not overflow.

Does anyone see any problems with the circuit I have built? I am new to electronics and cautious as I bridge the gap between my 5v world and the 120v world beyond.

Thanks for any help you can provide.



There are two ways to do this, with low voltage coil relays driven by the arduino via a transistor, and directly, with a "triac".

There are loads of example circuits of the first case, like this one.


And the second case.

https://www.instructables.com/answers/Triac/ - in this one, your arduino drives the led on the left, via a resistor - try 180 ohm

Thanks Steveastrouk! I have a lot to learn about electronics as evidence in the error in my circuit, and my confusion when looking at the diagrams of both of the options you linked to. I need to learn more about transistors, and about using Ohm's Law to figure out what parts I need. There is so much to learn, and I am enjoying it. Thanks again for your help.

You could do this without a micro-controller.

Have a mechanical switch wired to the float-valve in the toilet-cistern, this is your main on-off switch for the pump.

Run the grey-water into a sump with an overflow and another float-valve. Fit another mechanical switch wired to that float-valve which cuts the pump if the grey water runs dry. If you control a solenoid-valve in the same way you can stop the mains supply to the toilet-cistern when the grey water tank isn't empty.


The design you described was very close to my original idea. I then thought of using many sensors so the program would only initiate when the water levels where in respectively useful positions. Then the idea of using a pump and a sprinkler valve on timers controlled by the Arduino evolved.

As a novice, It's simplicity is what won the day for me. Also this removes the main line power decently far from the water sources. Thanks for taking a look at my question.

Three switches, or one single and a double. The microprocessor would be wasted.