Fork me on GitHub

Project Notes

#117 SolenoidDIY

Build and test basic electromechanical solenoid.

The Build

Here’s a quick video of the solenoid in action:

SolenoidDIY

Notes

A solenoid technically refers to a coil of wire through which a current may flow to generate an electromagnetic field, according to Ampere’s Law.

The right-hand rule indicates the orientation of the field with respect to current.

In practice, the term solenoid usually refers to the electromechanical solenoid. This includes a steel or iron armature that moves in response to changes in the electromagnetic field.

The objective of this project is to construct a solenoid from scratch and demonstrate its operation with an Arduino.

Making the Solenoid

The solenoid I’ve constructed here is 9m of wire wound around a ~7mm drinking straw, in about three layers over a 4cm stretch. I didn’t count them, but that should work out at about 400 turns.

The wire used is similar to this product from a seller on aliexpress. It is 0.2mm enameled copper wire.

The resistance of the winding wire reads at around 10Ω in total. With a 9V supply, we’d expect a current of about 900mA. And that’s what I measure when I insert an ammeter in the circuit.

The armature is an old screw - some kind of mild steel I think.

SolenoidDIY_component

The Circuit

An Arduino is used to switch the solenoid. A pulse of about 150ms duraction is required to ensure the solenoid performs a positive and complete action.

An IRF540N n-channel MOSFET is used to switch the current to the solenoid. A flyback diode across the solenoid handles any back-EMF when power is cut. The MOSFET allows the 5V Android to switch the 9V power supply. The power supply is rated for 1A - just enough for this solenoid.

An LED with current-limiting resistor provides a visual indicator when power is on the solenoid.

Increasing the Force

It works! That has me pretty chuffed. But it is not particularly powerful. There are basically three strategies for increasing the force applied by the solenoid:

  • higher current
  • more turns
  • higher permeability magnetic core

Construction

Breadboard

The Schematic

The Build

Credits and References

About LEAP#117 SolenoidArduino

This page is a web-friendly rendering of my project notes shared in the LEAP GitHub repository.

Project Source on GitHub Return to the LEAP Catalog
About LEAP

LEAP is my personal collection of electronics projects - usually involving an Arduino or other microprocessor in one way or another. Some are full-blown projects, while many are trivial breadboard experiments, intended to learn and explore something interesting.

Projects are often inspired by things found wild on the net, or ideas from the many great electronics podcasts and YouTube channels. Feel free to borrow liberally, and if you spot any issues do let me know or send a pull-request.

NOTE: For a while I included various scale modelling projects here too, but I've now split them off into a new repository: check out LittleModelArt if you are looking for these projects.

Project Gallery view the projects as an image gallery Notebook reference materials and other notes Follow the Blog follow projects and notes as they are published in your favourite feed reader