A brief summary: I work at a small workshop/factory, and we've got a single three-phase compressor for the whole factory, a week ago the compressor controller flat-out died and that left the entire place without air, which is critical for production.
The compressor has to keep air pressure at a set interval (6 - 8) Bar If it goes to low the machines stop, and if it goes to high the tank safety valve activates and all air goes out. The compressor is relatively simple at an electrical level, just a three-phase motor, a valve to let the compressed air into the tank, and 3 contactors to do a star-delta startup.
Some usefull info: Importing replacement parts/servicing the compressor is a no-go, it is chinesse in origin, with no representative here in my country, and our trade laws make importing a new controller more expensive than just buying a new compressor, (Wich is something we are really trying to avoid as doing so would be seriously expensive, and the mechanical part of the compressor works, it's just the pressure control that's busted)
So to solve this problem I grabbed an arduino UNO and a relay pcb and coded a simple program which manages the star-delta operation, and controls the air pressure valve.
The pressure sensor requires at least 10V to work properly and for that reason there's a 12V switching power supply coneccted to it.
The project works, but it resets randomly, there's no pattern one day it might reset every 15 minutes and another every 3 hours, the conecctions between the arduino and everything else are all done using cables with pins, and the whole thing shakes a fair bit becouse it's mounted on the compressor.
Things i've tryed so far: -Removed both the reset button and the capacitor that allows the Ch340 to reset the arduino. -Soldered a 4700uF capacitor directly to the arduino board, thinking that maybe the connectors where shaking loose and the arduino getting powered down for just a second. -Added an external 5V 5A switching power supply to the arduino, and powered it directly through the 5V pin (not the usb B port)
Finally my question is, does anyone know of any other reason why the arduino could be resetting itself? The only other thing i can think of is something on the ac lines.
I'll show the code if need be, but I'm not using pointers, or dinamic memory or anything that could cause a software reset.
I can't show you a photo of the inside of the box becouse we can't stop the compressor, sorry i forgot.