I'm a hobbyist, and never got past the datasheets/tutorials for FET transistors; I'm a BJT man. I never found discussions dealing with BJT vs. FET and specific applications best suited for each type. My projects are very simple switching and logic gate style circuits. So once I got BJTs to satisfy a project's requirements, I just stayed with what was working. I have spent the afternoon researching this on EE-SE and found lot's of good stuff. I found that FETs seemed to the more popular choice for level-shifters. I was hoping someone could provide a "for dummies" explanation regarding the strengths/weaknesses and trade-offs involved with FETs and BJTs in some common applications.
I chose this level-shifter for my project:
I want to drive a 5V relay using an ESP8266 which has 3.3V GPIOs. I measured the relay's coil current to be right about 100mA. I want to use an S8050 and a minimum of parts, requirements are not high. I'm just using the ESP8266 to read the pin on a PIR sensor and also read some toggle switches to control a light using a relay. Is the above circuit a good choice? I designed my own circuit, but am not going to use it. Still, it would help my understanding if someone would kindly provide an analysis of my design, which was based on some hunches, guesses, and perhaps a bit of voodoo.
Just briefly, I reasoned that my base-current (GPIO output 3.3V – 0.7V base of Q1) / 1K ohm of R2 = 2.6mA would not be affected much by the current in the voltage divider R1/R3 which I think is 5 / (100K +100K) = 25uA. I don't know how the junction of R1, R2, R3 and U1's base will work; I guessed that the base of U1 will pull the 2.5V of the divider down to 0.7V, but wasn't sure how it would affect the 2.6mA that the GPIO sources. That's why I went with the circuit I linked.