Introduction: Simple Solenoid Using Arduino

This by far the simplest way to weakly magnetise any object using your Arduino uno. All it takes is a lot of wiring and coiling, and a program to do the trick. In fact, it takes just two steps to program an Arduino to turn it into a solenoid.

Step 1: Program the Arduino

Here is one program that you may use to make a solenoid out of an Arduino:

void setup() {

pinMode(10,OUTPUT);

pinMode(11,OUTPUT);

}

void loop() {

digitalWrite(10,HIGH);

digitalWrite(11,LOW);

delay(10);

digitalWrite(10,LOW);

digitalWrite(11,HIGH);

delay(10);

}

by changing value of delays, one can change frequency of alternating current hence you can test whether lower or higher frequencies magnetise the best or not. Upload it onto your Arduino board using the IDE.

Step 2: Making the Coil

based on the program, you may have to take a very long piece of Insulated, Single core, Copper wire ( commonly called enamelled wire) and wrap it around the metallic object that you wish to magnetise.

Caution: the current in the coil must not exceed max current output limit for the pins (40mA). Since the Digital pins also provide 5V of electricity, the ideal resistance of the coil must be less than 125 ohms so that the current in it will be 40mA. You can use a multi-meter to find resistance of coil and if it is too high, you can shorten length of wire used.

it is best to make as many coils as you can fit around the object. one of the wire may the be connected to digital pin 10 on the Arduino while the other of the coiled wire may be connected to digital pin 11 on the Arduino. And... Violà! your solenoid is good to go. :-)

Note: remove object from coil only after you have disconnected coil from the aduino.