Inverting Power Supply Leads using Arduino Controller

I am trying to use my Arduino to invert the positive and ground outputs from a 12 V DC power supply to a motor (so the motor runs clockwise when positive is on one terminal, counterclockwise if positive is on the other). I tried to use two op-amps as switches to no success. Any other ideas? I feel like this should be a basic enough problem, but am pretty inexperienced. Thank you in advance for any help!

Use an "H-bridge" motor driver with a current rating greater-than the motor's maximum "stall current".

You can also reverse a motor with a DPDT relay (or a DPDT switch to do it manually) but it takes a 2nd (SPST) relay to turn the motor on/off.

..An op-amp only puts-out a few milliamps, not enough to drive a motor.

A motor is a highly inductive load and will fry semiconductors readily unless you understand about
suppressing inductive voltage spikes. Standard H-bridge circuits for motors already incorporate
the necessary free-wheel diodes.

Motors need large currents (amps, tens of amps) - several orders of magnitude more than most
opamps deal with (milliamps). Assume those opamps are faulty now.

Anyway: which motor? which power supply?


here is a diagram of using a switch (no arduino)

Here is how I wire things to just reverse a motor

Thank you for the responses! I've looked more into the H-bridge, and it seems like that be very suitable... I ordered one and will try setting a circuit up with that. Thank you again!