Hardware and software requirements
Let's first see what you will need to create this project. Similar to many other projects of this book, this project is based on the Arduino platform, and we will once again use an Arduino Uno board. Note that an Arduino Mega board will work as well.
Then, you also need some relay modules so that you can control the lamps. A relay is basically an electromechanical switch. They are usually used when you want to command a high voltage device (for example, a lamp plugged into a wall socket) with a much smaller command voltage (for example, the 5V of the Arduino board). For more information on relays, you can visit the following web page:
http://en.wikipedia.org/wiki/Relay
For this project, I used a 5V relay module from Polulu that can handle up to 250V (thus supporting 110V and 230V devices) and a maximum of 10 A. The following image displays the relay module:
I used two of them, as I want to command two lamps from my Arduino board. Of course, the project...