Hi
I designed a circuit with an esp8266, but the contactor circuitry (made up of a triac and optoelectric and uln2003) is not an compatible.
When you turn off the power , you must first re-insert esp8266.
Thank you for your guide
In your first post you talked about
* contactor
* ULN2003
* ESP8266
None of these I see in your circuit.
Nor do I see a clear question. What do you need?
Repeatedly unclear: Do you mean that the uC is burning or that it is resetting and losing the last program sent to it ? To make the question even more puzzling, in the specific case of ESP8266, if you are not using it as standalone CPU but as a shield, depending on how you have uploaded the code, if it was just a script via serial command, the code may have actually been stored on its 'dynamic' memory and have lost on reset. If you want to flash at the 'static' memory, has to use a specific software tool. Anyway, be clear...
You still did not make clear the things, so we can just make guesses; Contactors are devices extremmely inductives, so if you are not providing supressing for damper spikes at the opto, it could get burned, therefore I would expect problems on the MOC, not on the ESP.
Still unclear, you have to review what you write, otherwise no one will be motivated to help you. Anyway, irrespective to what you have posed so far (which did not clarified the issue at all), I would make another guess on what indded is not working: You are using the GPIO2 of ESP8266 which should be pulled-up during reset condition, but the pull-down resistor present internally at the ULN2003 perhaps will interfere on not releasing it from that condition. Keep in mind that this pin, along with others from that microcontroller, can be used as general I/Os, but you have to comply with some constraints during reset event. In addition, the ULN2003 input, given that it made with is a darlington array, may not be able to handle the output of ESP8266, few bellow 3.3v.
Wrong GPIO2 pin-strap sounds like a good explanation. The problem could be fixed by adding a stronger pull-up but it will unfortunately activate the triac during boot. So you better select a different GPIO.
ULN2003 can work with 3.3V input at lower current. But I wonder if the optotriac is sensitive enough to work with only 4 mA?