Pages: [1]   Go Down
Author Topic: Relay Controller - Crashing?  (Read 450 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using a duemilanove to control 4 relays. I've a typical relay board.. All 5v relays 2n3904 transistors

I basically used the design on this page except I'm using smaller resistors, like 200ohm I think. My relays require less current as well and are NC.
www.glacialwanderer.com/hobbyrobotics/?p=9

I've also got it connected to a ethernet shield on my home network.
The problem is that it seems like after I switch 2 or more relays the whole thing crashes. By that I mean the arduino completely resets, I gotta wait for the ethernet shield to reinitialize before it'll accept communication, etc.

I'm powering the unit with a 12vdc 1a source. It doesn't just crash on my code either. I ran standard firmata and after the 2nd relay was triggered it became unstable.... Sometimes it never crashes, sometimes immediate, sometimes a few minutes. Always after I've triggered at least 2 relays though. It's indiscriminate of which relay I'm triggering.

Any ideas what might be causing this? I can post more details on circuit if needed and/or the schematic.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 223
Posts: 6593
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

1. Does the problem occur only when you have loads connected to the relays (in which case, what are the loads?), or does it also occur if you disconnect the loads from the relays?

2. Are you using the exact same code as on the page you linked to? If not, please post your code.

3. How much current do your 5V relays take?

4. Is the 5V regulator on the Arduino getting too hot to touch when you have several relays activated?
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

0
Offline Offline
Shannon Member
****
Karma: 198
Posts: 11625
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Datasheet or details for the relay and power supply?

Using an 1N4004 as flyback diode isn't ideal, its a slow diode, something like
a fast rectifier or schottky diode would be better.

Without an oscilloscope its hard to debug something like this, but I'd first suspect switching
transients on the mains going straight through your 12V supply (is it cheap PSU?)

I'd also add decoupling across the relay drive circuit (between 5V and GND at the coil terminal
and transistor emitter, perhaps 220uF).
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yea only occurs when there's load.

I've factored out the code already - using standard firmata to trigger the outputs has same effect.

I'm using G5LA-1-DC5 for my relays
http://components.omron.com/components/web/PDFLIB.nsf/0/4F7D9D9CA026C97E862573930070AC4F/$file/G5LA_E_0911.pdf

* 5vdc coil voltage
* 5a coil rating
* 69.4ohm Resistance
* 72mA current

I'm using 2n3904 transistors, 200ohm resistors (I think), and more likely 1n4001 diodes.

I'm hoping to have time this weekend to debug it. I am using a cheap walwart power source too.
I'll try swapping out the psu tonight. If it's still fail I'll probably salvage the relays and redo the whole circuit.


Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 223
Posts: 6593
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The 5V regulator on your Arduino is probably overheating and going into thermal shutdown. You're trying to drive 4 x 72mA relays (288mA), plus 4 x 20mA base current for the transistors (80mA), plus about 55mA for the Arduino itself. That's around 420mA, Multiply that by 7V drop across the regulator, and you are asking the regulator to dissipate about 3W, which is too much for it. You need to reduce the input voltage to about 7 or 8V, or use an external 5V regulator or 5V power supply that can supply that amount of current.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Pages: [1]   Go Up
Jump to: