Do you want to control your appliances at home like electric fan? Controlling the power of your stereo or any electronic computers in your room? Then you may consider using the relay module. The relay device is a switch that can control the higher voltage devices by applying an input 5V voltage to relay. The relay is electrically operated by an electromagnet that act as a switch, where it magnetized or pulls a contact when a 5V source apply into to this electromagnet.
As you can see the figure above, the relay can accommodate a maximum of 250V AC with 10A or 30V DC with 10A. The relay module has three pins from one side, dedicated for the external appliances connections (NO, NC, common), and another three pins from another side, for Arduino connection ("S", middle, and "-"). To control your appliances (a 220-volt appliances), you may use or cut one of its wire and connect the one end to the normally open (NO) pin and the other end to the middle (Common) pin. The normally close (NC) is normally not used, unless you want to power-up your appliances if Arduino is not working or turned off.
Warning: Make sure that you follow the instruction and you know how to use and connect the 220 wire to the relay device that I explained.
Sample code for Relay module
Upload the code above and check the relay module if it is working. The appliances should run for 1 minute and it will run again after 30 seconds. Enjoy controlling your appliances!