In the figure we show how to supply a DC motor from 6 to 12 V with alternating current. The diodes can be 1N4002 for currents up to 1 A. The capacitor C1 serves as a filter, typically having values between 10 and 470 uF. The circuit is from the book Robotics, Mechatronics and Artificial Intelligence by Newton C. Braga.
