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

User avatar
By zouje
#79611 Hi,

I am using a Wemos D1 Mini (Cheap clone) to control a 5V Songle relay. I have pin D4 set as an output and it is connected to the Base of a 2N3903 NPN BJT, through a 1KOhm resistor. The Emitter of the BJT is connected to ground, and the Collector is connected to +5V through a Songle relay coil (I measured 70Ohms for the coil). I also have a flyback diode across the relay coil.

When I RESET the Wemos board, even without commanding the D4 output, the D4 pin, as well as the 3.3V pin oscillate between 0 and 3.3V. This happens also if I keep the Collector unconnected to anything.

Does anyone have an idea about what the problem might be? I did some tests on the side, and with this setup, the BJT should consume about 2.5mA at the base (3.3V through 1KOhm resistor to the base). So even though I am using a cheap Wemos with a crappy 3.3V regulator, 2.5mA *should be* low enough not to cause any trouble.

Any help would be appreciated!

zouje.
User avatar
By zouje
#79635
schufti wrote:D4 == gpio2 and this (as is D3 == gpio0) is known to oscillate during boot.


Hi schufti, thanks for your reply! I will try with other pins. However, the oscillations are sustained, ie. it keeps oscillating until I disconnect the BJT and RESET again. Fingers crossed!

Thanks
User avatar
By rudy
#79639 GPIO0 and GPIO2 must be high in order to run from the user code in flash. If either of those lines are low the ESP8266 will not work as expected. The load to ground can screw up the boot.

Also, this will explain the unexpected operation of the port pins. https://www.mjt.me.uk/posts/esp8266-gpi ... and-reset/