Arduino turns off when connecting relay to solar collector

Hello everyone ! I am building an automated greenhouse with an Arduino Mega, but I have a problem with the 5V relay module (link in comment)I am using to control two pumps and a fan. I’m powering this whole system with a solar panel, have a VRLA AGM battery (12V/100Ah) connected to the solar controller (to power everything), and I use this solar controller (link in comment) to power the Arduino and the 12V stuff.
This is how the Arduino and the relay module are wired up.

This is how everything is connected to the solar controller.

The problem is that when I connect the Arduino to the USB port of the solar controller and the pumps and fan to the 12V, the whole system turns off and nothing is powered, not even the Arduino. But when I connect the Arduino to my computer (the pumps are still connected to the solar controller), everything works fine.

I know that it is better to power the relay module with a separate power source, for better isolation, but I can’t do that since it is really difficult for me to bring a 5V supply all the way to the greenhouse.

Maybe I’m just shorting everything with my wiring somehow, but I believe my wiring should be correct. It can’t be a common ground problem since the USB port of the solar controller and the 12V output share common ground.

Does anyone know what the problem is ? Thank you in advance !

This is the link to the solar controller I am using.

This is the link to the 5V relay module I am using.

Try to embed the various bits into the forum. People don’t like following random links. Use code tags to post your code. You need to post the specs of the battery as it sounds like you may just be getting a voltage drop as the battery can not provide sufficient current when pumps etc on. I am guessing because I am only using the information available on the forum

Place kickback diodes across the 12V pumps and fan.


Follow ddloyd’s wiring schematic: