AVS › AVS Forum › Audio › DIY Speakers and Subs › DIY Home Automation
New Posts  All Forums:Forum Nav:

DIY Home Automation

post #1 of 14
Thread Starter 
After evaluating the cost of several Home Automation products, I came to the conclusion that I could make my own for a mere fraction of the price.
$60 low-level hardware vs $3000 (or more) big-box stuff.

I was thinking of coding my own software for a DIY Home Automation based off of relays, such as this, for my new home theater.
https://www.sparkfun.com/products/9669

These are 5V relays that are USB controllable.

These would control larger relays up to whatever value... say 30amps.

I'm a professional programmer, so coding interactive webpages and serial-controllers DLL's are no problem for me.

The only challenaging part would be finding a corresponding USB device for digital-varisting capable of 120v support up to say 5 or 15amps.

My Automation system would lack all the fancy RF-wave and video switching stuff, which I don't care about.

I should be able to do remote IR controlling as well, I'm almost 100% sure of that.

Thoughts?
post #2 of 14
It depends on what you intend to do with relays. I have built many 120v dimming relays (well, triacs) using DMX and RS-485, which will support much longer runs than USB.

However, all it does is give you dimming. I use them outside for Christmas lights. I wouldn't be keen on installing DIY 120v stuff inside my home.

I suppose you could use the USB relay to power the coil on a 120v ice cube relay, at which point you would at least have a UL listing on the 120v portion. THere are plenty of communities out there for this kind of thing.

Tim
post #3 of 14
Cool idea, and that is a cool little toy!

I'm looking into the Z-wave based options for my upcoming renovation. There look to be a lot of control options for that, some are actually FOSS.

Since this is appliance-level hardware (in other words - it should just work), I'm willing to spend a bit more and get something that I don't have to mess with or code a whole backend for.
Edited by lilmike - 2/8/13 at 5:24pm
post #4 of 14
Thread Starter 
I'd want security, lighting control and power management all from a single interface on a touchscreen tablet.
For now, it will be limited to my theater. With the possibility of an intercom system between that and the kitchen (which could be a stand-alone system).

For the app interface, I was thinking of a floor-plan overlay design for device selection, and/or a text drilldown tree-list by category.

1) Lighting control: Support for up to 8 light-zones, with at least on/off capability for all 8, but preferably including 4 dimmer zones with support of up to 400watts on each.
2) Power management: Being able to cycle 16 power devices with variable delay and with timer options, all independently and/or in various clusters of user-defined modes. Supporting both 120v and 240v up to 30amps.
3) Security management:
a) Keyless entry, with network lock/unlock. Preferably Biometric or maybe a combination, RFID proximity and/or key code.
b) Support for 3 IP camera HUD. Preferably with tilt/zoom and night-vision.
c) Motion Sensor Alerting

Future Capabilities:
4) Media controller (audio at least)
5) VOIP or Skype/Facetime etc

So I need 24 high-powered relays, 4 fuses and high-powered triacs, one heck of a PC breakout box, and probably a 10 channel gigabit/11g/n router.
All of this for as cheap as possible of course...
(damn, I might as well go with a full Crestron system or something frown.gif)

The problem isn't the software for me, it is in finding good controller-hardware, either wired/wireless for cheap. Preferably USB, Eithernet or 11g.
I wonder if something like the X10 breakout controller drivers are proprietary closed-source or open or well documented at least? confused.gif
post #5 of 14
Thread Starter 
For $140, I found a 24 channel RS485-over-USB controlled relay system. The cheapest I've found yet...

With my own software this would solve all of 1 & 2, except for the computer-controlled dimming part of the lighting.

I'd still need to connect these low-ish powered relays to high-powered relays as these aren't designed for Lab clones and multi-hundred-watt lights,
which is no big deal. I'd slap that into a DIY box with NEMA inputs and outputs to make it all clean of course (no exposed high-voltage wiring LOL).

The cool thing with this solution is that it isn't wireless, thus it remains absolutely secure; teenaged hackers can't turn my gear off via RF signals from their mom's basement LOL. (Unlike X10 etc...)

I'm not even going to worry about features 3 through 5 until the first two are fully solved. That's why I went down this rabbit hole to start with after all...

http://www.ebay.com/itm/USB-RS485-24-Channel-Relay-Board-controller-/280583706515?pt=LH_DefaultDomain_0&hash=item4154179793
post #6 of 14
I'm doing my apartment/HT automation with a set of networked Arduino Mega2560 and have just received a Raspberry Pi which I'm planning to use as a display interface. Arduinos come with all sorts of shield modules so you can wifi or Xbee somewhere you can't get wiring directly.

Search ebay under 'relay boards' or 'relay modules' and you'll see plenty of them that will handle 10A at 120V. Above that you're going to need to find something else. I use MCP23S17 port expanders driving ULN2803 octal darlington drivers and Omron G4a relays because they meet my specs (20A at 240V, 80A surge) and I got a tray of 50 for under a $1ea new.

I set it up this way because I don't want a PC on all the time. And because it was a fun project and got me back into embedded design after a long hiatus. Much as I loathe C, it makes life a lot easier than assembly, but it still sucks compared to Forth.
post #7 of 14
I am sooo green when it comes to the home automation stuff that is out now as it seems to get more complicated by each passing year. So let me get this straigt, you are using relays, (which are basically just switches that turn some on & off, right?) to control when the lights come on, accompanied by some dimmer switches for the level of light. Then you are also going to be using relays for turning on your equipment, something like 16 different components, right?

I have absolutely no idea what you will be doing for security management, but I am guessing that you will have hi tech cameras that will monitor everything....not sure how you are going to operate those? Also what kind of devise, or software will the security cameras feed the video into, and how do you propose to monitor this video? Also with regards to the security system, are you going to have window breakage detectors and motion sensors, and if so, how do you plan to operate and manage those with regards to how all of this fits together?

Are you writing the software for a DIY home automation controller, similar to a Creston? If so, how and what are you going to use for the hardware? If not, are you going to buy a controller like the Crestons that so many folks use?

What is a high powered Triac and what is its purpose? What is a PC breakout box and what is a 10 channel 11gig router? Sorry for all of the dumb questions but I will be remodeling a house soon and would like to have some sort of home automation like you described, and like I said, I am totally green on this!
post #8 of 14
I'm not sure who you are asking these questions, so I'll assume me in part and reply.
Quote:
Originally Posted by Martycool007 View Post

I am sooo green when it comes to the home automation stuff that is out now as it seems to get more complicated by each passing year. So let me get this straigt, you are using relays, (which are basically just switches that turn some on & off, right?) to control when the lights come on, accompanied by some dimmer switches for the level of light. Then you are also going to be using relays for turning on your equipment, something like 16 different components, right?
I am using relays, both for power selection and control in the HT and some house functions, such as lighting in the theatre room. For example it is programmed so that when you press Play on a selection that uses video, the room lights will dim, and will ramp up when you press Pause or Stop. If I selected TT as source, none of the amps etc that run the surrounds (tri-amped) will be powered up. All power switching is done close to zero cross accounting for relay delay.

The plan is later to add mains outlet control and lighting through the rest of the apartment as I find time and need to do so. I have a friend who has build a similar system in his home, and when he's not there, lights and other devices such as radios turn on/off in a correct sequence to simulate people being there, and I'd like to add this later.
Quote:
Originally Posted by Martycool007 View Post

I have absolutely no idea what you will be doing for security management, but I am guessing that you will have hi tech cameras that will monitor everything....not sure how you are going to operate those? Also what kind of devise, or software will the security cameras feed the video into, and how do you propose to monitor this video? Also with regards to the security system, are you going to have window breakage detectors and motion sensors, and if so, how do you plan to operate and manage those with regards to how all of this fits together?
I'm doing PIR and window break, and am looking at some inexpensive commercial systems to do video. My own stand alone system will call (and later ) email if it detects. Not sure if I'll be able to integrate the two bet they might not be necessary. We'll see.
Quote:
Originally Posted by Martycool007 View Post

Are you writing the software for a DIY home automation controller, similar to a Creston? If so, how and what are you going to use for the hardware? If not, are you going to buy a controller like the Crestons that so many folks use?
Can't afford a Crestron, so I'm basically making a DIY on that does what I want, some of which is highly specific to my my particular set up and equipment, some of which is modified to suit my needs. Total cost for everything should be under $500, plus a lot of coding and soldering, but I enjoy that anyway.
Quote:
Originally Posted by Martycool007 View Post

What is a high powered Triac and what is its purpose?
A triac is a solid state switch which can handle alternating currents, making it suitable for controlling the mains on many devices. They are also sued in some dimmers for lighting. High powered would mean one that can handle mains voltage as well as the current that the load you wish to control will draw, say 5 or 10A. Some can handle considerably more current.
Quote:
Originally Posted by Martycool007 View Post

What is a PC breakout box and what is a 10 channel 11gig router?
PC aren't natively suitable for controlling ancillary devices such as relays, so that need some sort of interface to connect to the PC via USB or RS232. These usually then let you control say 24 relays or other devices. These are used in many industrial applications worldwide.

I've never heard of a '10 channel 11gig router'. 10 channel I assume means 10 RJ45 ports but this is an uncommon configuration. Routes/switchers etc are usually in a multiple of 8 ports, 8/16/24/48 and small home/SOHO versions have 5. 11gig might refer to one of the common networking protocols 802.11g. There are faster variants such as 802.11n. Go with the fastest you can afford in a new installation to allow for longest life.
Quote:
Originally Posted by Martycool007 View Post

Sorry for all of the dumb questions but I will be remodeling a house soon and would like to have some sort of home automation like you described, and like I said, I am totally green on this!
If I was with you in person and had the floorplans and could ask questions about what you want to control and how, whether you want to use a single server and route all TV/video through the network etc it would be easier to make suggestions. FWIW I'm licensed to do this sort of work in my country.

My basic plan is to add at least one Cat6 cable and port to each room, and depending upon the room and it's use and possible uses later, I'd likely add more. You could always bring say 4 cables from each room to a central point with the switch(es) placed there and connect up the outlets you are using now. Rearrange the living room in 5 years might mean a point on the opposite wall is more convenient (no exposed cables), so all you'd need to do then is go to the 'network cupboard' and change to the correct wire. Trust me, you will regret not putting them in now when the cost will be minimal as it's easy and cheap to do before the drywall/gyprock goes up, and much more expensive later. In some cases due to the construction of the house it may be very difficult and expensive or impossible to add later without something you may not like, such as an external visible conduit.
post #9 of 14
Thread Starter 
Quote:
Originally Posted by Martycool007 View Post

I am sooo green when it comes to the home automation stuff that is out now as it seems to get more complicated by each passing year. So let me get this straigt, you are using relays, (which are basically just switches that turn some on & off, right?) to control when the lights come on, accompanied by some dimmer switches for the level of light. Then you are also going to be using relays for turning on your equipment, something like 16 different components, right?

Correct.
Quote:
Originally Posted by Martycool007 View Post

I have absolutely no idea what you will be doing for security management, but I am guessing that you will have hi tech cameras that will monitor everything....not sure how you are going to operate those? Also what kind of devise, or software will the security cameras feed the video into, and how do you propose to monitor this video? Also with regards to the security system, are you going to have window breakage detectors and motion sensors, and if so, how do you plan to operate and manage those with regards to how all of this fits together?

I don't have any glass in my theater, only doors. Motion activated sensors for video recording and alerts, should be doable, not sure about a single integrated DIY solution for that though (depends on the camera vendor).
My UPS probably has email alerts for power loss, which may also be handy (not that there is anything I could do about it though).
Quote:
Originally Posted by Martycool007 View Post

Are you writing the software for a DIY home automation controller, similar to a Creston? If so, how and what are you going to use for the hardware?
Yes. My HTPC, which is on 24/7 already.

I was thinking of getting a RAID-5 NAS in time for my HTPC as well.
post #10 of 14
Thread Starter 
Quote:
Originally Posted by A9X-308 View Post

It is programmed so that when you press Play on a selection that uses video, the room lights will dim, and will ramp up when you press Pause or Stop. If I selected TT as source, none of the amps etc that run the surrounds (tri-amped) will be powered up. All power switching is done close to zero cross accounting for relay delay.

Dude that is insane, how did you detect zero-crossing. Diagram?
I've never really dipped into the hardware-aspect of automation control before.
You must have used the Arduino chip for the relay delay, calculating the next half-wave 8ms delay or 16ms full-cycle (substracting the relay activation time of course).

Also, what media player are you using for those control hooks?
post #11 of 14
Quote:
Originally Posted by BassThatHz View Post

Dude that is insane, how did you detect zero-crossing. Diagram?
I'm not at home at the moment, but I'll post it when I get a chance.
Quote:
Originally Posted by BassThatHz View Post

I've never really dipped into the hardware-aspect of automation control before.
My background is electronics, so I approach design of a system as 'how is this easiest (for me) to do' and use a lot of electronic sub systems to augment processors. For me, that is implement anything in software that I can't do easily in hardware.
Quote:
Originally Posted by BassThatHz View Post

You must have used the Arduino chip for the relay delay, calculating the next half-wave 8ms delay or 16ms full-cycle (substracting the relay activation time of course).
That's pretty much it. The zero cross detector goes to a spare input pin on the Mega, so when it's about to open/close a relay, it constantly loops looking for that pin to change state and adds a delay to get relay operating delay plus software delay to equal 20mS (50Hz here). I tested all the relays I used for many operational cycles and averaged the delay to use for that type of relay.
Quote:
Originally Posted by BassThatHz View Post

Also, what media player are you using for those control hooks?
I'm not using a media player to implement this - it operates with no PC running.
I have XBMC but I find it easier most of the time to simply access a file and play it rather than use media players. When I wish to play something that's on a PC, I select that as a 'Source' via IR remote, which brings the PC out of sleep mode (and sets up the rest of the system) and I use a keyboard/trackball combo to control the PC.
post #12 of 14
Thread Starter 
Quote:
Originally Posted by A9X-308 View Post

I'm not using a media player to implement this - it operates with no PC running.
I find it easier most of the time to simply access a file and play it rather than use media players. When I wish to play something that's on a PC, I select that as a 'Source' via IR remote, which brings the PC out of sleep mode (and sets up the rest of the system) and I use a keyboard/trackball combo to control the PC.

A9X you don't use a computer? How then are you accessing the file-system on the drive? (AVR with network file streaming or ?)
How do you pass the h264 into an HDMI AV connection?
How does your Arduino know that the movie is playing or paused/stopped?
post #13 of 14
Quote:
Originally Posted by BassThatHz View Post

A9X you don't use a computer? How then are you accessing the file-system on the drive? (AVR with network file streaming or ?)
How do you pass the h264 into an HDMI AV connection?
How does your Arduino know that the movie is playing or paused/stopped?
There is some misunderstanding. The 'control' system of Arduinos, does not need a PC to be running. I can put a disc in the BRP and select 'Play CD' via IR RC and control the system from the RC (stop, play, change sources etc). The Arduino receives the IR codes and acts according to what it receives.

The Arduinos do not need to know whether a source is playing or not. They set up the conditions to allow it to happen and control some of the functions of the devices. If I was watching a movie from the BRP, after initial system set up, and pressing play, they are idle until the next control is pressed.

If I wish to play a file stored on computer selecting 'PC Music' / 'PC Movie' sets up the system by turning on/off power amps, projector, AVR etc and by applying the settings for that source if needed, and then I control the movie/music being played from the PC via a combo keyboard and trackball.

On the PC where I have a lot of movies and music stored, I have XBMC but it is sort of annoying, and I have no problem just opening MPC and selecting a DVD file to play for instance. I might get J River later, when I build a dedicated HTPC. Movie files from the PC are played out to the AVR via HDMI. The PC is connected to a network that runs throughout the apartment (not the garage yet though) so I can access and play files from any computer connected to the network.
post #14 of 14
Thread Starter 
Ah IR input. Gotcha!
Good idea, Why didn't I think of that? tongue.gif
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: DIY Speakers and Subs
AVS › AVS Forum › Audio › DIY Speakers and Subs › DIY Home Automation