I took a physics class that focused on electromagnetism. It got me really interested in electronics and their relationship to magnetism. This project came from that interest, and now I made this Instructable to show how to make a simple electromagnet housed in a highlighter.
Step 1: Materials and Tools
The first step is to gather everything you'll need. I suggest a quick trip to Radio Shack. They have pretty much all the inside parts needed for this project.
-Enamel coated magnet wire
-Nail (or other small magnetic rod)
-Highlighter (of course)
-Hot glue gun
-Soldering iron and solder
-Sandpaper or a file
-Dremel or similar tool (optional)
Step 2: Taking Apart the Highlighter
In order to put an electromagnet inside of a highlighter, first the highlighter needs to be taken apart. To do this, use the pliers to grasp the back end of the highlighter, opposite the cap. Dump out the little plastic tube that contains the highlighter ink. Then, pull out the tip that goes inside the cap. Do whatever you want with the insides; they're not used in this project.
Next, the switch needs to be put into the end of the of the highlighter. Make a hole in the piece you just pulled off using either a Dremel or soldering gun. I suggest using a Dremel as melting plastic releases harmful fumes. Don't make the hole too big, because you want the switch to fit snugly into the hole. Then, jam the switch into the end so that you can easily press down the button with your finger. If it's not a tight fit, add a little hot glue to keep it in place.
Step 3: Wrapping the Electromagnet
Before you start wrapping the wire around the nail, you should first file or sand down the end. It doesn't need to be sharp to be a magnet. Next, make a small "wall" of hot glue about an inch down from the head of the nail. This will hold the coiled wire tight.
When you start wrapping wire, secure the end of the wire with a bit of tape outside the wall of hot glue. Wrapping a wire coil isn't very hard and there are other Instructables out there that explain it, so I won't go into it anymore.
Once you've wrapped about four layers or so, cover it with electrical tape. Cut the wire, and file or sand off the enamel on both ends. The enamel insulates the wire, so if you don't do this it won't work. You can even scrape it off with a knife if you want. Whatever works best for you.
Step 4: Connecting Everything
Once the electromagnet is coiled, everything needs to be wired up. One wire coming from the switch needs to be attached to the battery. I just taped it to the end, and that has worked for all three of these I've made, but if you can find (or make, possibly with a 3D printer) a battery case to fit inside the highlighter, that will probably work better and allow you to switch out batteries. The other wire need to be soldered to one wire coming off your electromagnet. Make sure that the wire is long enough to reach from one end of the the highlighter to the other end. You can choose whichever wire you want to, polarity doesn't matter. It will just change the polarity of the magnet which doesn't matter unless you're going to use this with other magnets. Then, the other end of the magnet wire should be soldered to another wire that can reach to the free end of the battery. The other end should be taped to the open end of the battery.
If this is confusing, one end of the battery should connect to the switch, from there to the wire coil, then to another wire, and back to the other end of the battery. I made a schematic in Paint that might explain it a little better.
Also, now is a good time to test that everything is connected and works. Just hold down the button, and try to pick up something that will stick to a magnet. When you let go of the button, it should drop right off.
Step 5: Sealing the Highlighter and Finishing
The final step is to put everything inside and close it. Basically you just shove everything in and try not to break it apart. The only tricky part is making sure that the nail gets through the opening at the end. The easiest way to do this is try to keep it straight as you push it down the highlighter.
This little magnet works great for picking up small screws that might have been dropped somewhere that your fingers can't reach.