pin 8 - Relay in Pin14 - Acs714 (reading amps charged /discharged) <<<-----how it wired, pin14?pin A5/a4 a RTC ds1307All the above are connected to 5v arduino and gndPin a0 - voltage divider to read batt voltages <<<-----have you ever measure by DMM?
My guess is that it's an earthing problem. If you are powering the Arduino from USB then Arduino ground is connected to mains ground via the PC. Unless the battery in the UPS is floating, one side of it is also likely to be grounded. Assuming you have Arduino ground connected to the same side of the battery, this gives you an earth loop and you are likely to get big transients flowing around it.
The solution is not to connect the Arduino to the PC and the battery at the same time. You can power the Arduino from a battery, or indirectly from the battery whose charge you are monitoring.
The other thing to make sure of is that the Arduino pins that sense the battery voltage and current are protected by series resistance. This will prevent them from damage and SCR latch-up. For the voltage sense pin, just use large enough value resistors, e.g. 10K to ground and ~90k to battery. For the current sense pin, use a series resistor of 10K or more. You could use higher values to be safer (e.g. 10x higher), but then you need to take account of the issues when you switch between reading different analog inputs that are fed from high resistance sources.
the voltage sensor is done by a 10k&1k voltage divider, can you explain me how do i connect that resistor protection ?