Have questions about FETS, transistors, measurement, power supplies, or anything else electrical?

User avatar
By Lilithet
#80734 I have two questions regarding the below circuit. first, are their any issues with using the GPIO0 as an input for the switch, and as an output for the optocoupler?

Secondly, The optocoupler (LTV826) is rated for 1.4v max forward current, but while testing them I had to use at least 2.5v to which it pulls 0.3A to get any decent output. Am I using them wrong or am I not understanding the datasheet? I am guessing 0.3A on the ESP is too much, even for a second?


Image
User avatar
By rudy
#80738 VIABLE CIRCUIT? Not at all. I'm surprised at how many things you can do wrong.

You need to have a current limiting series resistor with the LEDs in the optocoupler.

If SW1 is to allow you to go into boot program/upload mode, then it has to be connected to GND and not Vcc.

If SW1 was closed with the circuit as shown the LED will be blown as there is no current limiting resistor. (see above)

The transistor connection to GPIO is backwards. 5 needs to go to GND, 6 to the port pin.

GPIO2 must be high at reset for the ESP8266 to go into the right boot mode. (along with GPIO-0 and GPIO15) If the optocoupler is turned on at reset the board will not start as expected.
User avatar
By Lilithet
#80744 Thanks for the input.

I modified it as follows according to what you said:

Image

The switch is supposed to be a manual activator for the optocoupler, as well as trigger the input GPIO0. Would this work?
Also GPIO2 is not high on reset.
User avatar
By schufti
#80758 You need a pull-up on gpio0 and gpio2 as they both need to be high to boot into user code.
Also rst and ch_pd need a pull-up for the esp to start running at all.