Professional Documents
Culture Documents
search
Home
Buy
Download
Products
Learning
Forum
Support
Blog
LOG IN
SIGN UP
A Solenoid Tutorial.
You can not drive a solenoid directly from your Arduino. It requires more current than you can
provide and produces destructive voltages when it is switched off. There is a simple solution.
- Output
- Input
- User Interface
- Storage
- Communication
- Power supplies
- General
The solenoid I was testing with is a 12 volt solenoid the size of my thumb. It passes 1 amp of
current when turned on and becomes uncomfortably warm to hold if left on. Your Arduino can
only pass about 40mA from a pin. You probably will need to measure your solenoid before you
can choose components. Use your ammeter to measure the solenoid's current draw when you
power it directly from the power supply.
Electronics Technique
Sources for Electronic Parts
so it should not be surprising that they have inductance. i.e. Once a current is moving in the
solenoid it will attempt to continue moving that current. This can be fatal to your digital device
when it switches off the solenoid and the solenoid creates a voltage across its leads large
Exhibition
enough to either move the current, arc through the air, or burn through a semiconductor. The
Project Ideas
solution is to provide an easy and safe path for the current to flow until it dissipates the energy
Languages
PARTICIPATE
- Suggestions
- Formatting guidelines
Most of the schematic is test point labels and my extra protection circuitry for testing the bad
configurations. You really only need D1, L1, Q1, and a resistor to be named later.
- Cookbook (addons)
- Documentation index
- Drone with Arduino
- Thermostat with Arduino
You could also use an NPN bipolar transistor. You need to make sure that you saturate the
transistor. That is... 40ma (your arduino current) times the current gain of the transistor (hfe)
needs to be larger than your solenoid's current. I'd shoot for twice as large to be safe. These
will not have the second safety diode behavior, so don't screw up D1.
Here on the bottom trace we see the gate voltage, 10V/div, 20mS/div. The top trace is
measuring the current through the FET, it climbs to just over 1 amp. That non-monotonic climb
is caused by the solenoid core moving. If I hold the core either in or out there is a monotonic
rise. The little step after the signal drops comes from me holding a camera for a 1 second
exposure, it is not real.
Here is the inductive kick without a bypass diode. This trace begins just as the FET is turned
off. Notice the vertical scale is 50 volts per division. You are looking at nearly 250 volts, my
FET is a bit above spec.
Share
NEWSLETTER
Subscribe
2015 Arduino
Copyright Notice
Contact us