Electronic – Considerations for powering solenoid and arduino from the same power supply

power supplysolenoid

I'm working on a project where I will need to power a small solenoid (probably 12V) and an Arduino Pro Mini 3.3V (3.3-12V input, onboard circuitry regulates to 3.3V). I'm thinking about using an H-bridge, relay, or MOSFET for controlling the solenoid, depending on the type of solenoid that is needed.

There will be a single power supply supplying power (most likely 12V) for both the Arduino and the solenoid. What should I do to ensure that the solenoid doesn't interfere with the Arduino's power while it is switching?

(Any input on H-Bridge vs. relay vs. MOSFET (or vs. Darlington if you want) would also be welcome.)

Thanks!

Best Answer

Presumably there is a regulator between the 12V supply and the arduino. As long at the 12V supply remains high enough for the regulator to function, it will keep the voltage to the arduino constant.

However, regulators aren't perfect. In particular, they can only compensate for input power variations up to some frequency. Noise above that will be passed to the output. If you think the input power might be noisy enough so that the regulator can't block it all, put a small filter on the input of the regulator. Most regulators will work OK up to a few 10s of KHz. You didn't say how much current the arduino draws, but you have plenty of voltage headroom. A 10 Ohm resistor will only drop 1V at 100mA, which still leaves plenty for the regulator to work with. That followed by a 10uF ceramic cap to ground right in front of the regulator will form a low pass filter with 1.6KHz rolloff. That should be good enough to keep the input of the regulator down to frequencies it can deal with.

Of course the best way to handle noise is to not make it in the first place. You absolutely need a diode or some kind of snubber to catch the inductive kickback when the solenoid is turned off. The main reason is to keep from frying whatever is switching the solenoid, but a secondary effect will be to decrease overall noise.