A medical device includes an array of electrodes, configured for implantation in contact with tissue in an eye of a living subject. Driver circuitry is configured to drive the electrodes in an alternating pattern, such that different groups of the electrodes are driven to stimulate the tissue during different, predetermined respective time periods. A power sensor, may be coupled to deactivate a first group of the electrodes when the available electrical power drops below a predetermined threshold, while a second group of the electrodes remains active. Other embodiments are also described.