Go Down

Topic: Powering a 3V pump with a digital pin on NodeMCU (Read 196 times) previous topic - next topic

TacticalBacon

Hi, I have a problem with powering up a small pump (3-6V) with a digital pin on NodeMCU ESP8266 V1.0 ESP-12E. When I connect it directly to 3V3 and GND pin it's working but not with D1 and GND.

Code: [Select]
int pin_pump = D1;

void setup(){
    pinMode(pin_pump, OUTPUT);
}

void loop(){
    digitalWrite(D1, HIGH);
}




I have tried using MOSFET and it's work but I don't want to increase circuit size and it seems impractical to use MOSFET on the same power source. So I am wondering if there an easier way to make this works.

wildbill

Transistor is the answer as you have discovered.

Look up how much current your device can source on a digital pin. If it's anything like Arduino, it'll be a pitiful amount compared to the needs of your pump. It's like trying to power an Apache longbow with a lawnmower engine.

MorganS

Imagine your pump is solar powered but the only light you have is a single indicator LED powered from the D1 pin.

Yes you need a MOSFET. My favorite tutorial is https://www.electronics-tutorials.ws/transistor/tran_7.html

You need to find a "logic level" MOSFET to use the 3.3V control signal. Regular ones require 10V minimum.
"The problem is in the code you didn't post."

wvmarle

Most logic level MOSFETs don't switch at 3.3V. You need one that's designed for low voltage.

PMV16UN is my go-to MOSFET for use with 3.3V logic levels. Inexpensive, switches up to 8A or so, but only available in SOT23.

Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Go Up