Electromagnets

Hi, we are a group of students from National University of Singapore (NUS) bio engineering. We are designing a device, which uses 2 horseshoe electromagnets to exert an attractive force along the longitudinal axis of the skin. We are planning to vary the current supplied to the circuit and hence we would like to seek advice regarding this 2 configurations: Arduino Playground - HomePage
Arduino Magnet Levitation – detailed description | Mekonikuv blog
If we are intending to use 2 electromagnets instead of 1, what other components do we require and where do we attach the second electromagnet in the circuit? Moreover, do we need to include a digital potentiometer to vary the current. Hope that we will get some advice soon. Thank You!

Those schematics are the same, and they are okay.

For a second magnet, you have two make two circuits like that.

To vary the current for a motor, the Arduino uses PWM.

The frequency of the PWM is about 450Hz.

But for you, perhaps you need a smooth current, and not a PWM signal.
That requires extra components, and it is not very easy.
You could filter the PWM signal to filter the 450Hz and make it an analog signal, and use a larger transistor with a heatsink.
Or you could add a DAC chip to the Arduino, for a normal analog output.
Or a circuit that sets the current.

Hi Erdin,

Thanks for your advice! We will consult you if we encounter any other problems.