switching 220 V AC electric bulb using relay through arduino

Discussion in 'Embedded Systems and Microcontrollers' started by bobparihar, Jan 14, 2015.

  1. bobparihar

    Thread Starter Member

    Jul 31, 2014
    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

    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

    AAC Fanatic!

    Oct 2, 2009
    Already answered here.
  3. #12


    Nov 30, 2010
    It looks to me like R1 has too many ohms.
    ErnieM likes this.
  4. MikeML

    AAC Fanatic!

    Oct 2, 2009
    Yep, should be 470Ω, or thereabouts.
  5. MagicMatt


    Sep 30, 2013
    I think your 10k is supposed to be a pull-up or pull-down, not in series with the chip... if it were in series, I would go for something around 330ohm to 670ohm personally, and still have a pull-up or pull-down to stop the thing bouncing on/off before the chip is driving it. Check if the arduino already has pull-up or pull-down on the pin you're using though, as it's pointless to duplicate, and if you go the wrong way you make a voltage divider.
  6. MaxHeadRoom


    Jul 18, 2013
    Or change Q1 to a 2n7000?