Computer Controlled Relays

NumbersNotFoundNumbersNotFound Join Date: 2002-11-07 Member: 7556Members
<div class="IPBDescription">Hardware/software interface.. any ideas?</div> Hey, I wanted to make this one device to set my alarm clock by computer.

The alarm clock works by four buttons on the top, these are simple switches.

So, four relays would be used, one for each button.

I'm looking for the simplest way possible to have these relays connected to the computer and interface with C++ so I can use the program, along with the system clock, to turn the relays on and off, thus setting the time of the clock, setting alarms, etc.

Anyone know the best way?

Comments

  • TalesinTalesin Our own little well of hate Join Date: 2002-11-08 Member: 7710NS1 Playtester, Forum Moderators
    edited September 2004
    Standard 25-pin parallel port. Just wire up the relays to individual pins and ground (depending upon how beefy the relays are, if you're replacing the buttons with the relays, or setting up actuators on the relays) and use a C++ interface to power/depower each pin for however long it takes for the clock to 'notice' that the button has been pressed. Old standard for making computer-controlled coffee pots (tripping the relay which lets the 110 through) or lamps and things of that nature.


    I'd be more concerned about reading FROM the clock, as with the four-relay system, all you'll be able to do is say 'advance clock X hours, X minutes'. No quick setup, unless you tapped directly into the clock's EEPROM, which can be a true pain in the butt.

    At that point you'd more want to just get an LCD/LED/Nixie display and wire it directly to the parport and run the clock directly from system time. Maybe solder on a buzzer and link it to one of the unused pins, unless you just wanted to run an MP3 or something off the standard sound-out.
  • NumbersNotFoundNumbersNotFound Join Date: 2002-11-07 Member: 7556Members
    <!--QuoteBegin-Talesin+Sep 3 2004, 03:45 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Talesin @ Sep 3 2004, 03:45 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Standard 25-pin parallel port. Just wire up the relays to individual pins and ground (depending upon how beefy the relays are, if you're replacing the buttons with the relays, or setting up actuators on the relays) and use a C++ interface to power/depower each pin for however long it takes for the clock to 'notice' that the button has been pressed. Old standard for making computer-controlled coffee pots (tripping the relay which lets the 110 through) or lamps and things of that nature. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    K, thanks.

    Would a Serial port work as well?

    The clock picks up the signals as fast as i can press the button... which is about 5 times/sec, so it would set pretty fast.
  • TalesinTalesin Our own little well of hate Join Date: 2002-11-08 Member: 7710NS1 Playtester, Forum Moderators
    edited September 2004
    No. A serial port is assumed to use an actual protocol. A parallel port, you can power or depower pins however you want.

    Just look into the IO libraries for external ports. It'll explain how it all works.

    Also, given that you can power/depower more than 300 times a second, being able to push the button five times a second isn't all that fast, comparatively. You'll have to tweak to figure out how long it needs to be tripped to register with the clock.
  • NumbersNotFoundNumbersNotFound Join Date: 2002-11-07 Member: 7556Members
    Thanks a bunch. I found this one site that suggests a small resistor on each pin so as to not overpower the parallel port... is this needed?
Sign In or Register to comment.