1
\$\begingroup\$

I am designing a PCB that uses an ATMega8A MCU to switch two high power relays (Songle SLA-12VDC-SL-A). I have used 2 separate approaches with the same disappointed result: the ATmega8A will reset as soon as either of the relay engages, even with no external load.

To eliminate the possibility of EMI caused by the relays’ coil, I have done an experiment with the same setting using an external Arduino UNO powered by the 5V from the PCB. The result is the same: the UNO resets even when it’s like 50cm (1.5 feet) from the relays.

So I reason that it may be because of the power supply, but I have used the LM2576-5V in many project and it’s very reliable. Also ground paths of the signal side and the relay side are separated. 12V and 5V power lines are also separated. Please see the photos.

Approach 1: use Optos to isolate the relays and switch them by a transistor

Approach 2: like 1 but the opto+transistors switch smaller relays (Songle SLA-05VDC-SL-A) which in turn switch the big 30A relays.

So I am at my wit’s end as to how to use these 30A relays. I saw some commercial relay module that use the same relay and though I don’t have the schematic, I can see that they just use an opto and a transistor, just like in my first approach. Or is it the ATmega8A to blame? I remember hearing somewhere that it’s very sensitive to noise.

I’d appreciate any advice!

Dave

UPDATE 1

Please see the complete Eagle schematic and board for both approaches here: https://drive.google.com/open?id=0B_JjLISYz2JHM0t4SzBaQkhZUEE

UPDATE 2

I have added the schematics in PNG for your reference.

UPDATE 3 Attached is my re-design incorporating your advice so far. Here are the changes: - Since I don't use the 5V relays to switch the 12V relays anymore, I shrank the board to fit a smaller enclosure - No more optos, the relays are switched by BJTs connected to MCU - BJTs resistor value has been changed to 470R - BJTs are close to their respective diode and the coils' pins - More ground vias - Added a 100nF at the AVCC pin of the Atmega8A - There are 2 separate pairs of GND planes: the upper pair (top & bottom) is for 12V and the lower pair is for signal. They meet at the point where battery GND is connected - BJTs' emiters are now part of the 12V GND plane

Please let me know if you have any further advice, before I have this fabricated and see how it goes. THANKS!

Approach 1

Approach 2

Relay enter image description here enter image description here

NEW DESIGN enter image description here

\$\endgroup\$
  • \$\begingroup\$ Few comments: 1) there's no point of using an optocoupler if you then share the grounds 2) 1kOhm base resistor might be too high for the 185-mA coil current, to achieve a good saturation 3) put the BJT on the top part of the board (i.e. where the diodes are), so that the emitter current won't flow in the very thin blue GND track on the left side... 4) Just as a double check: did you mount the diodes correctly (i.e. as shown in the layout) ? Can you post a picture of your board too? \$\endgroup\$ – next-hack Oct 7 '17 at 7:25
  • 2
    \$\begingroup\$ Time to attach a scope and measure things \$\endgroup\$ – PlasmaHH Oct 7 '17 at 7:56
  • 1
    \$\begingroup\$ SMPS layout isn't very good, take into account the loops on the switching node. Use planes instead of traces. The diode, inductor and cap should be as close as possible. Also, your crystal shouldn't be that far from the MCU, but as close as possible. You should really take a look into some reference designs on some datasheets. \$\endgroup\$ – Wesley Lee Oct 8 '17 at 3:18
  • 1
    \$\begingroup\$ D4 is so far from the inductor, connected by a thin trace. The inductor is just besides the crystal, which is still far from the MCU. You have more bypass caps, but the connection is still through long-ish traces and then to inexistant planes. The vias you are using are so large, you have barely any space left for proper planes/traces. Look at page 3 on this pdf, it has a nice comparison of good vs bad layout for SMPS. I'm focusing on power supply but the principles should work for the rest as well. \$\endgroup\$ – Wesley Lee Oct 8 '17 at 9:33
  • 1
    \$\begingroup\$ @Wesley Lee : I take note of your kind comments. Will study the datasheet more carefully & PCB layout and redesign this thing. I may also change to the XL4005 regulator. Will study both. Will keep you updated! \$\endgroup\$ – Dave Oct 9 '17 at 1:30

protected by Community Jun 24 '18 at 15:53

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Browse other questions tagged or ask your own question.