Arduino + Web Control + Relays = Home Automation

Hey guys, I've been planning this project for a while. Just been waiting to buy my own house and do it instead of in an apartment.
The plan is to use the Arduino with lots of relays to control 110v stuff. Also everything will be web controlled. Just want to throw the idea out there, see if anyone has any good idea about implementation. I've seen a couple of different methods on this, but I need something reliable and decent response speed.

First Method:
Arduino + Ethernet shield... this will limit the HTML size, so it wont look so nice... and I wont be able to control a lot with it.

Second Method:
Arduino plugged into a home server... I have successfully linked the Arduino with C# before, so it wouldn't be too difficult to implement a web based client/server to control, but the speed will suffer because I cant seem to get the response from C# to Arduino fast enough.

Third Method:
Arduino and Python... I dont know much about Python, but from examples it seem easier and faster?

I will be using the Arduino Mega, because I'll need plenty of pins. So the ethernet shield wont work with it easily... so that's something to keep in mind.

Projected Outcome:
I want to be able to connect my phone to my home wifi, then go to the "home server" mainsite, it'll show different controls for the house, by different rooms. Each room has different functions... like lights and such. The main "Home" site will have the security features as well, because it will be running my security system as well.

I think it's plausible, just need some help and inputs. I will make a nice work log of everything from research to implementation to part list for others. Thanks!

First Method:
Arduino + Ethernet shield... this will limit the HTML size, so it wont look so nice... and I wont be able to control a lot with it.

Why? You can do the basic html on the arduino, and host a CSS file somewhere else to handle the layout. And why won't you be able to control a lot with it? You should be able to control the same things as with the other options.
You could even use an external host to handle the entire page, and you then just call the arduino with the commands, it could be like http://domain/room1/light11 to turn the light 1 in room 1 on and http://domain/room1/light10 to turn the same light off again.

You could even do that hidden so no one would be able to look at the source and then get the right links.

<?php
      include_once('http://domain/room1/light11');
?>

No one would know the url it is actually accessing, but it would still work, and you would be able to put password protection on if you wanted to too.

Ive been thinking about doing something similar, and haveing recently bought my first house (yay) I'm itching to try it. Im not great with electronics however, what relays would you use? and how would it be different if it were 240v (uk)

If I should turn a normal 230V bulb on and off, I would just use a solid state relay (because I got a handfull of them). But if I was to buy some relays, I would just get some 5-12V and then connect them like this Arduino Playground - HomePage

Thanks!! That was really helpful.

I guess I will be running the Arduino Mega with an ethernet shield.
The website will be fairly simple, and I am not too worried about the security since it's not going to be "online" per say, it's just in the network, so you'll have to be on the network to control the house.
Maybe once I get that working then I'll take it online and see if I can remotely control my house :-P.

I will be using 5v relay so I can use the same power supply as the Arduino, or 12v relay, one or the other. 12v would probably be easier since I can just attach it to a car battery and have that on a float charger so that I'll always have power even during power outage. The system will be controlling solenoids to lock and unlock doors as well, so I would appreciate the back up power.

Does anyone know if CAT5 cable can carry 12v power? and what the limitation would be? or 5V? Because I am replacing all the switches with relays and push buttons, which will be plugged into the Arduino.

My workblog will be here:

The system will be controlling solenoids to lock and unlock doors as well, so I would appreciate the back up power.

You want to make sure you don't wind up locking yourself in if your house catches on fire.

All cables can carry 12v, the question is how much current you want through it.

I guess I will be running the Arduino Mega with an ethernet shield.

I read somewhere else that the ethernet shield isn't compatible with the Mega. I didn't really pay attention because I don't have a mega, but you might want to look in to it.

Does anyone know if CAT5 cable can carry 12v power?

Power over Ethernet runs at about 40v (if I recall correctly) so 12v should be fine. I've no idea about voltage drop over distance though.

I read somewhere else that the ethernet shield isn't compatible with the Mega. I didn't really pay attention because I don't have a mega, but you might want to look in to it.

I saw something about that too, but I think it 'just' required a manual reset to work every time. But that would be a pain too.

The mega just need the 4 pins 13-10 bent out from the shield so that it's not connected, then run jumper cable from those four pins to the 51-54 pins. And have to swap a couple lines in the IDE for it to work. But I dont recall reading anything about resetting it everytime.

I ordered the Seeeduino mega instead, because it offers more i/o pins than the Arduino Mega, and it should work the same and still work with the Ethernet shield. Hopefully it'll get here soon, I cant wait to try it!

just as a reply to post #2 i dont have a great html page on my arduino just a error msg and a redirect to the original page

I use a *.php page for the forms and visual stuff (you can host a server on a old pc and connect it to your LAN)
and send the strings in an GET or POST form to the arduino that the only has to act accordingly and trow the browser back after a second so the arduino can process it.

(i prefer GET over POST since you can see what is send in the link :P)

P.S. i used Xampp for a while. it works great.
i now use my own rented server.

I'm so gonna do this when i buy a house! :stuck_out_tongue:
bedroom with PWM light :stuck_out_tongue:

friend of mine has to rooms (live's with his parents and got two rooms because his sister moved out)
he made the curtains close and light dim with the push of a button.
he uses the room to watch movies :smiley: on his beamer.

wanted to post this on your blog but woun't let me...

just a thought you can controll your heating system to since most cases its just a switch that turns the heater on or off. open up your temp. controll and try it out with cousion...
read the termostat's product discription.
since you already plan to install temp. sensors you don't really need a termostat.

Maybe a Ip camera can be used to monitor the front door so YOU can open the door using your smart phone if you get a call and your not at home

btw if you controll your house security
have a backup microcontroller with the program just in case.

as my dad is a fireman I recommend using heat, gas ,and smoke sensors. or more easy one that has it all. not just smoke.

keep me/us updated
would love to see the result.

BTW title should be 'Arduino Domotica' since thats what the call it.

SaSaa

Thanks for the tips on XAMP!!! I love it. Simple and pretty easy to set up. I was going to set up an apache server and then configure all that other good mess, but this is a all in one package!

I will be using RFID key tag for door security, so I can give people acccess to the house when I want, and that's a good idea on the IP camera as well!
Thanks!

There will be a back up system that unlock all door on a 12 volt car battery on float charger that will be monitoring the smoke detector, water and temp sensor as well.

I will definitely have to look into the heater and AC control.

Power over Ethernet runs at about 40v (if I recall correctly)
so 12v should be fine.

Not necessarily. The eariler point remains at the heart of this... it depends on the product of the voltage and the current you need (volts times amps). For a start. Other issues come into the picture too. What do you want to power with the 12v?

Locks/ fire safety/ hassle factor:

If you have an electromechanical strikeplate to let people in, and a knob on the inside and a tradtional key for withdrawing the tongue of the lock when the strikeplate isn't working, you have most bases covered.

As for IP camera and several other issues.... see....

FarWatch system....

(If you like that, please click the "StumbleUpon" button, at the top of the page?)

There's an active FarWatch site at...

http://mon277rr.dyndns.org/

really wanted to do this a long time so that's why have alot of ideas :stuck_out_tongue: and time to think it out :smiley:

I'm in the beginning stages of doing this exact thing. Ordered the Ethernet shield already. If I need more pins than the arduino has i'll use shift registers.

Keep us posted!

Me too!! I've collected TOO many toys and ideas for this project already.

But go ahead and give me more ideas and comments!!

I know everyone who has ever owned an Arduino or messed with automation has pondered the possibility... so give all your thoughts! I'll try to put as many of them into effect as possible!

I've been thinking about this too (doesn't everyone).

When it comes to ethernet shield interraction I've found it easier to have the arduino poll a web site. I've got a local web server (I have a QNAP NAS box that does web server as well as being NAS), and my arduino polls a website for instructions every time it's idle. The web server is built to handle multiple threads, whereas my arduino is going to get confused if multiple requests come in at once.

I've also thought about having an arduino per room or per pair of rooms, so I'm not trying to do too much on one arduino and it'll simplify the wiring.

I got myself a couple of smart card sockets and ten smart cards so I can do door access. I'm renting at the moment though, but I want to buy mainly so I can do stuff to my house that I can't when renting.

Here's a post to the rfid door unlocker I was doing.

http://jrowarduino.blogspot.com/

I haven't installed it yet because I want to change it a bit.

It has begun. Parts started to arrive today.

I will start programming and prototyping soon.

Follow and comment :stuck_out_tongue: