Go Down

Topic: Urgent help needed - relay with load resetting Arduino (Read 2616 times) previous topic - next topic

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

CrossRoads

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

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.

http://www.punchlight.com/files/relayLEG-5_datasheet.pdf?PHPSESSID=b74e7ea0c06bd20c0a795c669e2ca461

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..

CrossRoads

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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

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.

CrossRoads

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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

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.

CrossRoads

I don't see any part numbers, how do you tell what's what?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


CrossRoads

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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

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.

CrossRoads

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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

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!

CrossRoads

Clarify away.
Or, start your own topic with your specifics.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up