0
\$\begingroup\$

I will ensure you from the start that I have more than 6 months of googling and tweaking this problem in order to find a fix, but in the end, I have to ask for help.

The system:

I have designed a PCB from scratch to control 3Phase AC pumps for the irrigation systems. Do not think of something complicated with 3phase speed control and things like that no...is very basic but has created me so many problems.

How it works:

Atmega328 activates a relay which closes the circuit of 24V AC for a CONTACTOR, and this contactor closes the 3phase circuit and starts the motor at full speed... and this how must be. In total are 8 relays and 8 contactors (1 is the 3phase ac, the rest of them are high-pressure solenoids)

the circuit: [Simplified]

Text The problem:

At first, the chip gets reset itself by any turn-on of any contactor from the circuit, and I had added snubber circuits everywhere and also on the contactors and seams this problem is solved like 90 % (some times get reset...but not every time...and I had code if it got to start again. so not big of a deal.

The clip is working on Internal 8mhz crystal (because I was afraid of higher frequencies that might get noticed more easily but I don't know at this point)

The new problem:

The system starts the timer is on the screen (LCD 2004 i2c) and some times randomly ....it FREEZE...the chip freeze with all his ports "Active" means...that my pump it will run all the night until morning where I had to manually reset the board....in order to "revive the chip"...

I have refactored the code in a way to have only a timer and that's it (no menu, nothing...the chip still gets randomly) ....the noise from this motor I think is the cause...but I have a bord made by someone with an Arduino pro mini......a relay and screen and NEVER got this problem (and I have 2 years since I am using that bord....) and it didn't have all my "high noise filters" and still works ... Maybe is from atmega328PB... maybe code...

I really don't know...

Thank you for your time, George.

\$\endgroup\$
5
  • \$\begingroup\$ Why do you have an optocoupler if afterwards you connect all the grounds together again? That is no use. \$\endgroup\$
    – Oldfart
    Commented Apr 15, 2020 at 8:32
  • \$\begingroup\$ Yoi don't have all the connections in the simplified diagram. Like the I2C display. Have you debugged the code so that you know it's not stuck in the I2C code? What else you are not telling about the circuit? And the code? \$\endgroup\$
    – Justme
    Commented Apr 15, 2020 at 10:09
  • \$\begingroup\$ If you include photos of your setup, as well as your old (working) and new (problematic) Arduino board, it would be easier for us to see what is going on. We need detailed photos where we can see how is it all wired up and all the filters/capacitors placed to mitigate the problem. \$\endgroup\$ Commented Apr 15, 2020 at 10:16
  • \$\begingroup\$ @Oldfart the design is based on a very commercial relay board for Arduino. \$\endgroup\$ Commented Apr 15, 2020 at 14:19
  • \$\begingroup\$ @Justme I did..all the possible debug. one that proves to be successful was to place the bord at 3-10 meter from the motro...and NO PROBLEMS .... but this is not the solution... \$\endgroup\$ Commented Apr 15, 2020 at 14:20

1 Answer 1

0
\$\begingroup\$

What you are experiencing is interference caused by ground. To reduce or eliminate the noise you could do the following:

  1. Best option would be to have the microcontroller and Relays/other power circuitry not sharing power supply at all and have optical isolation. This would mean you have a seperate dedicated power supply derived from utility and you would not have a common ground/power supply then the one being used for your relays. Many high quality SMPS power supplies like laptop chargers have a lot of filters/noise management circuitry that would even run your micro-controller for a few seconds if utility supply is completely out.

  2. Ensure that on your PCB, you are maintaining distance between tracks that contain Utility voltage, AC and then DC power supply.

  3. If your operation is critical and should run 24hours, you may want to shift to a higher end processor that comes with a predesigned PCB rather then using a microcontroller on a bare metal PCB, this is because usually many such vendors provide higher quality PCB and onboard power power noise management that leads to less chaotic problems like the one you are facing. You may want to explore Prebuilt Atmega32 kits or an ESP32 kit or Raspberry Pi if your budget permits.

I hope this helps.

\$\endgroup\$
3
  • \$\begingroup\$ Hi @Nouman Qaiser 1) unfotunallity i cannot use 2 power supplies, what i have is only 24V AC which i had to use to poweer the bord and the contactors 2) done 3) yes it had to run 24 hours, and the old design done by another business that my client worked use an Arduino Pro Mini, and never had those kind of problems. But also my design is based on that and is made profesionally help by JLCPB... \$\endgroup\$ Commented Apr 15, 2020 at 14:46
  • \$\begingroup\$ A robust solution would always mean having complete isolation of power and signals for your microprocessor, a seperate 5v micro power supply would still be far better then sharing power from your transformer. \$\endgroup\$
    – NoumanQ
    Commented Apr 17, 2020 at 10:17
  • \$\begingroup\$ If its absolutely impossible to arrange for another supply, would have to build one on board by building a buck conveter with very lpw ripple and ample stored charge in the output capacitors. You would need to calculate voltage drop in ground trace to ensure ground potential across the circuit doesnt not vary. You would need physically seperate pcbs for your processor and relays and possibly a metal screen in between. \$\endgroup\$
    – NoumanQ
    Commented Apr 17, 2020 at 10:20

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.