Hello,
I’ve been diagnosing a strange crash problem in my setup and was wondering if it could “simply” be caused by EMI.
I try to control a valve using a logic level MOSFET. The valve is placed at some distance and is connected by a cable of around 12m. A large portion of the cable runs in a cable route along with a lot of other wiring, mostly mains.
-
The first problem I noticed was the valve not turning off properly when the MOSFET’s gate pin is turned LOW. It would either crash the Arduino or turn HIGH some of the other output pins, which would for example light up some LEDs that I’ve connected. Could this likely be caused by my flyback diode not having sufficient properties, like being to slow? I’m currently using a 1N4007.
-
The other strange thing is that the program doesn’t run as expected anymore as soon as the cable to the valve is connected. Problems occur randomly, LEDs begin to flicker or button presses aren’t recognized correctly. And the same thing as described above happens too, some output pins sometimes randomly turn on. I’ve not been able to recognize or reproduce any particular patterns.
Research on the Internet made me wonder if those randomly occurring problems might be caused by interference of the mains power lines that run next to my cable. I think a good indicator is, that when I disconnect the cable to the valve from the main circuit, none of the problems seem to occur. But problems do happen when the cable is connected to the circuit, but not to the valve.
Could you guys give me any advice? I’m especially unsure about the second point.
I’ll attach the layout of the circuit’s part that controls the valve. I use a hydraulic valve with 2W at 24V. Power supply is a switching power adapter rated for 1000mA at 24V. So I don’t think I’m running into power issues. The 5V for the Arduino comes from a L7805CV voltage regulator with two 10uF capacitors. Those 12m indicate where the cable run along with the mains cables.
I use the Arduino standalone setup as described on the Arduino website.
Thanks in advance!