Do I need to add a battery or a capacitor somewhere to ensure the relay has enough power to stay on or remain off when there isn't enough power overall? Is there a way to reserve enough current to power the relay and buck converter?
Short answer: the simplest solution is to (1) add a battery, (2) add a battery charging controller, (3) remove the "10V switch", and then wire the system such that:
- the solar panel charges the battery through the battery charge controller.
- the battery supplies the buck converter via the "relay" you already have.
The rest of the wiring is as you have shown it.
Battery Selection
You may be tempted to use a lithium battery, but I would recommend starting with a sealed lead-acid battery ("SLA"), rather than a Lithium battery, for the following reasons:
- lower cost, wider choice, commonly available.
- lower risk of fire/explosion.
- more robust against physical and electrical stress.
- more robust against high temperatures.
Once you have gained some experience with SLA, then perhaps consider lithium batteries later, and see if the benefits outweigh the costs and hazards.
Battery sizing: if I understand your application, it seems you don't need the pump to operate independently of solar power for long periods; perhaps a 30-minute run time at full power is more than enough. The pump datasheet says that the maximum current draw is 2A at 12V, so that means a 1A-hr battery would be sufficient. The smallest battery I found on Amazon was 4A-hr, there were several options of 7A-hr, here are a couple of examples:
https://www.amazon.com/dp/B09V4GVNYQ/ref=syn_sd_onsite_desktop_0?th=1
https://www.amazon.com/ML7-12-Battery-Mighty-Brand-Product/dp/B00K8V30D0/?th=1
Battery Discharge Protection
The "relay" you listed: more accurately, this is a Low Voltage Protector Disconnect Switch, which is intended to protect a battery from being excessively discharged. It does this by disconnecting the load from the battery to prevent further discharge when the battery voltage falls below a user-programmed threshold. It is not intended to serve as a battery charging controller.
Battery Charger Controller
The solar panel you listed: this does not include a "controller" which is the word used to indicate a "battery charging controller". I suggest you select a suitable battery charging controller recommended by the vendor of the battery you choose, since the controller should be chosen to suit the battery, rather than the solar panel. Of course, yes, the solar panel should suit the charge controller also, but the primary concern is to ensure the battery is correctly charged and is protected from over-charging, and over-discharging. Here are a couple of controller options to consider:
https://www.amazon.com/Controller-Intelligent-Regulator-Paremeter-Adjustable/dp/B08L8TBCK6/?th=1
https://www.amazon.com/Controller-Intelligent-Regulator-Paremeter-Adjustable/dp/B0C9LHNGX2?th=1
The other option is to replace the solar panel with one that includes the battery charger controller, here is one option that may be suitable:-
https://www.amazon.com/dp/B079JVBVL3?th=1
Battery Ripple Current Filter
The buck converter you listed: the datasheet for this is not clear about how well the input current is filtered. Input current to a buck converter can be very "chopped", which may cause electrical interference, and may also damage the battery. I recommend placing a "pi" filter (also known as a "C-L-C filter") between the battery and the buck converter input, placed close to the input of the buck converter. Here is the schematic of this filter:
source: https://diyguru.org/term/what-is-a-pi-filter/
I have not been able to find a suitable C-L-C filter on Amazon. But you can get the components (inductors and capacitors) quite easily, and these are very easy to assemble (with a soldering iron and some wire). The trick is how to select the components - perhaps that is a topic to discuss in a separate question/answer.
Of course, all of these product suggestions are suggestions only, please do your own due diligence to ensure they are suitable for your application: