Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Security Alarm

by Jasper66 (Initiate)
on Dec 06, 2006 at 15:46 UTC ( #588118=CUFP: print w/replies, xml ) Need Help??

A buddy of mine and I would sometimes kick back and watch the TV at work. Unfortunately, we never knew someone was coming down the hall until they popped into the switchroom. We found an old motion sensor that had been a part of the security system at one time and when activated, it would apply 15-18V DC to a set of leads. We ran a cable from the sensor over to a PC that hadn't been used in years. I aquired a relay which had been controlling the AC compressor in someone's vehicle who also worked there (they didn't start having AC problems until the next spring...that they noticed). We wired the relay up to the sensor and the switched-contacts the the comm port (TX->RX) of the PC. I hammered out a really short and inefficient perl script that constantly wrote data to the comm port and when the motion sensor was activated, the relay looped my TX and RX on the PC, perl began receiving data and played a nice warning tone which was plenty of notice to "look busy". We also put Mahjonng on that machine and it became our gaming system for those slow days. I even caught the boss playing it a couple of times and I knew at that time, the machines future was secured. I love Perl.

Replies are listed 'Best First'.
Re: Security Alarm
by zentara (Archbishop) on Dec 07, 2006 at 10:54 UTC
    So where is the perl code that handled the comm port?

    I'm not really a human, but I play one on earth. Cogito ergo sum a bum
      Further, why didn't the relay get hooked up to the power source for the TV?

      So we have a CUFP with no code, vandalism, theft, and a suboptimal solution to the problem. Cutting the the power to the TV automatically before some cow-orker comes around the corner would work much more smoothly than sounding an alarm and turning it off manually, after all.

      Christopher E. Stith
      I'd like to see that myself. Even if, as the author stated, it was inefficient, it's always nice to see yet another way to do it.

      Bad examples are still examples. Sometimes they're even enough to spark someone's brain into making a good example.

      strfry( $vegetables );
Re: Security Alarm
by YuckFoo (Abbot) on Dec 06, 2006 at 18:08 UTC
    Wow, that's really cool. I especially liked the part where you broke the dude's car. Dick.
      It wasn't your car, was it? Cause that would be ironic.

      Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
      - Terry Pratchett

Re: Security Alarm
by zeno (Friar) on Jan 30, 2007 at 14:56 UTC
    Hee hee. I don't know how much of what you wrote was true and how much was fabrication-- all? none? But something about this post made me laugh. I like the UNIX rm -rf recovery hero style of the piece describing a perfectly despicable activity that all of us has considered doing.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://588118]
Approved by EvanK
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2020-11-24 03:22 GMT
Find Nodes?
    Voting Booth?

    No recent polls found