Announcement

Collapse
No announcement yet.

Use serial port to monitor dry contacts

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Use serial port to monitor dry contacts

    Inspired by this...

    http://www.digi.com/wiki/developer/i...l_signal_lines

    ... I've been working on a plugin that can monitor the signal lines of a serial port.

    My reason for starting this project was to provide accurate monitoring of my garage door which has a reed switch installed.

    Using a Z-Wave or Insteon window/door sensor has worked fine for the most part but I wanted something more reliable (ie immune to batteries dying).

    I didn't want to add the garage door as a zone to my alarm system to avoid the need for further alarm programming (managed system).

    WHAT THE PLUGIN DOES

    The plugin monitors the signal lines of a serial port (DSR / DCD / CTS) and then sets an associated Homeseer device to either on(100) or off(0).

    A DB9 connector with 3 pairs of wires is connected to the serial port. When a pair is shorted the associated signal line is closed and the plugin updates the Homeseer device.

    Each pair can be connected to anything that can short the connection. If you have voltage on the line then an optoisolator or relay can be added to avoid damaging the serial port.

    Each serial port can handle 3 distinct dry contacts / Homeseer devices. I have tested with a Digi Edgeport and USB to Serial adapter cable. I've only tested it on the bench (no real cable length).

    The plugin is in early development but if you want to have a play let me know.

    Chris
    Attached Files

    #2
    This sounds great! I'd like to try this.

    Thanks

    Comment


      #3
      Give this a try:

      3.0.0.2

      I added the ring indicator signal so each serial port can be used for up to 4 dry contacts. These are the pairs but I did not note which signal is which pair for all of them.

      4(o) AND 1(i)
      4(o) AND 2(i)
      7(o) AND 8(i)
      7(o) AND 9(i) = RI

      (o) is the output pin providing voltage. (i) is the input pin to trigger the signal. Shorting the pairs will trigger a signal change.

      I am using a relay board to close the serial port pairs. This way you can use higher voltage for the sensors. I am monitoring reed switches that are a fair distance from the serial port and I didn't know if there was sufficient current from the serial port to handle the cable distance.

      Relay board on ebay

      The relay board and reed switches are powered by a separate 12V power supply.

      Let me know how you get on.

      Comment


        #4
        Helpful

        This might help me. I am trying to interface some functions of my house alarm.
        I am about to rebuild the house alarm so will give it a go when I've done that.

        Comment


          #5
          So let me see if I understood, you use one DB9 for one device? Can you explain how will this work with that board you posted earlier?
          Hector
          ____________________________________
          Win.2003 OS, HS3
          BLDSC,BLstat,BLRadar,BLRamdom,BLOccupied
          BLups,BLrain8,HSTouch,Ultrajones Weatherbug,
          MyTrigger,ACRF2,W800,Zwave
          AP800,Honeywell Stat

          Comment


            #6
            Hi Chris

            Interesting thing going on here, but a bit confused. Do you have to cut one end of the serial cable to connect to the switch of any sensing device?
            Hector
            ____________________________________
            Win.2003 OS, HS3
            BLDSC,BLstat,BLRadar,BLRamdom,BLOccupied
            BLups,BLrain8,HSTouch,Ultrajones Weatherbug,
            MyTrigger,ACRF2,W800,Zwave
            AP800,Honeywell Stat

            Comment


              #7
              A single serial port (DB9) can be used for up to 4 HS3 devices.

              The pairs are:

              4 & 1
              4 & 2
              7 & 8
              7 & 9

              Pins 4 & 7 provide power. Pins 1,2,8 & 9 are the input signal pins. Shorting each pair will trigger a signal.

              If you have a serial DB9 straight through cable with all 9 pins connected, you could cut the end of and use that. You would need to figure out what pin is what color to make this work.

              I found it easier to purchase a DB9 connector and solder colored pair from a CAT5 cable onto the pairs above. This way a color = a signal.

              Once you have the cable, connect it to a serial port and let the plugin know which port to connect to. Then try shorting the pairs and monitor the console (developer mode checked in plugin page). The console will tell you which signal was shorted / cleared.

              Once you have this working you can associate a pair with a device in HS3 by enabling the signal in the plugin and giving it a name.

              Hope this helps.

              Chris

              Comment


                #8
                This is very interesting for the same reasons that you mentioned monitoring garage doors I have been using zwave but distance is an issue and has been unreliable for me. is there a possibility that this plugin could be run remotely that would make this alot easier to implement in my envoronment.

                Cheers Ken
                HSPRO,HS3PRO, BLsecurity, , MCSxap, HSTouch Android, UltraGCIR, CM15a, USBUIRT, BLUSBUIRT, WIFIRGB, BLAB8SS, BLcontrol, BLGData, BLLAN,BLOccupied, BLRadar, BLVolume, iTunesDAAP, UltraGCIR3, Airplayspeak, BLalarm, BLbackup, BLLED, BLrandom, BLReminders, BLRF, BL Speech, Hyperion, IFTTT, KINECT, XBMC, MCSprinkers PRO, PHLocation, ULtrapioneer, Ultralog, ultraweatherbug, Z,troller, GC-100, GC WIFICC, GC-WIFI SERIAL, Nitrogen logic depth camera controllers,

                Comment


                  #9
                  It could be tweaked to allow it to run remotely.

                  Perhaps a command line option to specify the HS3 IP address. It assumes local (127.0.0.1) right now and it's hard coded.

                  Comment


                    #10
                    It would be awesome if this could run remote instances and even multiple instances similar to what spud has done with the kinect plugin that way you could have a pc setup anywhere to monitor contact closure with improved reliability. Even possibly a global cache device. Right now use one to control garage doors but serial port could monitor them too.
                    HSPRO,HS3PRO, BLsecurity, , MCSxap, HSTouch Android, UltraGCIR, CM15a, USBUIRT, BLUSBUIRT, WIFIRGB, BLAB8SS, BLcontrol, BLGData, BLLAN,BLOccupied, BLRadar, BLVolume, iTunesDAAP, UltraGCIR3, Airplayspeak, BLalarm, BLbackup, BLLED, BLrandom, BLReminders, BLRF, BL Speech, Hyperion, IFTTT, KINECT, XBMC, MCSprinkers PRO, PHLocation, ULtrapioneer, Ultralog, ultraweatherbug, Z,troller, GC-100, GC WIFICC, GC-WIFI SERIAL, Nitrogen logic depth camera controllers,

                    Comment


                      #11
                      This is a bit of a hack but seems to work. If you are not planning on using the remote functionality I'd stick with 3.0.0.2.

                      3.0.0.3

                      Please review the installation notes file included.

                      Please note when running the plugin remotely it is not persistent in the event the connection to HS3 fails or if HS3 is shutdown. It will exit like a local plugin. I may get time to introduce a re-connect thread but not likely in the near future. I'd therefore suggest a looping batch file or something similar to keep it running.

                      If the plugin is run remotely it will register as SDC_<computer name>. This should allow the plugin to run more than once. All device addresses will also adopt this suffix to allow for uniqueness.

                      Chris

                      Comment


                        #12
                        what length of cable can this work with?
                        Hector
                        ____________________________________
                        Win.2003 OS, HS3
                        BLDSC,BLstat,BLRadar,BLRamdom,BLOccupied
                        BLups,BLrain8,HSTouch,Ultrajones Weatherbug,
                        MyTrigger,ACRF2,W800,Zwave
                        AP800,Honeywell Stat

                        Comment


                          #13
                          Not sure - I've never tested the distance with a sensor directly connected to the serial port.

                          I use this to take distance out of the equation:

                          Relay board

                          It uses a 12V power supply to feed the relays and any connected sensors. The sensors trigger the relay instead of the serial port.

                          I have reed switches about 50' away and it works fine like this.

                          The outputs of the relays connect to the serial port so the power from the serial port does not need to travel far.
                          Attached Files
                          Last edited by chrisgo; January 14, 2015, 07:36 PM.

                          Comment


                            #14
                            Originally posted by chrisgo View Post
                            Not sure - I've never tested the distance with a sensor directly connected to the serial port.

                            I use this to take distance out of the equation:

                            Relay board

                            It uses a 12V power supply to feed the relays and any connected sensors. The sensors trigger the relay instead of the serial port.

                            I have reed switches about 50' away and it works fine like this.

                            The outputs of the relays connect to the serial port so the power from the serial port does not need to travel far.
                            So you have that board closer to the pc and not near the controlled device rigth?
                            Hector
                            ____________________________________
                            Win.2003 OS, HS3
                            BLDSC,BLstat,BLRadar,BLRamdom,BLOccupied
                            BLups,BLrain8,HSTouch,Ultrajones Weatherbug,
                            MyTrigger,ACRF2,W800,Zwave
                            AP800,Honeywell Stat

                            Comment


                              #15
                              Yes, everything is at the PC.

                              The sensor is on the end of a cat5 run. The distance from the serial port to the relay board is very short.

                              Comment

                              Working...
                              X