Maker Pro
Maker Pro

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

viel

Mar 5, 2016
9
Joined
Mar 5, 2016
Messages
9
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:

Alec_t

Jul 7, 2015
3,586
Joined
Jul 7, 2015
Messages
3,586
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!
 

viel

Mar 5, 2016
9
Joined
Mar 5, 2016
Messages
9
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:

cjdelphi

Oct 26, 2011
1,166
Joined
Oct 26, 2011
Messages
1,166
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
 

viel

Mar 5, 2016
9
Joined
Mar 5, 2016
Messages
9
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.
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
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
 

Minder

Apr 24, 2015
3,478
Joined
Apr 24, 2015
Messages
3,478
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.
 

Attachments

  • FET2n7000.pdf
    831 KB · Views: 94

viel

Mar 5, 2016
9
Joined
Mar 5, 2016
Messages
9
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?
 

viel

Mar 5, 2016
9
Joined
Mar 5, 2016
Messages
9
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.
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
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
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Hi Chris.
Thank you for your reply.

My Relay is 12V - 10A 250VAC,
should i try to remove the 1k resistor?
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:

viel

Mar 5, 2016
9
Joined
Mar 5, 2016
Messages
9
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.
 

viel

Mar 5, 2016
9
Joined
Mar 5, 2016
Messages
9
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.
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
I would make your bridge filter capacitance 1000μF. Do you have a scope?

Chris
 

Alec_t

Jul 7, 2015
3,586
Joined
Jul 7, 2015
Messages
3,586
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?
 

davenn

Moderator
Sep 5, 2009
14,251
Joined
Sep 5, 2009
Messages
14,251
Hi, i tried to remove the 1k resistor, and this doesn't help but gets worse, the arduino is now resetting.

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


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.

no it wont ... the diode should be across the relay coil as shown in your first image
 

cjdelphi

Oct 26, 2011
1,166
Joined
Oct 26, 2011
Messages
1,166
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:

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Hi, i tried to remove the 1k resistor, and this doesn't help but gets worse, the arduino is now resetting.
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?
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?
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.
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

Gee! It didn't take very long to prove my point!:D

Chris
 

viel

Mar 5, 2016
9
Joined
Mar 5, 2016
Messages
9
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..
supply.jpg


My Actual Device.
actual.jpg
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Hi Cris,
i'll try to add 1000uF on the output of lm7805 later. btw what do you mean by do i have scope?
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
 
Top