microcontroller read battery
How much current are you drawing?
This also depends on your battery capacity as well and what type of battery it is
there are lots of factors you have to look at and take into consideration.
EG. 12V 100AH at the 20hr rate will only supply 5amps for when 20 hours before 100% discharge but only 80% recommend (again depends on battery) Car batteries are not meant for heavy discharging, these work by cold cranking amps, The battery I would say you need is a deep cycle type.
So if your load was drawing a continuous load of 15 amps the 100/15=6.66hrs before flat, This is not strictly true the battery will only last 5.30hrs and if it was 30amps then it would only last 2.3 hours.
So carrying on from above you need to check if your battery is capable of supplying the required current for the hours you require,
other factors where are you measuring your voltage from at the battery terminals or at the load end, even if your current draw was 60amps it still would take 1hr before flat.
why not try a 1-5 seconds delay before sounding alarm, you could try and take several samples over 1 or 2 minutes then work out the average from that before sounding alarm
Your cable could be causing some of the problem if current draw is too much have your tried this way measure you voltage at the battery then at your UPS end see what the difference then subtract that from the reading or just calibrate what your reading at the battery end with your meter, Let’s say if your meter reads 12.01V on the battery terminals then at the load end it reads 11.67V then you can take that of in the software or just get your LCD or raw value to what your meter reads,
hope that helps