Connect with us

switch for my room

Discussion in 'General Electronics Discussion' started by jones, Mar 31, 2012.

Scroll to continue with content
  1. jones

    jones

    11
    0
    Mar 31, 2012
    Hello Electronics Point,

    I'm just new here and I have a question. Is it possible for me to have a 220 volts switch using a 3 volts signal? What I'm trying to accomplish is, to switch my room lights on/off using the parallel port DB25 of my computer.

    Sorry, I'm into Information Technology but really interested in electronics since grade 4 elementary school. =)

    Any help is very much appreciated! Thanks guys in advance.

    // Start Edit

    By the way, my solution is by using a mechanical motor (but I think, it is not feasible enough). When there's 3 volts flowing, switch on. When there's zero volts, turn off. Mmm... Any ideas?

    // End Edit
     
    Last edited: Mar 31, 2012
  2. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,271
    2,718
    Jan 21, 2010
    It is indeed possible.

    Typically you would use an optocoupler to trigger a triac.

    It's not quite that simple, and it's not something you should try unless you have experience working with mains voltages.
     
  3. jones

    jones

    11
    0
    Mar 31, 2012
    Thanks! At least I got an idea. Next stop, wikipedia. Maybe the key word I'm looking for years is optocoupler. =)

    Again, thanks. (Trying to switch lights thru android device. )
     
  4. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,271
    2,718
    Jan 21, 2010
    It is somewhat safer to use the low voltage output to cause a relay to close, and use the relay to switch power.

    However, the relay will require more power than you likely have available on that signal output, so you will require a separate power supply. The optocoupler will only require that your signal output can supply (say) 10mA.
     
  5. jones

    jones

    11
    0
    Mar 31, 2012
    Uhuh... I hope I got it right. I'll use optocoupler to switch my lights on/off.
    Instead of using this one [​IMG] I'll be using this one [​IMG]...

    By the way, my concept is this...
    [​IMG]

    Don't worry, I'll try consulting the engineering department just in case I'm [opps...] off. =)

    If I have time, maybe I could connect it to an android (like a remote control).

    // Start Edit

    Last night I arrived to an article at wikipedia [http://en.wikipedia.org/wiki/Opto-isolator] which describes what Opto-isolator is. Then ended up consulting the google and arrived here [http://www.electronics-tutorials.ws/blog/optocoupler.html]... And this image struck me
    [​IMG]
    it says photo-transistor, can this handle 220volts? (Sorry, I'm a newbie)

    // End Edit
     
    Last edited: Apr 1, 2012
  6. Harald Kapp

    Harald Kapp Moderator Moderator

    9,549
    1,973
    Nov 17, 2011
    The photo triac could be the right component for the job. See for example here: http://www.semicon.toshiba.co.jp/docs/catalog/en/BCE0034_catalog.pdf

    Besides being able to handle 220 V, you have to take into account the current you want to switch.

    Or you could simply buy a USB controlled extension cord (liek this one: http://www.amazon.co.uk/Ecotek-Standby-Saver-6-Way-Socket/dp/B0017PTD3M/ref=pd_sim_sbs_diy_1)

    The so called "USB control" doesn't require any software. It just detects if the 5V from
    the USB bus are present and turns on the sockets. Maybe it works with 3V, too.


    Harald
     
  7. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,271
    2,718
    Jan 21, 2010
    I said it wasn't that simple, right? :)

    At the very least you'd ned a series resistance before the optocoupler (you may need another source of power as well in some cases.

    AND the optocoupler can't switch a lot of current, so you'd need to use it to switch a meatier device (like a triac).

    Oh, another option is a SSR (solid state relay).

    (And Harald's suggestion is also good)

    There may be other things you need to worry about depending on the load. Also, you're playing with voltages that can kill you so I doubt your college engineering department is going to say "sure, experiment in your dorm room!" :)
     
  8. jones

    jones

    11
    0
    Mar 31, 2012
    Thanks. But I'm more interested in switching the lights thru a remote device (like android...) I think parallel port db25 can handle it. It has 16 output (well, typically 8 but depending on the configuration). Anyway, thanks for the first link.

    SSR is interesting, too! I hope I could buy them over the web. =)

    Sorry, I'm newbie in this field. Don't worry about the dorm, I'm consulting my engineering folks.
     
  9. Harald Kapp

    Harald Kapp Moderator Moderator

    9,549
    1,973
    Nov 17, 2011
    What I didn't express too clearly (sorry) was that you don't need to hook up the USB controlled extension cord to an actual USB interface. All you need is to use the USB supply pins and drive them through the interface of your choice. Effectively you use the data port of your preferred remote device to control the the USB power wires going to the extension cord. You don't use the USB data lines in that case.

    Alternatively you could buy a remote controlled extension cord which will spare you all the hassle.

    Harald
     
  10. cjdelphi

    cjdelphi

    1,096
    104
    Oct 26, 2011
    Hmmm is there a reason for using the parrarel port rather than usb?
     
  11. jones

    jones

    11
    0
    Mar 31, 2012
    My reason is, I'm more familiar with it. I have written a simple program thru it. =)
     
  12. cjdelphi

    cjdelphi

    1,096
    104
    Oct 26, 2011
    Alright then except usb comes with power making your job easy :p
     
  13. timothy48342

    timothy48342

    218
    0
    Nov 28, 2011
    Does it??

    Harold Kapp mentioned (and linked ) a USB controled power strip, but you can't use your computer programmatically to control those. You have to plug them into the comp to turn on the appiance, and unplug them to turn it off. (or turn your computer on and off to control it)

    It could be hacked though. If you build a device to switch just 5V, you can control the USB power strip and let it do the rest, without having to worry about solid state relays and all that. (within the limits of it's design.)

    Designing a USB device and learning the protocol and writing drivers for would be a bit more involved. The OP has written the code to control the output of the 25 pin serial plug. (or is it parallel? Whichever.)

    (If anyone has a primer on designing USB devices. I'd interested in reading about that.)

    --tim
     
  14. Harald Kapp

    Harald Kapp Moderator Moderator

    9,549
    1,973
    Nov 17, 2011
    You will not need a lot of hacking. Connect GND from the printer port to GND of a USB cable. Connect the controlling signal from the printer port to VUSB (+ of the USB cable). Do not connect D+ and D- (data lines) of the USB cable.
    Now when you program your controlling signal of the printer port to LOW, the voltage on the USB cable will be ~0V. Thus the extension cord will switch off.
    When you program the controlling signal to High, the extension cord sees ~3V...5V on the USB and will turn on.
    The only thing I wasn't able to figure out from the description of the extension cord is how much current is drawn from the USB cable to activate the switching mechanism. You will want to find that out before you invest in the extension cord.

    Note: for someone not experienced in handling high voltages and currents (that doesn't necessarily imply any of the contributors to this thread :D ) this may be one of the safest way to go about this. Handling voltages as high as 115 V or 230 V is very dangerous and can be lethal. If you don't know what you do, better leave your hands off.



    Harald
     
  15. timothy48342

    timothy48342

    218
    0
    Nov 28, 2011
    Harald, do you think that the low voltage state of the output pin on the printer port will be able to fully ground the V5+ of the USB? Also could it affect power available to other USB devices?

    I'm not disagreeing, just asking. I could be misunderstanding altogether, of course.

    -t
     
  16. Harald Kapp

    Harald Kapp Moderator Moderator

    9,549
    1,973
    Nov 17, 2011
    No, please reread my post. Nowhere did I state that the USB cable should be connected to a USB port. In fact, you may definitely not connect this one cable to any USB port of the PC. You need it only to adapt the logic signal from the printer port to the USB port of the extension cord.
    The simple way to avoid any wrong connection would be to cut off the PC-side of the USB cable which makes it easy wiring this end up to the printer port. You now have no longer the USB connector to plug into the PC,

    Remember, this all wokrs under the (reasonable) assumption that the extension cord only looks for USB power. Otherwise you'd need controlling software on the computer. But the description doesn't say so. It only says that all devices plugged into the extension cord will be switched on as soon as the Computer is switched on which can be easily detected by looking at the USB power suppl:
    PC off -> no USB supply
    PC on -> USB power supply available
    All I propose is to mimic this behaviour by (ab-)using the parallel port pins.

    Harald
     
  17. timothy48342

    timothy48342

    218
    0
    Nov 28, 2011
    OH! I get it now. It's not plugged in. ok.

    LOL: "(ab-)using the parallel port"
     
  18. elecman

    elecman

    2
    0
    Apr 3, 2012
    You should publish something in instructables about this I would love to be able to switch the lights with my computer.
     
  19. jackorocko

    jackorocko

    1,284
    1
    Apr 4, 2010

    Harald has spelled it out very clearly, how much more instruction do you need? The hard part now is the software to interface with the parallel port. If the OP feels like it, he may wish to contribute that file for others to see.
     
  20. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,271
    2,718
    Jan 21, 2010
    Just to butt in.

    If I were doing this and I was tempted to use a parallel port, I would get a USB to parallel port adapter.

    Safer for your computer, easier to replace, and has a known source of 5V.

    None of this is to suggest that a parallel port is the right or wrong option...
     
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

-