Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By HolgerW
#6480 Hi,
i create a little wlan relay with ESP03, take a look here http://www.mikrocontroller.net/topic/349219 and http://www.mikrocontroller.net/topic/349219#3938252
I used a small round transformator 12V and Polulu 3,3 V step down converter.
For the "Wifi Socket" i used a Recom 3,3V 0,9A AC/DV converter (230V / 3,3V).
The Mosfet ia s npn IRLML2502 wirthout gate resistor, in first case with a 12V relay, the second one is a 3,3V relaiy with a antiparallel diode.

Holger
User avatar
By ChrixXenon
#6713 Do you initialise the GPIO to be low or high impedance? If the GPIO is high initially, then it could be energising the relay, and if this draws too much current for the supply, then it might be causing that to droop, which might cause the boot instability you describe. You could put a volt meter or preferably a scope on the power lines and see if they stay stable.
User avatar
By markbee
#7181 I'm currently trying to drive a load (~>10mA/ 5V) with the ESP-01 on GPIO2 either with a transistor or a mosfet. The problem is - as already discussed here - that GPIO2 seems to be (internally) pulled-up at startup of the module, before executing the code (in my case a lua-webserver on NodeMCU) - so that I have a high signal on the base/ gate and thus a high signal on the load at startup.
Are there any ideas how to prevent/ circumvent that or do I have to write the code in C to initialize the GPIOs when booting from ROM (is that possible anyway?)?
Or should I switch to another module type (I have ESP-05 and ESP-12) and are the GPIOs all pulled-up while booting the modules?

markbee
User avatar
By peteben
#7293 That really depends on your application. What are you trying to switch?
GPIO2 will be set as an input while the chip boots, and needs to remain pulled up to run user code. After user code starts, you can do whatever you want, though.
Since you're talking 5V and the chip runs at 3.3V, it's clear you're going to need atransistor or a FET to switch your load.
If you are just driving a LED, a short (20ms) flash at bootup is probably not critical. You can write your own firmware in 'C' or modify the 'AT' firmware to ensure GPIO2 goes low as soon as execution starts.
If it is but timing on your output is not critical, you could add a capacitor that would 'eat' that 20ms pulse.
If you can't do anything else, a pair of transistors will probably be necessary to invert the output and drive the load.

Pete