I am using a voltage divider circuit to control the speed of the AC Fan. Instead of using a relay, I am using a TRIAC for switching. The switching is controlled by ESP32 through an optoisolator(MOC3043). According to certain references from google and youtube, I discovered that we need to connect 470 Ohm 1/4W resistor at pin no 6 of the optoisolator. But when I switch the TRIAC for operation the 470ohm resistor burnt completely and it is happening to all the resistors. Can someone help me with this problem? Thanks in advance.