Signal Noise on relay module
Hello to everybody,
I have a problem I can't solve with an STM32 H7 board.
I wrote a little app to command a solenoid valve (24V, 200 mA). It's very simple, I have two software buttons for opening and closing it, using a relay module.
Testing it, everything worked well, but when I connected the valve, I noticed a strange behavior: it worked one or two times, then the valve stopped to follow the commands.
So I reset the board, but it restarted in the same way (one or two cycles, then buttons stop working). I suspected bad contacts, for wrong code cycles... but I understood it was caused by the USB connection. When the valve is active, I lost (sometimes immediately, sometimes after some cycles) the communication with my PC!
This is the scheme:
3.3V to relay module Vcc
5V to JD-Vcc
Common ground to GND
GPO to Input signal
So I start some tests:
1) Power (+24) was connected to relay, Ground (-) is direct to the valve, both from an external power supply.
2) I connected the +24V to NO poles, ground to the valve, and I checked if there was any current to signal (GPO) pin, I measured 0V
3) I placed an open/close loop in firmware, to check the USB port: valve works perfectly, but the USB communication broke in a brief time.
4)I connected Ground to relay, and +24 directly to the valve
5)I placed some ferrites
6)I connected the valve ground valve to the main electric ground.
no result in any way. I noticed that the USB disconnected above all each time the relay is opened. I think it's caused by noise/EMI disturbs, but someone can suggest me a possible solution to solve this problem?
