I want to power a 24 VAC vibration pump (48 W 50/60 Hz, often used in coffee machines), and control it with a microcontroller. I've got an existing system that is powered with 24 VDC. A standard DC-DC converter powers the microcontroller.
I thought it would be possible to use a L298N DC motor controller, and program the microcontroller in such a way that it changes the motor driver's direction every 20 milliseconds, creating a 50 Hz square wave that's basically some sort of "AC" voltage.
If such a thing is possible, do I need some kind of diode that protects the driver and the microcontroller from nasty currents flowing back? The pump's datasheet says it has a built-in diode. Would I need extra diodes or would that built-in one be enough?
If such a thing is not possible, I'm open to other ideas on how to control the pump.
Thanks in advance!
Edit: Sorry, I forgot to mention I have no 24 VAC available, I want to do it with the 24 VDC.