0
\$\begingroup\$

I have a simple circuit, pictured below, that uses an Arduino to control two large bidirectional motors via 12V relays. Normally this works a treat, but sometimes the Arduino ends up resetting itself.

I think what's happening is that the motors eat up a lot of power when starting, causing the arduino to have a momentary loss of power wherein it resets. To remedy this, I added a 1000uF electrolytic capacitor, and a 22uF ceramic capacitor. Additionally, I "walled off" the arduino's power/ground planes with 1N4001 diodes so that the motors aren't able to steal charge from the arduino during a power drop.

Looking at the VIN/GND to the arduino, I still see the occasional power drop, but with the diodes/capacitors the spikes are very short and sharp. What's surprising is that these power drops don't always precede a restart as far as I can tell.

My current working theory is that the power drops are corrupting memory or just precipitating instability in the arduino, which is why power drops don't generally immediately cause a restart.

I've spent a few days struggling with this problem, and I'm still completely lost as to what I should do to fix it. I don't understand why there would be sudden loss of power on the arduino when it's walled off with diodes. Any and all help would be appreciated.

PCB top layer PCB bottom layer Voltage drop

Edit 1 Here's the schematic for the motor control. Ambiently relays are on GND, only one is on during a movement. Looking at the scope, I do see some spikes on the gate. I added 10uF ceramic capacitors to the gate lines, but that did not completely fix the restart issue. Motor Schematic

And here is the schematic for the power going to the Arduino. I have a diode on the high side and on the low side. The high side diode is to prevent the motors from stealing charge from the capacitors, and the low side capacitor is to prevent the motors from moving the ground plane. The issue persists with or without the low side diode in place. Arduino Power

I don't think that the issue is from the power side, I can unplug the power and the arduino continues to run for roughly two seconds. I've spent multiple days on this, and I have not found anything that makes this circuit reliable. I'm at a loss for what to try.

Edit 2 I think that the issue is that the relays sometimes arc, which causes EMI that interferes with the arduino. I need an RC snubber to eliminate that, but how do I properly connect such a snubber on my circuit?

\$\endgroup\$
11
  • \$\begingroup\$ Am I correct in understanding you put diodes on the ground plane as well? You shouldn't need that. It probably causes more problems. \$\endgroup\$
    – DKNguyen
    Commented Mar 30, 2021 at 1:05
  • \$\begingroup\$ Certainly sounds like a noise immunity issue either radiated or conducted. Show some data to prove it using very short diff probe or two perfectly matched 10:1 probes on the same noisy signal with a flat line in A-B mode using tip and probe ring only to 4 test holes with a spring probe the it’s ready to use to capture crosstalk, reset spikes or radiated or ground shift., supply glitches etc. Take accurate measurements. Try RF caps, baluns and STP cables. \$\endgroup\$ Commented Mar 30, 2021 at 1:05
  • \$\begingroup\$ DKNguyen, you're correct that I had a diode on the ground plane. I tried without that diode just now, and I'm still getting resets. I believe that it's more frequent than it was previously, but I'm not certain \$\endgroup\$ Commented Mar 30, 2021 at 1:19
  • \$\begingroup\$ Don't just look at motor power draw. Look at those relays too! \$\endgroup\$
    – Abel
    Commented Mar 30, 2021 at 1:26
  • \$\begingroup\$ Abel, yes initially I thought that it was due to the relays, but the system is 100% stable when the motors are disconnected. The thing that I just can't seem to understand is: why do the diodes not prevent that spike entirely? How is current escaping? \$\endgroup\$ Commented Mar 30, 2021 at 1:29

3 Answers 3

0
\$\begingroup\$

Your N FETs are upside down.

enter image description here

Should be:

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
3
  • \$\begingroup\$ I think I just got it wrong in my schematic, on the pcb the source is connected to GND \$\endgroup\$ Commented Mar 31, 2021 at 21:16
  • \$\begingroup\$ Then please post an accurate schematic... otherwise its really hard to troubleshoot.. \$\endgroup\$
    – Wesley Lee
    Commented Mar 31, 2021 at 21:33
  • \$\begingroup\$ Might be helpful: electronics.stackexchange.com/questions/28251/… \$\endgroup\$
    – Wesley Lee
    Commented Mar 31, 2021 at 21:34
0
\$\begingroup\$

With the schematic I see you have diodes in both power and ground.

The one in the ground side is not necessary and is probably complicating how you measure any disturbances because your scope will also be connected to ground. Also it would be better to use a Shottky diode as it has less voltage drop.

It would be useful to have a scope trace showing both the motor power and the Arduino power simultaneously. expand the trace so we can see the width of the pulses to determine the likely cause. (it is better if possible to do a screen shot using the scope rather than taking a photo, it will be clearer).

If the width of the dropout is consistent with the time constant of the large capacitor and the drain of the processor then it is being caused by a power drop-out, if it is very short (nanoseconds to microseconds) then it is likely interference in some other way.

It may be worthwhile setting the brown-out-detector(BOD) voltage to lower than normal (say 2.7V) to give more margin if the voltage does drop.

A number of years ago I designed a similar system. In order to avoid the voltage drops caused by the heavy starting motor load I stepped up the battery voltage to 6V with an LT1949 boost converter, stored energy in a large 2200uF cap) then regulated it down to the 5V needed by the processor (ATMega128). The extra 1V stored in the capacitor allowed it to drop by up to one volt without affecting the supply to the processor, and another 500mV or so before getting to the minimum voltage requirement for the processor. This is three times the margin you get by just putting a large capacitor on the supply.

That system allowed the battery voltage to drop down to about 3V without trouble and could survive 10s of milliseconds with the voltage even lower.

\$\endgroup\$
4
  • \$\begingroup\$ This is very helpful. To clarify, D16 faces the supply, but it's on the ground plane. I've tried removing that diode, but it seems to increase instability. Do you still suggest that I remove it? \$\endgroup\$ Commented Mar 30, 2021 at 2:13
  • \$\begingroup\$ @zeeman_effect - Can you provide a schematic it is very ambiguous just trying to trace the PCB. \$\endgroup\$ Commented Mar 30, 2021 at 14:18
  • \$\begingroup\$ I added schematics for the motor control, and the arduino power \$\endgroup\$ Commented Mar 31, 2021 at 18:50
  • \$\begingroup\$ I only have a small handheld scope with me, unfortunately. The drops I see are very short, so I think that this is due to interference. If so, how would you recommend removing that interference? \$\endgroup\$ Commented Mar 31, 2021 at 22:12
0
\$\begingroup\$

I added an RC snubber around each relay Vcc / GND side, so 4 RC snubbers in all. This seemed to fix the issue.

I believe what was happening was that there was an arc within the relay, which caused EMI that would reset the IC.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.