Hardware and software requirements
Let's first see what we need for this project. As with all the other chapters, you will need an Arduino board and the Arduino Ethernet shield.
You will also need a relay module. I really recommend using a relay that is integrated on a board, with all the required components on the board as well. It will avoid you having to build your own relay module on a breadboard, and it is also much safer. Indeed, there is no risk in wiring the relay and other components in an incorrect fashion. Simply make sure that the relay you choose is compatible with 5 V input voltage levels. Also, you have to make sure that the relay module can handle the power of the device you are going to use for this project. For example, the lamp I used was a 30 W lamp, and the relay could handle more than 1000 W, just to be on the safe side. I chose a 5 V relay module from Polulu, as shown:
You can simply use the relay as it is and control it with the code we are going to develop in this...