An electronic plumbing device, such as a faucet, has a microprocessor that is
programmed to periodically purge stagnant water remaining in the faucet at predetermined
time intervals. The microprocessor energizes a solenoid associated with a water
valve to initiate the flow of water through the faucet in response to a detector
sensing the presence of a user near the faucet. A first timer is programmed into
the microprocessor and controls the minimum run time of the faucet for activations
initiated by either a user or by the purge feature. A second timer is also programmed
into the microprocessor to measure a second predetermined time interval. If the
faucet is not used during the second predetermined time interval, the microprocessor
will energize the solenoid for the minimum run time to open the water valve and
flush out any stagnant water remaining in the faucet from the prior activation.