I'm trying to develop some hardware/software project using ESP32-DevkitC-V4 board using wired ethernet connection. For the wired ethernet connection I'm using USR-ES1 board which is based on the W5500 chip. I have one board with the ESP32 and USR-ES1 boards. I'm using one of the GPIO lines to control a relay that switches a lamp. The switching electronics is on a separate board that uses a separate power supply. Following is the schematic diagram for my project:
Everything is working well until I switch the lamp. When setting the control line to low (zero), the lamp is switched off and together with it the USR-ES1 stops working. This happens almost every time. What can be the casue for it?