logoalt Hacker News

ErroneousBosh • today at 8:39 AM • 0 replies • view on HN

This is how the gas valve driver in your heating boiler works - there's no way anything can actually cause the valve to stick on because it's driven through a capacitor. The microcontroller pulses the valve signal at a few Hz, and it effectively works like a charge pump.

If the output sticks low, no biggie, it's low, the valve is off.

If the output sticks high, no biggie, the drive capacitor will charge in a second or so and pass no more current to the pump capacitor, which will discharge and shut the valve.

> With a direct drive, the flip dort magnet wire could quickly burn through if you leave half an amp for too long.

Quite often you see solenoid drivers that avoid that with PWM. The airbag driver pack in my old Range Rover does this, as did the Hydractive suspension controller in my old Citroën. In the Citroën the microcontroller directly drove a Darlingon transistor to turn the solenoid on to open valves in the "cross feed" pipes in the suspension. Because that needs to switch quickly against a high pressure hydraulic feed, it needs a lot of current, but because "soft mode" with the valves open is the normal mode for the suspension with the solenoid energised you couldn't leave that current on for a long time.

So what it did was it pulsed the solenoid on for about 250ms and then pulsed it at 50Hz or so, audible as a faint buzz under the car somewhere when everything else was off and clearly audible at certain frequencies on Long Wave radio while driving - very useful for diagnostics! You'd hear the buzz drop out and come back as it switched from soft to hard mode when you threw it around corners.

Similarly the airbag driver module for the Range Rover uses six bloody great big MOSFETs driven by a surprisingly complex analogue circuit with an opamp and a couple of transistors to pulse the solenoid on for 100ms or so and then pulse it at 30% duty cycle at some high frequency.

The valves are held closed by air pressure so they need that initial whack of current to open them, but then they can be held by far less current - well, 30% of the normal current, I guess - once the return spring and air pressure has been overcome.