Go Down

Topic: Arduino + Web Control + Relays = Home Automation (Read 39076 times) previous topic - next topic

vinhtvu2

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!

bld

#1
Jul 05, 2010, 06:40 pm Last Edit: Jul 05, 2010, 06:44 pm by bld Reason: 1
Quote
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.

Code: [Select]
<?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.
captain-slow.dk | non contagious!

brucedjones

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)

bld

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 http://www.arduino.cc/playground/uploads/Learning/relays.pdf
captain-slow.dk | non contagious!

vinhtvu2

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:
http://vinhworkblog.blogspot.com/

zoomkat

Quote
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.
Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.

bld

All cables can carry 12v, the question is how much current you want through it.
captain-slow.dk | non contagious!

CowJam

Quote
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.

Quote
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.

bld

Quote
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.
captain-slow.dk | non contagious!

vinhtvu2

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!

SaSaa

#10
Jul 07, 2010, 11:57 pm Last Edit: Jul 08, 2010, 12:04 am by sasaa Reason: 1
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! :P
bedroom with PWM light :P

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 :D on his beamer.

SaSaa

#11
Jul 08, 2010, 12:19 am Last Edit: Jul 08, 2010, 12:22 am by sasaa Reason: 1
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

vinhtvu2

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.

tkbyd

#13
Jul 08, 2010, 09:24 am Last Edit: Jul 08, 2010, 09:24 am by tkbyd Reason: 1
Code: [Select]
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....

http://www.arunet.co.uk/tkboyd/offers2fwover.htm

(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/

SaSaa

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

Go Up