Issues with ceiling fan relay module and esp32

Hii I am just trying to build a home automation project. I thought I did everything right but it is now messed up. I don't know what happens to my esp 32 but it just resets when I just change the speed of the ceiling fan or just turn it on or off.
After doing a lot of research I ended up getting suggestions to use rc snubber and I would do it, but the problem is I don't what it is or how to install it on my circuit or even what value should I choose for the resistor and capacitor. For a AC 220v 100W ceiling fan.
Please guys help me out I am unable to sleep at night.Please get me out of this.

I think you have some homework to do. Here is a dimmer circuit with a snubber network. The article is pretty good. I used it as a reference for a spot welder I built.

https://www.electroschematics.com/ac-light-dimmer-module-with-zc-detector/

show

datasheet?

I don't have the data sheet for relay but it's just a normal 5v (220v 7A). relay cube connected to esp 32 via bc547, 1n4007, 330ohm resistor.
Here's the circuit of fan and relay.

What is role of ESP32 here in your project?

The gpio pins control 8 different relay cubes

no arduino program (aka sketch)?

PCB Wiring

The screenshot is not readable.
Export your schematic as a pdf and post it here.
Which ESP32 module are you using?

Schematic_rainmaker 8 relay_2023-08-14 (1).pdf (70.8 KB)
I am using esp 32 wroom dev kit v1

There are no current limiting resistors for the LEDs.
The Red LED is basically shorting 3.3V to ground
The resistor value is calculated as follows:
R = (3.3V- Vf)/6ma, where Vf is the LED forward voltage (from the data sheet).

LEDS are not connected currently.

Is there anything connected to P1 through P6
What is the output current and voltage of the AC-DC converter?

5v 500mA

I assume you mean 5V @ 500mA.

Each relay can consume about 90mA so for 8 relays that's 720 mA
The ESP32 can use up to 300mA when transmitting
So the total is 1.02A
That is twice as much as your power supply can deliver.

You should have a 5V @ 2A or more supply

Thanks for that.
I tried it with a bigger power source but even that could not help.
I think I need to use a rc snubber here.
Can you please tell me the values for resistor and capacitor. and one more think how do I connect it

What is the purpose of this snubber?
Where would you connect this snubber?

I think it's time that we see your code
Use the code tags to post your code

I spoke to some people in this field and they suggested me to use a snubber

Cause the problem is only being caused when the fan speed controller is connected, if not everything works just fine