So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By GurkanG
#69370 I'm currently running a moisture sensor and a DHT22 (humidity+temp) with my NodeMCU.

I want to add a water pump that runs on 4.5V-6V along with an external battery.

Since there is no 5V pin on the NodeMCU I'm wondering how I can power and control the water pump?

I've got a normal relay that I thought might be of help? Like the one in the image attached to this post.


So my concern right now is one, how do I power everything when connected to the PC and programming/testing.
And how do I power everything with an external power supply?

I've got a 5V 2.1A DC external power supply that has a micro USB connection that I thought I could connect directly to the NodeMCU, but I don't think this will work right? Since it only runs 3.3V.

Any and all help is greatly appreciated!
You do not have the required permissions to view the files attached to this post.
User avatar
By QuickFix
#69394 A relay not only need a higher voltage, but it also draws more current than an ESP-pin can deliver, so you'll have to use a transitor to up the amps, so the say.
Something like this:
Image
User avatar
By schufti
#69408 the additional transistor is not necessary as it is allready on the module (that is the intention behind this modules), the rest is not realy an answer to the TOs questions ...

You can power the nodemcu via the micro-usb and should get the 5V for supplying the relay-module and pump from the nodemcus "raw" pin. But bear in mind that switching relay or a running e-motor can induce a lot of interference to the supply upsetting the nodemcu, so think of decouplig the 5V rail to the module and pump (small inductance and capacitor).
User avatar
By GurkanG
#69409 Thanks for the input guys.


This is where I am today with my setup but it's unfortunately not working.


I believe that the problem might be my mosfet which is an IRF520. I think I might not be able to power it with the vin. Is getting another transistor/mosfet the solution that may help me finish this part of the project?

And if so, what kind of transistor. a 30V 100mA one?
You do not have the required permissions to view the files attached to this post.