So I coiled ~3' of 28awg wire in a 1/4" coil and connected it to an AA battery. It is unable to pick up nuts but still attracts and repulses in the presence of a permanent magnet. When a piece of iron is added to the center of the coil the strength of the magnet increases, as expected, and it is now able to pick up nuts. The problem is that now both poles of the permanent magnet are now attracted to the iron core. How can I achieve repulsion with the electromagnet? Would more turns or voltage help? Thanks for your help!