I am trying to use an Arduino(Mega) to control an electromagnet strength.
In the end of the day, I will need to control the strength in 3 levels (High/ Low/ Off), I don't know yet what Voltage I will use for each level (Off is 0V of course).
My electromagnet is a 12V electromagnet. the High level will be at least 8 - 10V (possibly the full 12V strength).
I tried controlling the electromagnet with a DC motor driver L298N (with PWM signal from the Arduino to the Enable pin).
It worked well but when the PWM is not in 100%, the electromagnet vibrates and it causes noise with the bracket (really small vibrations, not visible by the naked eye, I only hear the noise from the bracket).
I would like to hear if you have any idea for a method to control the electromagnet strength with an Arduino (or solving the vibrations problem with the L298N).