Controlling an electromagnetic field

Hello,

I am currently working on a project which consists on having iron filings in constant movement.
I would like some advice on how to control the field's strength with an Arduino.

I started building a few electromagnets and was at first thinking of turning some of them on and off randomly to modify the magnetic field, but I encountered a few problems. I am working with a power supply of 2.5A and I can chose between 5 or 12v. I chose to start working with 5V because the resistance of my electromagnets was too weak. To get a stronger resistance and therefore avoiding overheating, I connected them in series, but then the current ends up being very weak after the first two magnets.
Working with a single electromagnet would be better for the project, but I would need indications on how to control its strength and would very much appreciate some help. (Also, I'm starting with Arduino, so the more detailed the better).

Thank you very much!

You need MOSFET transistor. And look at Arduino PWM functionality.