Urgent help needed - relay with load resetting Arduino

Hi everone,

I have a Arduino Mega2560 with Ethernet shield that is controlling a 5V relay to drive a 12V solenoid used for electronic lockers. The Arduino is powered by an external 12V power supply, and the relay (driving the solenoid) is powered by another 12V power supply. The relay is powered by the 5V from Arduino. Without load (i.e. solenoid connecting to the relay), everything works fine. I can hear the relay clicking. However, with load (i.e. solenoid connecting to relay), the Arduino is reset when the solenoid is turned OFF. It's as if there is a big current surge hitting the Arduino when the solenoid is turned off, but there is already a diode on the coil side of the relay. I also measured the voltage across 5V and 12V rails, and there is no change.

Any advice is much appreciated. This circuit is for my store that is already open for business, but the customers can not retrieve their items due to this problem.

Thank you,
George

Schematic & link to parts used?

Thanks for the quick reply. Attached is the schematic for the customized 8-relay circuit. Each relay requires two inputs from the Arduino (I am using shift registers to make a row-column matrix to control 256 lockers). Below is the datasheet for the relay.

Everything works, except when the solenoid is connected to the relay (connector J) and is switched on and then off - that's when Arduino is reset..

Protel Schematic.pdf (23.8 KB)

Some of the diodes show clear a connection at pin 5 of the relay to the shunt diode's anode, some do not.
Are actually connected?
I do not understand why you have the 2nd diode from Vcc to the collectors.
Seems like all they would do is add extra load when the relay is energized.

Good observation on the diode to pin 5. It was a mistake in that layout revision, and was corrected by hand soldering on the PCB. Regarding the extra diode to the collector, it is solely for visual notification, so we know which row/column matrix is turned on. Thanks.

So the "extra" diode is really an LED then?

"The relay is powered by the 5V from Arduino."
The 5V relays require 72mA of current. You have no caps near the transistors or relays. That's a decent slug of current on the 5V line.
Try putting 10uF caps and 0.1uF caps from Vcc to Gnd near the relay pins 4.

Yes, it's a LED.

Will try the cap tonight and report back. Just to confirm, do I pop 10uF caps or 0.1uF caps at pin 4 to ground? Thanks.

After spending the past six hours debugging, I think I may have narrowed down the culprit. I don't have 0.1uF cap in hand, so I used 0.33uF cap across Vcc and GND at pin 4 of the relay. The problem still persists. Then I stripped down my code, removed the Ethernet shield, and just have a command-line turning on/off a specific relay. That's when I found out that the culprit may be the shift register matrix I am using to control the relays. Attached is the schematic of the shift register matrix, which consists of two shift registers for the 16-bit row and two shift registers for the 16-bit column. If I connect the solenoid to the relay, all 16 row LED's on the shift register matrix are turned on after the relay is turned off. So I added 0.33uF across the Vcc and GND on all four shift register IC's, and added a pull-down resistor on the latch pin of all four shift registers. Now instead of all 16 row LED's turning on when the relay is turned off, the serial port receiving stops working (I can still type to turn on/off the relay). So it is more stable now, but still some interference.

Any suggestion on what to try next? Thanks.

shiftRegister.pdf (54 KB)

I don't see any part numbers, how do you tell what's what?

Sorry, it's SN74HC595N, 8-bit shift register. http://www.ti.com/lit/ds/symlink/sn74hc595.pdf

Okay, assume you have OE/ low and MR high and not floating.

Am confused by this:
"the serial port receiving stops working"
How's that tied in?

You have quite a load on the '595 outputs also.
Looks like an LED with 2-3mA, and 16 transistors with ~4mA each, total of ~70mA on each IO.
Part is only rated for 5V output for 6-8mA, and 70mA for the whole part.
I could see drive issues there causing some of your problem.

Yes, OE is tied to ground, and MR is set to high. The serial port is connected to pin 0 and 1 on the Arduino and to the PC.

At any time, only one relay will be enabled, so two transistors and one LED. I can remove the LED to see if it helps. Please keep sending any suggestions you may have, and I will give it a try. I am desperate here. Thanks.

I can't think of anything else. Time to get a scope and look at signals to see what is actually happening.
Can be an inexpensive thing like this which I use
http://www.pdamusician.com/dpscope/
altho it looks like it's out of stock at the moment.

Hi guys,
have you ever managed to fix this issue?

I have a similar problem with a relay, car horn, and big 7-segment display all turning on during the time the horn is active!!

If you still read this thread I can give more clarification on the problem!

Thanks!

Clarify away.
Or, start your own topic with your specifics.

gion86:
Hi guys,
have you ever managed to fix this issue?

I have a similar problem with a relay, car horn, and big 7-segment display all turning on during the time the horn is active!!

If you still read this thread I can give more clarification on the problem!

Thanks!

I did not resolve the shift register issue because it was just too unstable. I moved to a different solution of using an Arduino Mega, which gave me enough digital I/O's to construct a 25x25 matrix relay controller. It's been running fine over a year now.

I have been developing a basketball scoreboard with Arduino UNO r3 and Big 7-segments displays:

http://www.sureelectronics.net/goods.php?id=721

Here you can find more information if you are interested:
http://code.google.com/p/display-group/
https://plus.google.com/photos/109652469005118520122/albums/5799213099932281809

I am using this power supply:
http://www.ebay.it/itm/300761494964?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649

I decide to user a car horn to signal the end of the period, like this one, at 12v 5a:
http://www.ebay.it/itm/310690188112?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649

This board with a relay and a phototransistor has everything i needed, and is controllable directly from Arduino:

The board is powered from Arduino (5v and GND) and output 8 is used to switch the relay. Arduino power also a small controller with 12 buttons to control the scoreboard, using 3 analog inputs, as you can see in the electrical layout I have attached. (I am not a professional so the layout is not perfect: I used the most similar symbol for some components.. like the display).

If I trigger the relay without a load everything goes well (I can hear the relay click), but if I connect the horn, as soon as it is turned on, and for all the time it's on, all the displays visualize "8" (all the segment are turned on).
When the relay switches the horn back off (after a time from the cpu), all the displays show the correct digit again. So it obvious that the cpu did not reset.

I have heard that I should decouple the power line of the horn from the reset of the circuit, because of some spikes at the relay activation.
The whole circuit is working pretty well, but I would like to use the horn without having the display going crazy! XD
Do you have any ideas?

Thanks in advance!!

Main.pdf (40.9 KB)

Main.sch (246 KB)