look at the sketch below it would need the 12V to be whatever voltage you are using to switch the relay(SS8050 40V 1500mA) and the path from GPIO_16 is what you would need to use as this is high at ESP for Low at 12V/Relay stage......
(Reset/GPIO_16 - this was done for wire adding to the ESP8266-01)
https://raw.githubusercontent.com/gengu ... LL_USE.png
The 800R and 4K7 are reversed on the base of the 12V SS8050/emitter of SS8550.
Hope this helps......
But, the input circuit at base of each transistor can act as pull down before you use pin as output for switching the coil.
This can be the source of problem.
You can simply solve it by adding a pullup to this pin - weak enough to not destroy the pin when pulling it low, but strong enough to pull the voltage up with connected relay module . Then, the pin will be high at power up, but also the relay will be switched on by default, which can be a problem maybe for you ...
Another solution can be small NFet with pul up to VCC at gate connected to the pin. Then, drain of this transistor connect to VCC through several kohm, and also to input of relay module. Source = gnd. This will do both - provide pull up for the pin during boot, and invert input of relay - so it will be switched ON by logic low on pin, leaving the relay off during boot.
I hope it is clear, I do not want to draw it