Connect with us

Switching mains via USB - can it be this simple.

Discussion in 'General Electronics Discussion' started by Everso, Dec 18, 2012.

Scroll to continue with content
  1. Everso


    Dec 18, 2012
    Hi all

    I am an old school computer geek (30+years experience) and am just getting into controlling thing from a PC. For my first project I though I would do something to save a some electricity.

    I have a laptop that is used as a media streamer/server. This runs 24/7 but thinking about it - it has a battery (in fact an additional extra battery) so ... I thought if I could get the mains adapter to turn on and off under control I could get it to run off when the batteries were say say 95% then back on when the power gets down to 10%.

    I know I could get something very close just putting it in a timer plug but this is a learning exercise as well as a saving power thing.

    On to the idea - which I am expecting you to tell me will not work but I am hopeful.

    I though I would get a solid state relay such as this

    This would let me put the mains on one side and a USB socket to trigger it on the other. A bit of code to read the battery levels and another to turn the USB port on and off and away we go.

    Like I said - I am expecting a list of reasons why this will not work but that will be a useful learning as well...

  2. Harald Kapp

    Harald Kapp Moderator Moderator

    Nov 17, 2011
    Could you use one of these?
    Note these are notz USB controlled. They merely look for the USB power and turn off the extension sockets when there is no USB power. Might work in your case.

    Otherwise search the forum. I know we've had a thread on this topic, but frankly I'm too lazy to search.
  3. Everso


    Dec 18, 2012
    That is sort of what I am looking to make. As the PC is on 24/7 some code to turn off the USB will in effect make it under program control. I also am looking to do as much as possible myself as a learning exercise.

    I have attempted searching but not found anything this simple so I am assuming there is a reason why i will not work - I just don't know why not and would love to know.

    Thanks for the reply - as least I know what I am trying to do it not too insane.


    *** EDIT ***

    My continuing searching found this

    It's very similar to what I was thinking but using a USB to serial adapter to make the programming easier - seems to be just what I am after.

    This is just the start of my playing (I am hopefully getting a Raspberry PI for Christmas) and think I should probably take an electronics course to make sure I am not going to blow anything up. :)
    Last edited: Dec 18, 2012
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day