4
\$\begingroup\$

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!

\$\endgroup\$
4
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ Thanks. The Arduino has a voltage regulator built in. Do I need a 12V voltage regulator on the 12V supply for the solenoid? \$\endgroup\$ – Computerish Jun 6 '11 at 21:35
  • \$\begingroup\$ No, the solenoid will be fine. It will basically ignore high frequency noise. \$\endgroup\$ – Olin Lathrop Jun 6 '11 at 21:40
  • \$\begingroup\$ @Computerish - A 12V regulator will not work on a 12V supply. If your 12V supply is somewhere between 11.5 and 12.5V, it will take more than a 7812 to regulate that to 12V. You need a buck-boost SMPS. If you want to have an intermediate regulator (if you find that the filtering/regulation on the Arduino's regulator is insufficient), regulate to 9V or so. \$\endgroup\$ – Kevin Vermeer Jun 7 '11 at 21:05
1
\$\begingroup\$

I think you'll be okay even if you're powering the solenoid and Arduino from the same 12V PSU if you remember to put a kickback diode across the solenoid. I don't have plots handy, but I do recall having to do this a long time ago when I was in school. :)

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.