Gas central heating boilers use something similar to control the gas solenoid - the solenoid is fed through a biggish capacitor, which has a diode and a capacitor to "smooth" the pulses from the microcontroller. If the microcontroller output latches itself on, the capacitor charges fully, there are no more pulses, and the solenoid drops out.