Need advice to control intensity in electromagnet for ferrofluid sculpture

Hi community, nice to meet you,

I would need advices to control intensity (between 0 and 2 amps) in a home-made electromagnet for a small ferrofluid sculpture.

I’ve already built the sculpture but I can only switch it ‘on’ (2amps), or ‘off’ (0amps).
Now I’m planning to use an Arduino Uno to control intensity level.

Details of current project: 12V DC + a switch + my electromagnet (1ohm, non-laminated core, unknown inductance) + a resistance (5ohm).
Current is around 2amps. The resistance gets hot but not too hot, no need cool it down.

As said, my goal is to control the current from 0 to 2 amps with the Arduino.
I can imagine 2 designs:
1 Use a transistor in its ‘linear’ range to statically control a DC current in 0-2amps.
2 Use PWM and a saturated transistor. In this case current will evolve in time (typical exponential shape due to the inductance of the coil). I hope that current variations in the coil will be fast and small enough to be ‘smoothed out’ by the fluid inertia. I suppose PWM parameters will not be easy to get right.

In both cases I will add a flyback diode to protect the transistor (around coil + resistance in design 2 to keep same time constant in both part of the PWM cycle).

So my questions are:
A – Do you recommend 1, 2 or another design?
B - What transistor would I need (reference?)
C – Should I use an optocoupler or something to protect the Arduino? (reference?)
D – Somewhat unrelated: I have the feeling that my design is wasting energy in the resistance. How could I maintain the 2 amps without having the resistance getting hot? (If I had a 2V power source, I wouldn’t need the resistance at all) how can I get a 2V/2Amps source from my 12V/2amps without a resistance getting hot?

Thanks

So my questions are:
A – Do you recommend 1, 2 or another design?
B.
B - What transistor would I need (reference?)
MOSFET, check sparkfun, digikey, datasheetcatalog or google
Alternative - BJT, TIP120 / TIP140 cheaper, same time you 'd need a heatthink
C – Should I use an optocoupler or something to protect the Arduino? (reference?)
I'd recommend, inductive load creates a EMI nightmare .
4N25 / ../ 38, MCT6 practically anything if PWM freq. < 1kHz, 6N136 / 137 if above
D – Somewhat unrelated: I have the feeling that my design is wasting energy in the resistance.
Yes.
How could I maintain the 2 amps without having the resistance getting hot? (If I had a 2V power source, I wouldn’t need the resistance at all) how can I get a 2V/2Amps source from my 12V/2amps without a resistance getting hot?
There would not be any resistor in B.

PWMing soft iron core may generate too much heat due to iron-losses - esp. with high frequency PWM,
low frequency PWM may be (acoustically) noisy though. Adding a ferrite inductor in series could cure this
(use fast PWM)....

Ideally a programmable output DC-DC converter would be used - control the voltage, no ripple at the magnet, good
efficiency. Bit overkill though!

Can you find a laminated-core electromagnet perhaps?

Thank you both for your answers.

I got it working with the default Arduino 500Hz PWM and a MOSFET IRF520 (gets hot so I'll try a better one) + flyback diode + optocoupler.
I still need to get rid of my hot resistor by making sure the PWM ratio will be constrained to avoid releasing too much current.

Thanks anyway for giving me the good direction to follow!

Yes, the IRF520 is not logic-level, not suitable for driving from 5V. You're alternative is logic-level (and much lower on
resistance - the 520 is a truly ancient device I believe).