Pages: [1] 2   Go Down
Author Topic: arduino hangs when connected to 220v supply through relay  (Read 918 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 1
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


i am trying to control the home appliances through the arduino board. when i connect the led and test it, it works good. but when i connect to the 220v appliances through relay my arduino functions with two or three controls and it gets hangs up and doesnt funtion until i press reset. please help me, where i am wrong.
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As you're not supplying much information, I'm guessing wildly. Maybe the relays draw too much current during activity or produce too much noise. Do you have a schematics of your circuitry? What are the technical details of your relays? Links for them?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 597
Posts: 33314
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Interference from your appliance is probbly upsetting the arduino. Look for things like snubbers or surge supressors to add on to your mains appliance to cut this down.
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you have a schematics of your circuitry? What are the technical details of your relays? Links for them?

its a simple circuit. i am connecting my 3rd,5th,6th pin to led(getting good output). when i connect the same pins to relay and other pins of relay with 220v appliance as switch, it gets hanged up.
Logged

Offline Offline
Edison Member
*
Karma: 5
Posts: 1730
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is it a 5v relay that draws less than 30ma? If not you need a transistor and a diode tp power the relay
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

its a simple circuit.

Simple enough to post, so we can help you?
Logged

Offline Offline
Faraday Member
**
Karma: 80
Posts: 3795
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My understanding based on numerous posts in this forum, is that even if the Ardy can provide the current, it should be protected from any inductive device by a diode....

(Edited a bit, didn't make sense before)
Logged

Although I answer in good faith, remember always: Your Mileage May Vary.
Get me on LinkedIn: za.linkedin.com/in/jimbrownza/

Offline Offline
Newbie
*
Karma: 1
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

here is the circuit.


* ciruit.png (9.74 KB, 617x358 - viewed 36 times.)
Logged

UK
Offline Offline
Shannon Member
****
Karma: 222
Posts: 12534
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You certainly need a diode across the relay to absorb the EMF when you turn it off, and unless the relay coil draws less than 20mA you need to drive it via a transistor.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Offline Offline
Newbie
*
Karma: 1
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

please give me the transistor circuit. i am having confusion with it.
Logged

Offline Offline
Faraday Member
**
Karma: 80
Posts: 3795
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have a look here. About halfway down it explains using a transistor as a switch, as well as the protection diode.
Logged

Although I answer in good faith, remember always: Your Mileage May Vary.
Get me on LinkedIn: za.linkedin.com/in/jimbrownza/

Offline Offline
Newbie
*
Karma: 1
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i am choosing now to use optocoupler to solve the problem. i am using optocoupler pc-817.

here is the sample optocupler diagram.

please help me to use the appropriate resistors to use with it. because i got many different resistors value in using it.

 


* url.jpg (58.95 KB, 800x540 - viewed 26 times.)
Logged

California
Online Online
Faraday Member
**
Karma: 88
Posts: 3356
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is the Arduino trying to turn on/off the light (OUTPUT), or is it trying to read it's state (INPUT)?
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Is the Arduino trying to turn on/off the light (OUTPUT), or is it trying to read it's state (INPUT)?

Arduino trying to turn on/off the 220v appliances
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 597
Posts: 33314
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Those resistor values are a good start.
The LED side goes to the arduino. The transistor side goes to another transistor that then drives the relay.
Logged

Pages: [1] 2   Go Up
Jump to: