PWM controlled DC power supply up to 20 V

Hi, newbie here (especially in terms of electronic, I can do programming) :slight_smile:

I am looking for easiest solution to create an Arduino (PWM) controlled DC supply up to 20V @ 200 mA (I want to control vibration motors).
Ideally something I could just connect to 24V PSU (or 220V plug) and one of Arduinos PWM pins.

I was looking through some sketches to control LM2596, but it would save me a lot of time it there is some sort of chip with all this integrated. I found motor speed controllers, but they to have PWM output.

Thanks

You don't normally control power to motors by adjusting an analog voltage, you apply PWM, its much
simpler and more efficient. 24V -> motor -> nMOSFET -> GND
The motor needs a free-wheel diode across it, and MOSFET should be logic level for use from 5V.