5V water pump not working properly when powered through a Wemos relay shield

I built a plant sensor that should simply pump water when soil moisture (measured with a capactivie sensor) is too low.

I am using a relay to turn on/off the 5V water pump. The pump turns on and works perfectly when I connect the pump to the 5V pin of the Wemos D1 mini.

However, when the electrical wires go through the relay wemos shield, the pump just emits a light sound like there is not enough current and so it does not work when the relay is on. If I start to play with the wires like moving them or taking out and then in from the breadboard, I can observe that sometimes the pump starts to work slowly.

I am very noob in electricty and circuits but to me looks like there is not enough current arriving to the pump when connected through the relay.

Would you know a way to solve this issue?

I am using the same electrical source to power the wemos and the pump because I saw a youtube video of a guy who built exactly the same project with the same components. In the picture I use a 2A power bank but I also used a 3A power adapter that I usually use to power a raspberry pi.

Can YOU tell, from that picture, what is connected to what? I can't.

PaulS:
Can YOU tell, from that picture, what is connected to what? I can't.

I tried to attach a schematic. Sorry it is my first time with arduino and these things.

Hi Garret88,

You should draw the WHOLE circuit to avoid unnessessary unfriendly answer here, and the code you are using just to be sure the logic is ok.

Main consern here is, how are you feeding your motor, where does the power is coming to relay's switch. You can't take that power throught wemos, current won't be enought for all.

And when you show us your code, use tags, or othervise...
:wink:

Have a nice day!

Cheers,
Kari

Hi GaryP, thanks a lot for your answer. It is true, I forgot to draw that I am feeding power only to the Wemos D1 through its usb connector.

So I attached the power adapter to the wemos and thus the pump in that schematic will receive power from the Wemos.

It is true it is missing the schematic of the moisture sensor or of the distance sensor, but also removing those sensors and leaving that schematic I get the same result.

I loaded Tasmota on the Wemos D1, so I control the relay on and off through the web interface.

I hope I answered all the questions now :slight_smile:

Well, no, I didn't really understood your answer.

You should connect SEPARATE power supply for the motor, throught the relay connectors. Try that first if your relay works normally without motor connected.

Cheers,
Kari