Method of monitoring voltage of a battery used for electronic lock, involves measuring voltage value of two incidents and storing the average value, and generating an alarm signal once average value falls below a threshold value