Electromagnets are handy for computer controlled lifting. Review the principles in your physics text. They are basically just a big coil of wire and are controlled from the Stamp board with a TIP120 or relay in the same way as a motor.

Magnets can be hand wound. If wound around a hollow core, they are called solenoids. More commonly they are wound around a soft magnetic material such as iron. A steel nail or bolt works almost as well. The magnetic field varies with number of turns N and current I. To avoid draining batteries, get your strength by increasing N rather than I. Thus, you want many hundreds of turns from small diameter wire rather than a few turns of heavy wire. For example, 2000 turns of #34 awg wire gives a resistance of 40 ohms which is only 300 mA of current when run off a 12V battery, but will provide about 500 gms of force when the coils are wound around a 1/4-20 bolt.

Use magnet wire which is thin, enamal coated copper wire. Find at a surplus store or get at Radio Shack (PN 278-1345, $4.69, call store to check availability)

Hint: A relay is an electromagnet controlled switch. If you dissect a relay, you can extract electromagnet for your own use. The SPST relay sold in the Robot Store will pick up a couple of paper clips. A bigger 12V automotive relay will pick up more.

Here are some notes and pictures from Brandon Harris, an ME2011 student who made his own magnet

Radio-Shack sells insulated copper wire called magnet wire. I simply wound 200 feet of the 30 gauge wire around three iron cylindrical rods I found at Ax-Man using a drill to rotate the rods. Make sure to burn the ends of the wire to melt the enamel and then clean with steal wool for good conductivity. Connect to a battery and you can lift objects that weigh up to approx 3 lbs. See pictures.