How do I use 5VDC to switch 120VAC?

Discussion in 'The Projects Forum' started by Ingeniir, Jun 29, 2011.

  1. Ingeniir

    Thread Starter New Member

    Jun 29, 2011
    19
    0
    Hey all,

    I want to use an Arduino (can output a maximum of 5VDC) to switch 120VAC lightbulbs. However, most 120VAC relays have turn-on voltages of around 30VDC. So what kind of circuitry can I use link the Arduino to the lightbulbs? Should I just use another relay in between the Arduino and the larger relay?

    Thanks
     
  2. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    You need to supply more information about these 120vac light bulbs; what will the total wattage requirement be?

    The Arduino will have a limited I/O current capability on its' pins; probably around 20mA. It will not be able to drive an electromechanical relay coil directly, but it could drive a solid state relay (SSR) directly. You could also use a transistor to drive a relay coil.

    There are electromechanical relays available with contacts rated for >120v and significant currents, with coils rated for 5VDC. Digikey and Mouser have search engines that will allow you to narrow the selection down to meet your requirements.

    However, we do not know where on the planet you live, so can't really suggest a supplier. You should put your general location (at least your country) in your profile, accessible under the "User CP" link - make certain that you click the "save" button at the bottom after entering your location)
     
    Ingeniir likes this.
  3. strantor

    AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    What are you powering your arduino with? In my case, I use a 12VDC wall wart that puts out 2.4A. I use transistors (TIP 120 usually) to drive 12V relay coils to switch 120VAC; the relay coils are powered by the same 12V wall wart as the Arduino, it's a simple setup. look here for the diagram (all the way at the right hand side). use a 1n4004 diode in parallel with the relay coil. If you are using a 9V battery, you might want to upgrade; if the battery does have enough juice to power the relay, it probaby won't last too long.

    EDIT: but since it's 120VAC, it would probably be more efficient to use a SSR as sgtWookie suggested, not too sure which option is cheaper, look around
     
  4. russpatterson

    Member

    Feb 1, 2010
    351
    16
    Ingeniir likes this.
  5. Ingeniir

    Thread Starter New Member

    Jun 29, 2011
    19
    0
    This IS pretty much what I need, but the price is too high for me. I need to switch 4 lightbulbs independently, and 4 of those devices would cost $80.
     
  6. Ingeniir

    Thread Starter New Member

    Jun 29, 2011
    19
    0
    I just took a look on Mouser, and found exactly what I needed, a relay that is capable of switching 120VAC, with a must-operate-voltage of <5VDC: http://www.omron247.com/marcom/pdfcatal.nsf/PDFLookupByUniqueID/64AC57FB68FACE4586256D35004F60AC/$File/D20G5LE0503.pdf?OpenElement. Thanks!
     
  7. strantor

    AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    that coil draws 79.4 mA, double what the arduino can put out, 40mA. That's why we didn't recommend a relay from the beginning

    If you want to use a relay, refer to post#3. better to use a MOSFET than a TIP120 transistor.
     
    Last edited: Jul 7, 2011
  8. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,771
    971
  9. Ingeniir

    Thread Starter New Member

    Jun 29, 2011
    19
    0
    Thanks for the replies everyone, but there's some terminology flying around that I don't understand, and I just want to clarify some things.

    Wouldn't arduino(5VDC)-->transistor(about12VDC)-->electromechanical relay (120VAC) be the equivalent of arduino-->smaller electromechanical relay --> large electromechanical relay?
     
  10. strantor

    AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    You are only acknowledging 1 aspect of your 5V output from arduino; Voltage. There is another limiting factor, Amperage. The arduino is only capable of outputting 5V at 40milliamps(mA). you would be very hard-pressed to find a relay where the coil draws less than 40 milliamps. Relay coils are power hungry when compared to what the arduino is capable of supplying.

    * the transistor is not a 12V device. The part I originally specified (TIP120) will take a 5V signal with very very little milliamps and switch up to 60VDC. I may have mislead you with the 12V I mentioned. the 12V is what the transistor will switch. The transistor will be switched by 5V and it will switch 12v to your relay.

    ** the relay is not to be a 120VAC relay; it will have 120VAC rated contacts. it will be a 12VDC relay with 120VAC contacts. the relay will be switched by 12VDC from the transistor and it will switch 120VAC

    There are better (more efficient) options than a TIP120 transistor, such as MOSFETs, but TIP120s are redily available and I have experience using them, which is why I recommended that. someone else may be able to advise you of a better MOSFET option, but I cannot at this time.
     
    Ingeniir likes this.
  11. Ingeniir

    Thread Starter New Member

    Jun 29, 2011
    19
    0
    OK, I think I understand all of what you're saying. I'm definitely going to give all this a bit more thinking, you're definitely correct when you said I have not been considering amperage as a limiting factor.

    But I don't think my main question has been answered: why use a transistor rather than a electromechanical relay?
     
  12. strantor

    AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    Ok, let's recap:

    1.
    2.

    3.

    Your question has been answered 3 times; here goes #4:
    You are not going to find a relay that draws so little current that the arduino will be able to power it directly. the arduino can only output 40ma!
     
    Ingeniir likes this.
  13. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,771
    971
    yeah but why do you need a transistor...:p:D:p

    Your relay needs to get paid 100 milliamps to do work...
    Your arduino only has 40 milliamps...
    Your transistor takes the 40 milliamps from the arduino grabs the 60 milliamps in his wallet and pays the relay. and the circuit works... :)
     
    Ingeniir and strantor like this.
  14. Ingeniir

    Thread Starter New Member

    Jun 29, 2011
    19
    0
    Sorry everyone for the repetition! Reading back on all the posts in this thread, especially the ones quoted by strantor, I can't believe I didn't understand it before now. I must not have been reading the posts closely enough.

    I understand now that the reason everyone is suggesting I use a transistor to act as an intermediate between the arduino and the relay instead of a smaller relay is because electromechanical relays small enough to operate within the 40mA range of the arduino simply don't exist. Thanks everyone, for your patience!
     
  15. nsaspook

    AAC Fanatic!

    Aug 27, 2009
    2,910
    2,174
    Small 5vdc relays that use under 40mA do exist and can switch 120AC with ease. (how cost effective is another question but it reduces interconnect and circuit complexity with no extra drivers)
    I use several of this 40mA type in my solar monitor project directly driven from PIC18 output ports. The measured hold current is about 20-25mA.
    http://www.mouser.com/ProductDetail/Omron/G6B-1174P-US-DC5/?qs=CX134%2bdLMDE2sGcCBpxiIw==
    http://farm3.static.flickr.com/2504/5761948773_bdcd6e4098_b_d.jpg

    5vdc 24mA relays with 5A 230 VAC/30 VDC contacts.
    http://www.mouser.com/ProductDetail/Omron/G6DS-1A-H-DC5/?qs=Qrpqs4v%2bmsZg6FhbxWzU8w==
     
    Last edited: Jul 9, 2011
    Ingeniir likes this.
  16. strantor

    AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    I eat my words. I have spent hours looking for this in the past (last year?). Last time I played with an Arduino, ironically. It's a good thing I didn't have a money bet on it.

    You know, at that time, I even went to the arduino forum looking for a relay recommendation and everybody said that arduino can't power a relay. that's where I learned about doing it with a TIP120.
     
    Ingeniir likes this.
  17. #12

    Expert

    Nov 30, 2010
    16,337
    6,820
    We keep learning from each other on this forum. That's one of the best parts about participating.
     
    Ingeniir likes this.
  18. castley

    Member

    Jul 17, 2011
    31
    0
    why not use a triac?
     
  19. strantor

    AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    That was suggested in posts # 2,4, & 8 (SSR) but OP seemed pretty insistent on using a relay.
     
Loading...