This guide covers mains voltage electricals.
Working with high-voltage electricity is dangerous without the right precautions.
What Is a Relay?
As electrical switches, relays open and close based on digital signals received from a computer or microcontroller board.
This makes them ideal for DIY home automation, as they work well with Arduinos and other basic boards.
This means exposing the positive power wire within its main cable.
Samuel Garbett/MakeUseOf
Of course, though, you have to unplug your rig before attempting this.
The lamp we are using already has an inline power switch on its cable.
You will have to dig a little deeper if your unit doesnt have a switch like this.
Push each side of the exposed wires into the connectors on your relay and screw them down tightly.
You need a good connection here to see to it your DIY project is safe.
it’s possible for you to check out our handysoldering beginner’s guideto double-check you solder your components correctly.
Check out the wiring diagram below.
Alternatively, you could also consider some of the ideas below to control your relay.
It starts with some basic variable declarations before initializing the button and relay in thesetup()function.
Getting Started With DIY Home Automation
There are countless home automation products on the market nowadays.