Safety first
In this chapter, we will be using a device plugged into the mains electricity (usually AC)—a fan. We will also be cutting the cable that connects the fan to the plug socket. This cable will be run through our relay circuit.
It is important to remind you at this point that working with mains electricity is dangerous. You should attempt the fan portion of this project and hooking it up to your Heating, Ventilation and Air Conditioning (HVAC) system only if you feel 100 percent confident in your ability to safely attach the thermostat device to the mains.
It is also important that you select the correct relays for your electrical system. For example, attempting to use a 130V AC relay on a 240V AC electrical system can result in melting your device or something worse.
Depending on your country of residence, the mains voltage can be between 110V and 240V. Before attempting this project, we recommend reading up on your electric system.
Note
Wikipedia provides an overview of mains...