RA0 and RA1 are adc inputs which measure battery voltages. You have to connect it to battery as shown (by scaling 15V to 5V for adc input). Here 5V adc input means battery voltage is 15V.
Yes, but precise voltage is needed. I know 0.01 volts variation doesn't make much difference but anyway I will modify the code and post a new version tomorrow.
Why 20.46V when battery voltage doesn't exceed 15V?
I think you can use adc in pic16f877a to check the status of battery. The battery voltage will reduce according to its charge loss. Also you can check whether the battery is fully recharged while charging. The 12v must be reduced to below 5v using voltage dividers before connecting to the adc port of pic .
sir, I am placing the device in breedboard for testing and I found out that the 4n28 can't trigger the 12 volt supply for the relay and i found out that no voltage in the relay side I am using QTC 4n28 0034K