Electromagnetism with Arduino

You haven't shared much details, what kind of electromagnet you are using ? and what you want to achieve ? Are you trying to design a new electromagnet with Arduino ??