Relay To Switch On Power to PC Peripherals

Discussion in 'General Electronics Chat' started by sallysensation, Aug 12, 2011.

  1. sallysensation

    Thread Starter New Member

    Aug 12, 2011
    23
    0
    I've read through previous posts and learned a bit about relays but my question is a bit more specific.

    I would like to wire a relay switch into my PC that is triggered by the ATX power button on the front of the box. The switch would then close a circuit that delivers power to outlets (maybe a power strip with 2-3 devices -- speakers, printer, etc.). The power to the strip would then be automatically turned off when the computer is turned off, put to sleep or hibernated.

    As i'm writing this it's occurring to me that it would need to be wired to the motherboard rather than the power button itself to be triggered by standby mode and hibernation. This website has given me a bit of information regarding the voltages supplied by the pins of the motherboard ATX connector.

    There may be a much simpler solution i'm overlooking, but it seems like i need a 5v relay rated for 120v. I get a bit lost when amperage ratings enter the picture.

    Thanks.
     
  2. Crispin

    Member

    Jul 4, 2011
    88
    2
    To save yourself working with mains voltages, you could get a ready made option: http://www.amazon.co.uk/dp/B003WK62...de=asn&creative=22218&creativeASIN=B003WK62WU

    There is one socket which would always be one and when the load increases on that (i.e. you turn on the PC) then it would turn on the rest of the sockets.
    When you turn the PC off and the load drops, it will disconnect the others.


    if you wanted to roll your own, you could just tap off the 12V line on the PSU which I believe does turn off when the motherboard is off. Probably not when on standby though.

    A couple of cautions though - you'd have to be careful about connecting a relay to the PSU and any back-EMF (spikes) it might send down the motherboard. You might be buying a few more motherboards.

    A double pole, single or double throw relay would be needed to isolate the live and neutral. A 12V coil would make life simple if you connect it to the 12V line from the PSU. Anything relay rated at 5A would be ok for a computer.

    Still, I would get a bought one (cheaper than the one I posted..)
     
  3. sallysensation

    Thread Starter New Member

    Aug 12, 2011
    23
    0
    I am familiar with the smart power strips, and I appreciate the alternate suggestions. Ideally, I would like to avoid buying a smart strip as they cost at minimum $25. The cost of implementing the solution I'm imagining would be the cost of the proper relay. The rest I probably have lying around. Plus I would like to have the satisfaction of doing it myself.

    Tapping off the 12v main on the motherboard sound promising, except that switching off in standby is critical for me.

    Thanks for your suggestions, though.
     
  4. Alchymist

    New Member

    Apr 16, 2011
    5
    0
  5. sallysensation

    Thread Starter New Member

    Aug 12, 2011
    23
    0
    at that price I'd be better off buying a smart power strip.
     
  6. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    You would not have to "tap off the motherboard" to gain access to +5v and +12v. All the Molex connectors for drives and accessories have both +5v (red wire) and +12v (yellow wire) on them; the two black wires are ground. You could get a "Y" adapter, and modify it instead of your power supply's wiring harness. They're cheap, a few $.

    Finding a relay with the proper ratings for a price that you would be willing to pay is another problem. It must be rated for your local voltage (whether that's 120v or 220v we don't know) and the current rating of your circuit breaker protecting that outlet. Every item you plug into the wall outlet needs to be capable of handling the breakers' current - if not, you can wind up with a melt-down and quite possibly a fire or shock hazard.

    Mains wiring is not something to do "on the cheap". There is too much risk involved; life and property is at stake.
     
  7. tom66

    Senior Member

    May 9, 2009
    2,613
    213
    The 12V and 5V switch off when in standby. Only the 5Vsb, a separate rail only available on the motherboard connector, is powered in standby and when off. Make sure you use a diode reversed across the relay coil to protect other devices on the line from the spikes created by the relay. Then connect +12V to the positive end of the relay coil and GND/0V to the negative end.
     
  8. sallysensation

    Thread Starter New Member

    Aug 12, 2011
    23
    0
    Tanks, everyone, for the responses. i think i'm closer to figuring this out. Based on all the information I've received so far I should be able to wire a 5v, 120v relay to one of the power cables coming off the power supply (red and black wires). I can use a diode connected in parallel with the relay coil (reversed) to protect from kickback. I've found inexpensive relays that meet this criteria except I would need one that is rated for 20amps which is what my breakers are. this seems more difficult to find, though the automotive relays seem to be rated much higher (40+ amps), and they are all 12v triggers. would it be reasonable to just wire a 20amp fuse in the cicuit to protect against a surge?
     
  9. tom66

    Senior Member

    May 9, 2009
    2,613
    213
    You're unlikely to be powering high current equipment, right? A monitor, set of speakers, printer, etc... all would draw less than 5A at 120V, if even that. The current rating isn't that important for continuous loads, it's turning off that's the problem: the current needs to be interrupted. So a 20A fuse would be fine.
     
  10. sallysensation

    Thread Starter New Member

    Aug 12, 2011
    23
    0
    thanks. as i understand it, since my breakers are 20amps, it is possible for up to 20 amps of current to be flowing through that circuit at 120v, although unlikely, with a set of speakers, and a few other small peripherals. if i used a relay that was rated for only 10 amps there is a possibility that the relay could have too much current going through it. i'm not concerned too much with the chance that the relay is damaged. I am concerned that this could cause a fire hazard or damage to the computer it's contained in. so it would seem I would want a fuse or breaker in the circuit that is rated less than the relay. is that correct thinking?
     
  11. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    No, you must NOT use automotive relays for mains power switching purposes. They are not rated for breaking connections that are over 32v. If you try to use them on 120v or 220v (we don't know where you are), the relay may not be able to interrupt the arc.

    Every item must be rated for the proper voltage and current.

    You COULD add a fuse holder or circuit breaker in series with the "hot" or "line" lead for a lower ampere rated breaker; but that fuse/breaker must be rated for the voltage being applied.
     
  12. sallysensation

    Thread Starter New Member

    Aug 12, 2011
    23
    0
    i think i'll give that a shot. a relay rated for 10A 120v (5v for the coil), a diode in parallel with coil side, with a 10A fuse rated for 120v before the positive terminal of the relay. seems like it should work and be safe. Thanks for all your help!
     
  13. sallysensation

    Thread Starter New Member

    Aug 12, 2011
    23
    0
    I was testing the USB relay when it occurred to me that the +5vdc to the USB port remains even when the PC is on standby. So I can't use the USB port as a trigger unless I can find a way to change the settings to the voltage is cut on standby to only certain USB ports. I need at least one to remain powered so I can wirelessly wake the PC.

    I guess i can use the power supply connection as a trigger which involves a bit more work and makes it more specific to this PC. kind of unfortunate.

    What about using an outlet at a trigger, just like a smart powerstrip? In other words, how can I trigger a relay to switch when a device is turned on?
     
  14. tom66

    Senior Member

    May 9, 2009
    2,613
    213
    You could try the PS/2 ports which will probably switch off when power is removed. The VGA connector also provides +5V @ 50mA, but that is insufficient to power a relay.
     
  15. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    PS/2 ports are no longer present on computers manufactured within the last few years. using a USB to PS/2 adapter would still give you 5v present at all times.

    Using a "Y" adapter from one of the 4-pin MOLEX connectors will give you switched +5v, +12v and GND.
     
  16. sallysensation

    Thread Starter New Member

    Aug 12, 2011
    23
    0
    Thanks, guys. I'll do some playing around and see what's best.
     
  17. tom66

    Senior Member

    May 9, 2009
    2,613
    213
    All my computers are rescued from the scrapheap so I get them a few years out of date :rolleyes: (still perfectly usable though.)

    Molex Y adapter is a good option.
     
  18. sallysensation

    Thread Starter New Member

    Aug 12, 2011
    23
    0
    I got it working. I used a single gang electrical outlet box and outlet I had lying around. I used a 10A relay with a 10A fuse. to make it work with a USB plug, I wired a female USB plug onto a male molex which i was able to plug into an open female molex in my PC. So I now have 2 outlets that turn on and off with my PC. works like a charm. I think I will eventually wire in a 3-way switch so I can bypass the relay and either keep the outlet off or on regardless of the PC state.

    Something worth noting: the man at the electronics store was adamant -- actually he seemed angry -- when I asked about the diode for the relay. He said I don't need it and that there's too much BS on the internet. I didn't have the empiricism or reasoning to back it up, so I just let it go.

    Anyhow, thanks for all the help.
     
  19. tom66

    Senior Member

    May 9, 2009
    2,613
    213
    You *will* need the diode if you are using a power supply rail to switch it on or off or you will damage something in your computer from the ringing back-EMF by the inductive coil.
     
  20. vventura

    Member

    Jan 21, 2008
    10
    0
    I'm thinking in doing about the same thing, but with the diference that I want to use the Molex and the +5v and +12v for supply the current to my speakers and maybe a switch. If my PC power supply have enought watts for all this shouldn't be a problem, or can it be? (As long as the correct voltage is supplied of course)
     
Loading...