Solar power supply overcharge and over discharge protection