Connect with us

Arduino + Relay(220V) Problem.. Need Help!

Discussion in 'Microcontrollers, Programming and IoT' started by viel, Mar 5, 2016.

Scroll to continue with content
  1. viel

    viel

    9
    0
    Mar 5, 2016
    Hi, I'm working on a project using arduino and relay to control a 220v with LCD Display.

    My Components are:
    A.) Arduino with Wifi Shield going to:
    B.) Serial to parallel decoder (Shift Register 74595) two of them in series to Control:
    a.) 2x16 LCD.
    b.) Relay(10A 250vAC) with Current Sensor (ACS712)

    diagram.jpg

    Everything works fine without load, but when i load a 220v (Electric Fan) my Arduino Restarts.
    Please Help me. i thought my circuit is just fine..

    Any Help is Appreciated...
     
    Last edited by a moderator: Mar 5, 2016
  2. Alec_t

    Alec_t

    2,724
    723
    Jul 7, 2015
    Welcome to EP!
    You MUST have a reverse-biased diode across the relay coil to suppress the back-emf pulse created when the relay is switched off. That pulse would drive the Arduino nuts and could also damage it!
     
  3. viel

    viel

    9
    0
    Mar 5, 2016
    Thank you for your Reply.
    But, Sorry i forgot to include in my drawing the Diode, i'll re upload the photo..

    source.jpg

    maybe the Current Draw of the Relay is too high and its getting the power from my source?
     
    Last edited by a moderator: Mar 5, 2016
  4. cjdelphi

    cjdelphi

    1,098
    104
    Oct 26, 2011
    I seem to recall having issues doing this even with a diode in reverse, i can't remember if an optoisolator did the trick

    Having said that, it must have or the Christmas display would not have worked lol
     
  5. viel

    viel

    9
    0
    Mar 5, 2016
    i had the same problem last 5 years ago with relay to drive the electromagnet lock.
    My MCU restarts too during my thesis presentation, fortunately they didn't notice it.

    but, i didn't found a way to fix that before and now its the same problem again regarding relay.
     
  6. CDRIVE

    CDRIVE Hauling 10' pipe on a Trek Shift3

    4,960
    648
    May 8, 2012
    OK, this is going to begin with one of my rants about why posters fail to label their components; IE: R1, R2, Q1, U1, etc?

    I hate typing. So asking why Rx exists vs why is there a 1K resistor in the Emitter _ GND leg of the relay driver transistor makes things a hell of a lot easier and reduces ambiguity too!

    I doubt that it's related to your issue but why does it exist? Is your relay coil not rated @ 12V?

    Chris
     
  7. Minder

    Minder

    2,909
    609
    Apr 24, 2015
    If you use a 2n7000 you can eliminate some components, also have you looked at SSR's, and eliminate the relay, I am not sure if the Arduino would drive the SSR direct, I have never used them.
    M.
     

    Attached Files:

  8. viel

    viel

    9
    0
    Mar 5, 2016
    Hi Chris.
    Thank you for your reply.

    My Relay is 12V - 10A 250VAC,
    i haven't tested/computed for the current output of my transistor with relay load. but its just my practice to add resistor every time i use transistor as switching circuit thinking that this might lower the current consumption of my relay. besides the circuit is working with this set up but now when i switch off the relay with load (electric fan, etc), my LCD light turns off. i think that my Shift Register is disturb on the process, i thought that my arduino resets but its not though.

    should i try to remove the 1k resistor?
     
  9. viel

    viel

    9
    0
    Mar 5, 2016
    Hi Minder, Thank you for your reply.

    I'm not good at identifying which model of components to be used, besides I'm running out of time to order another component to finish my school project.

    I'm just using general knowledge of a components.

    Thank you for your reply though.
     
  10. CDRIVE

    CDRIVE Hauling 10' pipe on a Trek Shift3

    4,960
    648
    May 8, 2012
    Uh, I should have examined your schematic more thoroughly before replying. That said I see some other issues.

    (1) 100uF is rather low for a PS filter cap.
    (2) You should consult with the 7805 Datasheet regarding best practices for selecting Cin & Cout values along with their physical placement. These two caps can greatly effect the stability of the 7805.

    Also, solderless protoboards do not lend themselves well to minimizing stray capacitive coupling. This is something that can cause issues with transients running wild on power rails and chip input pins.

    Chris
     
    davenn likes this.
  11. CDRIVE

    CDRIVE Hauling 10' pipe on a Trek Shift3

    4,960
    648
    May 8, 2012
    Absolutely. A relay's contacts are rated "Only" when its coil is receiving its rated voltage. When it's deprived of the rated voltage it's contacts ratings will no longer be valid. This isn't critical when the contacts current is very low but it's vital when dealing with current approaching their rated limit. How far below? I don't know, so it's best to feed the coil what the manufacturer expects.

    You also don't need the Base to GND resistor.

    Chris
     
    Last edited: Mar 5, 2016
  12. viel

    viel

    9
    0
    Mar 5, 2016
    hi Chris.
    thank you for the information,

    i've seen the datasheet and searched for the capacitance of 7805 and they suggest to use 1uF to 10uF capacitor but higher value may be used as a power bank.

    i'll try to remove/short first the 1k resistor, but i may leave the 10k b-g resistor, i think this might not hurt.
     
  13. viel

    viel

    9
    0
    Mar 5, 2016
    Hi, i tried to remove the 1k resistor, and this doesn't help but gets worse, the arduino is now resetting.

    i think the problem is the power, but i tried to use separate power source of 12v to drive the relay, but the problem is still the same..
    i also tried to put diode on the +12v going to relay, also diode before the base of transistor thinking that the problem might be cause of feedback current but this doesn't work as well.
     
  14. CDRIVE

    CDRIVE Hauling 10' pipe on a Trek Shift3

    4,960
    648
    May 8, 2012
    I would make your bridge filter capacitance 1000μF. Do you have a scope?

    Chris
     
    davenn likes this.
  15. Alec_t

    Alec_t

    2,724
    723
    Jul 7, 2015
    Do you have a star ground system, so that high currents through relatively heavy loads (relays etc) don't mess up the ground return for the Arduino?
     
    CDRIVE likes this.
  16. davenn

    davenn Moderator

    13,399
    1,790
    Sep 5, 2009
    Which, 1K ?? This is why Chris had the rant about labelling your components on a diagram !
    R1, R2, ..... C1, C2 .... else we have no idea what you are referring to and its difficult for us to describe things


    no it wont ... the diode should be across the relay coil as shown in your first image
     
    CDRIVE likes this.
  17. cjdelphi

    cjdelphi

    1,098
    104
    Oct 26, 2011
    Stick a bigger cap on your 5v arduino, a zener across the transistor... i'm going to have a look into this tomorrow and do some tests
     
    Last edited by a moderator: Mar 6, 2016
  18. CDRIVE

    CDRIVE Hauling 10' pipe on a Trek Shift3

    4,960
    648
    May 8, 2012
    I think this confirms transients are snaking around in there or your 7805 isn't stable. Did you add a small (~4.7μF- 10μF) close to the output pin?
    I really like this comment. Quite frankly I wasn't certain what a "star ground" is until I read your complete reply. I've used this topology but never knew it had an official name.
    Gee! It didn't take very long to prove my point!:D

    Chris
     
    Bluejets likes this.
  19. viel

    viel

    9
    0
    Mar 5, 2016
    hi, sorry for late reply, it was 1AM in the morning before i go to bed waiting for any reply.
    Thank you for reply.

    Hi Cris,
    i'll try to add 1000uF on the output of lm7805 later. btw what do you mean by do i have scope?


    Hi Alec_t,
    i dont know if this is considered as star ground.. i will post an image..


    Hi cjdelphi,
    what do you mean by 5v arduino? near the output of the LM7805 or near the Arduino Board?
    How to put a zener diode across the transistor? do you mean i should change my diode to zener across the relay?

    Here is my device..
    [​IMG]

    My Actual Device.
    [​IMG]
     
  20. CDRIVE

    CDRIVE Hauling 10' pipe on a Trek Shift3

    4,960
    648
    May 8, 2012
    No, the 1000uF replaces the 100uF cap. A small ~4.7uF to 10uF is connected to the 7805 output pin. See? This is why component ID's are important. ;)

    A Scope as in "Oscilloscope".

    Chris
     
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

-