So you want the functionality to implement "disconnect load" and "connect load"?
For that we need full circuit please. And which Arduino?
BTW you need to implement hysteresis with the battery voltage test, otherwise it will oscillate off on off on off on off on - when load is removed battery voltage recovers a bit, causing immediate reconnect, then voltage drops under load, causing it to disconnect immediately - this repeats until the battery has drained till the no-load voltage is below the single threshold.
So the logic needs to be like:
#define BATT_THRESHOLD 11.6
#define HYSTERESIS 0.3 // a total guess, experimentally determined
If (load_connected())
{
if (voltage < BATT_THRESHOLD)
disconnect_load() ;
}
else
{
if (voltage > BATT_THRESHOLD+HYSTERESIS)
connect_load();
}