The aim of this project was to set up the arduino server so that it could turn the power on and off in my house.
Long story short the Ethernet shield is connected to a relay which turn a plug on or off. The electronics was built
in to a nice wooden box to avoid electrical shocks by mixing up 230V and 5V. The arduino is powered from a 7V DC supply.
The Arduino is placed on top to make it easy to extent with a light sencor or stuff like that.
Below is shown a video of the system with the lamp in my living room.
The schematics for relay and driver are shown below.
And the wooden box
The code for the arduino is a slightly modified version of the web server sketch. Since I had a lot of
problems making a helloWorld example to work, I have written the steps to find the right IP down here.
The scource code shown below can be downloadet here.The original code from the Arduino libary
can be found here. When the code is run the browser will show a window as shown below.
The code is written so that it displays different pages according to the URL. I could not find any good examples on the internet for this so I
made some string magic to extract a give page request. The request triggers different IF centeses. If the reguest is 192.168.0.177/ON the code
for the switch will be triggered.