2
\$\begingroup\$

I have what I think should be (and, no doubt, is) a very simple problem to solve.

Using an ESP-01 with 3.3v logic, I want to be able to switch a 24v load (500mA max) on and off. The ESP-01 pin has a 10K pull-up resistor on it (it won't boot without the pin being held high) and I need to use this pin to turn the load on when the pin output is programmed low. The 'switch' needs to be on the high side of the load (this is to reduce cabling - I only want one wire to the load which will use a common ground elsewhere in the circuit, some distance away).

I've got as far as knowing I need to use a MOSFET and while I have no problem using an N-Channel MOSFET on the low side and turned on with a positive voltage - if the ESP pin was pulled to ground, I wouldn't have torn all my hair out (!). I am having a real problem trying to understand what I need for this specific problem.

Don't get me wrong, I'm not asking somebody to solve this for me. The problem I have is not knowing where to start looking. I am getting bogged down with holes, electrons and channels which, to be frank, I couldn't care less about. I can't seem to find a definitive "This is the type of device you need" guide. I find what I think is right and then the next page I find says something else or directly contradicts the first page.

So, I would be very grateful if somebody could please point me in the right direction.

Schematic showing a simple circuit with a grey box 'mystery' component

\$\endgroup\$
3
  • \$\begingroup\$ With you load on low-side, you need a P-FET and additional circuitry to shift your gate to reference 24 V rail. How fast/often do you need to switch? \$\endgroup\$ Commented Apr 5, 2023 at 16:51
  • \$\begingroup\$ For the first use case, it'll be switched very rarely - say once or twice a day. At some point in the future, I'll need to build a circuit with the same specification, but to dim (PWM) a light, so probably the ESP8266 maximum of 1kHz... \$\endgroup\$ Commented Apr 5, 2023 at 17:03
  • \$\begingroup\$ A P-channel MOSFET would be the same but upside down. Instead of turning on when the gate is a certain amount above the ground (source) it turns on when the gate is a certain amount below the 24V (also the source). \$\endgroup\$ Commented Apr 5, 2023 at 17:49

1 Answer 1

2
\$\begingroup\$

There are a couple of ways to do this. The first one relies on the ESP booting up and pulling the pin low before the RC voltage rises enough to turn on the NFET. This may affect the bootup behavior you talked about though.

schematic

simulate this circuit – Schematic created using CircuitLab

The other way would be with a PFET and BJT. The base and emitter are both pulled up, so the transistor is off at power up. Then when the ESP is ready, it drives the control pin low, which pulls the emitter low and turns on the NPN transistor, which then provides a negative bias Vgs to the PFET to turn on the load.

schematic

simulate this circuit

\$\endgroup\$
1
  • \$\begingroup\$ The second schematic also cleverly does away with the need to find a suitable 3.3V drive MOSFET, which can trip up people who see 2V threshold voltage on the datasheet and interpret that as a logic threshold. Just make sure the PFET has a maximum Vds < -24V. \$\endgroup\$ Commented Apr 5, 2023 at 18:57

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.