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

User avatar
By Joe Job
#49706 OK so this is is not working out :D I have the 2N7000 I have 9v going into the circuit, through a 5v regulator and then the vcc of the relay connected to the 5v rail. I also have a 3v regulator powering the ESP8266-01, ground going to leg 1 of the 2N7000, pin 2 of ESP8266 going to leg 2 through 47k resistor, leg 3 going to IN on the relay and ground of the relay to ground. Cannot get this working any suggestions which way to go with this set up ?
User avatar
By martinayotte
#49707 You're 47K should not be in series, but pulled down to get a turn Off state, in case GPIO pin is floating.
Image
But since you are using GPIO2, the above won't work due to boot process, you will need a second stage MOSFET to invert the logic, because GPIO2 need to be pulled up.
So, with 2 MOSFET, it should look something similar to that, except that T2 would be a MOSFET and the GPIO2 Pullup is not shown here :
Image
User avatar
By Joe Job
#49708 Thanks I am having difficulty getting my head around the schematics, could you do me a favor and say in words how my current setup needs to change as in the actual steps to solve the issue.

I tried to give a break down of what I thought the first schematic was but didn't get a reply so I am still unsure of what I am looking at.

There is no Arduino out on my circuit, I am guessing that this the GPIO2 pin ?

From there a 1k resistor into the middle leg of the first mosfet?

The right leg to ground?

Left leg to a 10K resistor then what is the 12V?

Also left leg to the 2nd mosfet? It looks like this connection goes to all legs of the 2nd mosfet?

The left leg of second mosfet to the relay and the right to ground?

Sorry if this is a bit of a pain but I am trying to understand what I am seeing.
User avatar
By martinayotte
#49709 Here is the 2N7000 pinout :
Image

So, No, the right pins (Drain) should not be connected to GND, it should be the left pins (Source).
(so, maybe that was your wiring problem)

The R2 on previous schematic is not needed with MOSFET (it was there only in the case of a NPN transistor), so the gate can be connected to GPIO2 directly as long as you have the PullUp for boot process (not shown here).