MOSFET as Switch – High Drain to Source Resistance Voltage Drop – MOSFET ESP32

esp32mosfet

I'm trying to use an IRF510 MOSFET as a switch for my JSN-SR04T ulrasonic sensor connected with ESP32 based microcontroller.

  • The gate is connected to a GPIO pin which outputs ~3.3V and is also grounded with 10kOhm resistor.
  • The sensor is between Vcc and drain.
  • The source is grounded.

When I turn on my GPIO pin, the MOSFET switches on but the voltage between drain and source is ~1.5V, which means my sensor won't turn on (it needs 3.3V.) Shouldn't the voltage between drain and source be nearly 0? What could be the cause?

Best Answer

You are nowhere near driving the IRF510 with enough gate-source voltage: -

enter image description here

3.3 volts is just too low for this MOSFET. Even with 4.5 volts if you tried to take 100 mA the volt drop would be 100 mV. You didn't say what current your sensor took but, at 3.3 volts gate drive, the IRF510 is a poor choice. The words in the data sheet tell this too: -

enter image description here

4 volts gate-source voltage is only guaranteed to cause a drain current of 250 μA.