The circuit I used is not uncommon, many examples in the internet will show you how to wire a relay circuit.
The basic of the project is use a microcontroller digital output to supply 5V into the coil of an AC relay.
A relay for those who are not familiar is a device that has contact that can close or open based on the current flowing in a coil in the relay.
A picture of a relay is included.
This custom AC Outlet will be used to drive a water pump that will be turn on or off based on the soil moisture level.
Materials you need for the relay shields and moisture sensor:
1. Typical household AC outlet. I use a single outlet, you can use double outlet.
2. A box that this outlet usually go to. I am not sure exactly what they are called but your hardware store electrical section will sell this about 25 cents.
3. The cover for the single/double outlet.
4. A SPDT relay. Mine is a general purpose with p/n Z2560-ND G5LA-14 DC5 Omron. I bought it from Digikey.
Pay attention to make sure your relay contacts are rated for A120VAC operation and can carry high enough current (amps) to operate whatever you will plug into this customized outlet.
5. A diode. Part number 1N4148. Again from Digikey.
6. A used AC power cord cable from old device/equipment that you don't need anymore.
7. A couple small terminal blocks, not required but nice to have it.
8. Some heat shrink tubing.
9. A couple transistors (NPN 2N3904)
10. 2 metallic screw drivers
11. Some wires
12. Old milk or juice plastic container.
13. A water pump. I use an old indoor water pump.
14. Some plastic tubing and converter if the plastic tube does not go into the pump outlet just right.
Total cost ($5.00-$10.00).
Tools you need :
1. Soldering iron
2. Wire snipper
3. Helping hands