1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

switching 220 V AC electric bulb using relay through arduino

Discussion in 'Arduino' started by Bob Parihar, Jan 14, 2015.

  1. Bob Parihar

    Bob Parihar Member

    Joined:
    Oct 8, 2014
    Messages:
    87
    Likes:
    0
    my aim is to switch an electric bulb operating at 220v AC..for this purpose i use a 12V DC relay that can operate for 220 V appliance according to its data sheet.
    my relay circuit is
    upload_2015-1-14_16-3-26.png

    now, when i use a regulated power supply( i have used a desktop PC's SMPS unit for power supply that gives 12v, 5v, and 3.3v) then if i give 5v from that power supply to the pin of microcontroller , i get a click sound from the relay and the bulb gets ON and when the pin is kept open bulb get off( Every thing is fine till now relay circuit is working)
    but when i use an arduino uno board for the same purpose (i have 12v, 5v, 3.3 v and gnd pins on the board so i give all of the supply from the board itself now not from the seprate supply)
    when i connect 12v gnd and 5v at the pin that goes to MCU pin the relay is making noise.. i am getting a continues clicking sound from the relay.. that means relay is switching continusly... and if i connect the bulb to it it may damage my bulb( i assume, coz relay is switching fast and continuously)

    why iam getting the noise of clicking continusly when i use arduino instead of the power supply
    now how i could solve this problem ? any suggestions?
     
  2. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,139
    Likes:
    566
    Location:
    AZ 86334
    The 12V from the big PSU should go only to the top of the 12V relay.

    If you want to run the Arduino on 5V (bypassing its internal regulator), feed 5V from the big PSU to the 5V pin on the Arduino (look at the Arduino documentation). Do not connect anything to the DC input pin of the Arduino.

    If you want to run the Arduino on 12V (utilizing its internal regulator), feed 12V from the big PSU to the DC input pin on the Arduino (look at the Arduino documentation). Do not connect anything to the 5V pin of the Arduino.

    The Common (0v) from the big PSU should connect to the emitter of Q1 and to the GND pin on the Arduino.

    A single wire from an Arduino port pin to R1.
     
  3. tunedwolf

    tunedwolf Well-Known Member

    Joined:
    Aug 9, 2006
    Messages:
    1,080
    Likes:
    62
    Location:
    UK
    It's always possible that the load is too light for the PC Power Supply to regulate properly. Try adding something else with a higher load on the 12V rail in addition to your circuit :)
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Bob Parihar

    Bob Parihar Member

    Joined:
    Oct 8, 2014
    Messages:
    87
    Likes:
    0

    first of all thanks for the help

    now i want to tell you that i have a arduino development board which runs on a 12v dc power supply and the board is able to supply 12, 5, 3.3 V on its own there is no need of external PSU if i use arduino itself..
     
  6. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,370
    Likes:
    974
    Location:
    Loveland, CO USA
    First measure each supply voltage and see if one is not stable. (12V) A scope is best but a simple meter will probably work.

    If the 12V and 5V are good then look across the transistor. When it is on you should get less than one volt. C-E Probably closer to 0.3V. If there is too much voltage C-E on the transistor then change the 10k resistor to 4.7k or 2.2k and try again.
     
  7. cowboybob

    cowboybob Well-Known Member Most Helpful Member

    Joined:
    Oct 22, 2011
    Messages:
    3,052
    Likes:
    479
    Location:
    James Island, SC
    Your description of how you are connecting the various supplies to the circuit(s) is not clear.

    Please provide a schematic showing the UNO's and your relay circuit's connections to your PSU. Also, the minimum current needed by the relay.

    Your code (program, or "sketch") controlling the UNO would also be useful.
     
  8. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,139
    Likes:
    566
    Location:
    AZ 86334
    Exactly, that is why I wrote the long description of how they should be hooked up.
     
  9. b.james

    b.james Member

    Joined:
    Feb 4, 2014
    Messages:
    167
    Likes:
    9

Share This Page