Arduino + Ethernet Shield + X10 =\ Home Automation

Hey guys, here's my home theater / home automation project...

I'll edit this main post with new videos, work logs, and all that goodies.

So far, here's the project layout and progress:

This is just the beginning of the write up and project... Already have parts and plans for a lot more... that's why I got a Seeeduino Mega... lots of extra memory and pins.

Plans:

Internet Controllable Thermostat that records and log temp (theory and implementation researched, harvesting parts)
Temp sensors for all my pet pythons and other reptiles (pending wiring)
Complete movie theater control with IR blaster and other curtains and lighting (in progress):
Multi-zoned speaker set up, using relays to switch power on/off to different AMPs. (two zone completed, pending parts)
Security System w/ Email Alert and Video Tracking (theory and implementation researched, pending wiring).

Youtube Video Progress:

Light Control and Movie Theater Curtains Automated Video

Hi! Very interesting your project!
Have you thought about a software to control all functions?

No software required. That's the beauty of it... I'm running it all on HTML using the ethernet shield to host the web browser...

Ofcourse if I want to further the features, I'll re-visit PHP and MySQL server on my homeserver... then I can have a database that keep record of temperatures and all that... that's the next step, to add the AC control and central heat and air directly into the system and bypassing the thermostat.

Very cool, Looks great.

What is the Arduino board you are using?
More to the point, I guess I'm asking how big does the AVR need to be for the Ethernet/Web page side of things?
Mega328, Mega128 ????

Also, how are you interfacing the Arduino to the X10 powerline stuff? Via a serial connection?

Neil.

vinhtvu2:
that's the next step, to add the AC control and central heat and air directly into the system and bypassing the thermostat.

Make sure you test the heck out of this - I'd hate to pay the power bill for a couple of days where the heating and AC were fighting with each other :wink:

Haha, it's been in the testing phase for three months!!!
Still trying to find the appropriate relays to work for the 220v wall unit for the movie theater room... but the central heat/air is working pretty smoothly.

As for the Microcontroller, I'm running a Seeeduino Mega, which is pretty much the same as a Arduino Mega 1280. I will probably upgrade to the Mega 2560 soon since I will need more memory. I'm already using up 13K of memory on the Mega with just 4 lights and the code for the curtains. Ofcourse, it's not optimized, a lot of redundant coding that could be broken up into functions. But the project is growing and HTML takes a lot of room... Hopefully the 1280 will be enough once I optimize the codes.

I originally planned to use the mega because of the extra pins since I was going to use solid-state-relays to control the lights. Bought 40 of them too... expensive. But it was SUCH a pain to wire them in... and how to run them parallel with switches so the switch can still be used... couldn't figure out the implementation. So I switched to X10 and never looked back. It was much simpler, and easier to configure and no wiring required. It work with very small delay, and is pretty reliable with a repeater and a 2-phase bridge. The X10 transceiver I'm using is http://www.x10.com/products/x10_tw523.htm. Now I just need to buy more X10 modules.

That's a very nice project indeed! I have a similar project running (just some leds on a breadboard though) but i cant get the HTML to work neatly. I have similar functionalities to you project but it seems that you're able to display the state of the lamps before the page refreshes. Do you use a get command for the radiobutton like 'www.[host].[domain]/80' or something alike? When I push the buttons used for controlling the leds, I need to meta refresh the page to redirect it to '/' root. Else the page won't display the actual states of the leds.

Could you maybe post or mail me the code you used for the project?

I'm looking forward to you reply!
Best regards,
BoomTakZaag

What I did, is use a boolean value as a flag for each of the light. Depending on the state of the boolean value for the light, it displays different color for the button, making it the status. Ofcourse this is only in the Arduino and does not reflect the actual reading in the light itself. Because X10 receiving is pretty slow, I didn't want the website to wait for the arduino to read all the X10 state first before opening up the page. Since using the interface is the ONLY way to turn on/off the light, it'll always be in sync with the boolean value.
If I use the hardwired X10 remote control to turn on/off the light, then the light will be out of sync. The work-around I used for this is to use designated control for turning on/off the light instead of "toggle" it on/off. This way, if the light is OFF, but the Arduino thinks it's on... all I have to do is turn it "off" on the interface, then the arduino will issue X10 command for off... which the light will ignore since it's already off. Then it'll be back in sync, so the next time I press the button, it'll turn on. This way, if it ever get out of sync, I press the button twice, and it'll sync itself back up again.

As I add more lights, I'll create an Array instead of different booleans... that way I can save more light, and simplify my codes. Also need to create a method that will generate the buttons and another method to take in the toggle commands so I dont use up so much memory of the Arduino.

My sketch is on my FTP server:
ftp://vinnievu.com
Username: User
Password: Password