Monitoring relay contacts

Ira

Active Member
In my shop (located 150' from my home), I have three relays that are used to "monitor" various states. I'm not going into the details of what the relays are monitoring, but feel free to gusess if you want to. ;)

From a semi-dedicated PC running Vista 32, I want to be able to detect when the relay contacts change states (open to closed and vice versa). Based on the state changes, I want to be able to initiate various actions (email notification, text message, etc., with some variability in the messages) on the PC. Some triggers will be based on a single relay. Others will be based on a combination of the relay state changes over a short period of time. If the PC software polls to get state changes, it needs to be able to do so frequently, i.e., every second or two.

Some examples using relays A (normally open), B (normally closed), and C (normally closed)...

Every Monday at noon, relay A should close for fifteen minutes, then reopen. If this sequence does not happen, trigger an alert. If the sequence does happen, trigger an alert with a different message.

If relay B opens and stays open for 30 seconds, trigger an alert. When relay B closes (but only after being open for at least 30 seconds), trigger an alert.

When relay B has been open for thirty seconds, trigger an alert if relay A is still open.

If after being open for 30 seconds or more, relay B has now been closed for at least 30 seconds, and relay A is closed, trigger an alert.

Trigger an alert whenever relay C changes state, with the message containing an indication of the current open/close state.

I also want to be able to save off all of the state changes (with date and time stamps) to a file or database, so I can feed them into a graphing package for historical viewing of the state changes for each relay on the same graph.

I have an ethernet connection between my home and my shop in case there is a device that can detect the relays' contacts opening and closing and transmit them over the network to the PC. SmartHome sells a wireless relay transmitter/receiver combination that looks like it can "mimic" the relay contact state changes from my shop to my home. It looks like the "real" relay contact leads can be used as input to the relay transmitter input. For example, if the "real" relay contacts close, the relay transmitter sends a wireless signal to the receiver, which closes a set of contacts that it has.

So...what additional hardware do I need to do this (over the LAN, via the wireless relay, or whatever)? What software is recommended? I don't have any problems with writing scripts, programs, etc., although Idon't want to get down to the driver level. Are there devices that can take something as simple as a relay open/closing and put it into a form that can be picked up by the software via a USB port, ethernet connection, etc.?

Thanks,
Ira
 
Welcome to CT!

You have several options if you just want to monitor existing relay closures. You may have to replace the relays though to add an additional pole for the sensor. I say this because if your switching 120V with a single pole relay, but your "sensor" needs a contact closure, you'd need to change the relay to a double pole so that one pole could be used for the original purpose, and the other could be used to switch the sensor.

That being said, look at LabJack for a simple, but pricey solution. They even have ethernet versions.. There are also some cheaper style USB-based DAC devices out there but I can't think of the name of any at the moment - I think someone here posted a how-to using one of them not too long ago, it was about $25. Obviously, if you use a USB solution, then you will either need to place a PC in your shop, or purchase a long range USB extender. I'd go with a PC, probably something like the HP T5700 or 5720 from ebay. They run XPe and only use 15-20 watts and can be grabbed for about $100 - less than an extender most likely...

You could also use a W800 on your "semi-dedicated pc" and a few DS10A sensors to monitor the relays wirelessly.

There are several more options, including the IOlinks from Insteon, but if you don't already have Insteon in your house, that could be even more expensive than the LabJack solution. There is also 1-wire, take a look at Hobby Boards which would work well, but will have a little slower response (about 1 second) that the other solutions, also 1-wire software isn't the best in the world - maybe others can make some good recommendations on that.

Another option would be a CG100 and a few of the GC-SC1 contact closure sensors from Global Cache

Velleman and Phidgets also have several kits that could help

Terry

Edit: Corrected typos...
 
I second Terry's good idea above about adding another pole to the existing relay. It will give the "ultimate" indication of the relay's position without interfering with any needed switching/monitoring operation.
 
Not sure I understand what you mean by adding another pole to the relays. The forum won't let me post a link to the relays I'm using (guess I don't have enough posts yet), but if you google RIBU1S.pdf, the first link should go to the correct page at the Functional Devices website.

The contact side of the relays are not switching anything. The contacts simply reflect the coils being energized or not.

My project is to monitor and trigger alerts based on the presence of (or lack of) power from the utility company, my standby genset, and my home load center. The coil for relay A is only energized when the genset is running. The "noon Monday" rule for relay A is for monitoring the genset's weekly exercise cycle. Relay B is only energized whene I have power from the utility company. The relay coil is tapped into a line in the genset's automatic transfer switch that is only hot when I have utility power. Relay C is energized by a breaker in my home's load center. If I have power to my home (utility company or genset), relay C is energized.

Thanks for the replies, but I think you guys are too late. I've been reading this forum, and I've come to the conclusion that it is time to go home automation. My guess is that happens a lot. It seems like the Elk M1G can do what I want, plus a lot more. When I built this house twenty years ago, I wired it for a security system (window and door sensors, smoke alarm, keypads, etc.) but I never got around to putting in the system. Looks like this is a good time to do so. I've still got some research to do and some questions that need to be answered, but I will start a different thread if necessary.

One quick question to make sure I'm on the right track...if I were to hook the dry contact leads from relay A, B, and C into zones 4, 5, and 6 respectively (for example) in the Elk M1G, can I accomplish what I am trying to do above? Of course that assumes networking capability, etc.

Thanks,
Ira
 
Well, we were thinking that your contacts were doing the actual switching of 'something' and were suggesting using a double pole vs a single pole relay. This way you could 'monitor' that extra pole.

Since you are already using the relays as a 'monitor' this of course is not necessary.

The Elk should let you handle your contact closure monitoring needs as well as your security requirements. I'll let those more versed in the Elk's rules give you exact scenarios for your application.

You may also want to consider a home automation software package such as HomeSeer, CQC, along with others as you progress more into your new found desire for home automation.

Best of luck and let us know if you have any additional questions.
 
One quick question to make sure I'm on the right track...if I were to hook the dry contact leads from relay A, B, and C into zones 4, 5, and 6 respectively (for example) in the Elk M1G, can I accomplish what I am trying to do above? Of course that assumes networking capability, etc.
Yes, as regards the logic that you need and the associated alarm responses, the M1 will handle it solo. But, not as regards your requirement to "save off all of the state changes (with date and time stamps) to a file or database." For this you will need another processor talking to the M1, pulling the relay state data.

You are already considering ways to get the relay contacts echoed over from your shop, but you might also consider having a M1XIN located in the shop and connected back to the M1 on the RS-485 bus. Might open the door to other uses as well.
 
One quick question to make sure I'm on the right track...if I were to hook the dry contact leads from relay A, B, and C into zones 4, 5, and 6 respectively (for example) in the Elk M1G, can I accomplish what I am trying to do above? Of course that assumes networking capability, etc.
Yes, as regards the logic that you need and the associated alarm responses, the M1 will handle it solo. But, not as regards your requirement to "save off all of the state changes (with date and time stamps) to a file or database." For this you will need another processor talking to the M1, pulling the relay state data.

You are already considering ways to get the relay contacts echoed over from your shop, but you might also consider having a M1XIN located in the shop and connected back to the M1 on the RS-485 bus. Might open the door to other uses as well.

The input expander sounds like a good idea. I've got a spare cat6 cable going to the shop I can use. My water well pump "house" is located next to my shop, so it too is a ways from my home. I'm already using a data logger there to track various things (well pump on/off, water softener regeneration cycle, master irrigation valve open/close, water flow to home in excess of 2 gpm). I've been thinking about "smartening" that stuff up a bit, and an input expander (along with an output expander) opens up a lot of possibilities. Maybe turning off the well pump and sending an alert if a leak is detected in the pump house. Thanks for the suggestion.

I've spent most of the day reading the forum, and I haven't come across any way to log the state data. Can you point me in the right direction? If I go this route, I'm sure I will use the ethernet connection and the ELK PC-based software, too.

Thanks,
Ira
 
If you already have a datalogger why not incorporate current monitoring in lieu of "just" monitoring contact closure which only tell you the on/off state?

You can get some split core current sensors from crmagnetics.com. Might be worth looking into.

Also, another trick is to use a wall wart and monitor the DC Voltage with the data logger (will not tell you the current, but can easily take the place of relay/contact closures and are easier to install as they just plug into a wall outlet).

Anyway, just some ideas.
 
I've spent most of the day reading the forum, and I haven't come across any way to log the state data.
The solutions discussed here seem to be a mixed bag, based on comments from many of the CT community, ranging from PCs and Slugs with home grown logging software, to the commercial packages. I used a PC with homebrew interfacing for many years of data logging.
 
If you already have a datalogger why not incorporate current monitoring in lieu of "just" monitoring contact closure which only tell you the on/off state?

You can get some split core current sensors from crmagnetics.com. Might be worth looking into.

Also, another trick is to use a wall wart and monitor the DC Voltage with the data logger (will not tell you the current, but can easily take the place of relay/contact closures and are easier to install as they just plug into a wall outlet).

Anyway, just some ideas.

The data loggers I have only log contact open/close. Both the manufacturers offer current/voltage loggers, but the problem I saw with them is they couldn't use external power, and the batteries only lasted a month or two if the logging intervals were short, e.g., less than one minute intervals. Another good thing about the state data loggers I have is that they only user memory when a state change occurs. So, if you only get a state change twice a week, the memory will span a long time without filling up or wrapping.

I will still use the data loggers, but won't depend on them for alerts/notifications. Instead, I will use them for historical analysis, which is what the ones I have are meant for anyway.

The real truth is...after spending a few days reading up on the current state of HA, I want to get into that area. Last time I looked at it was ten or fifteen years ago, and back then it was super expensive, had a lot of problems, and not very DIY friendly from what I remember. Now it's reasonably priced, seems much more reliable and comprehensive, and some are DIY friendly. I think I'm hooked. Downloaded the CQC trial today. As a long time software developer (although I use assembler language, not C/C++ and definitely not OO), I'm very impressed. :)
 
The real truth is...after spending a few days reading up on the current state of HA, I want to get into that area. Last time I looked at it was ten or fifteen years ago, and back then it was super expensive, had a lot of problems, and not very DIY friendly from what I remember. Now it's reasonably priced, seems much more reliable and comprehensive, and some are DIY friendly. I think I'm hooked. Downloaded the CQC trial today. As a long time software developer (although I use assembler language, not C/C++ and definitely not OO), I'm very impressed. :)


Careful, HA is very addicting. I only got started about 9 months ago and am thinking of starting HA Anonymous :D Not sure if you know but CQC is currently on sale for $333, regularly $595, until 3.0 is released. It is about to go off sale since the first release candidate has just went public. BTW, welcome to the site.
 
Back
Top