I have a 12V motor which can be rotated forward or backward based on the polarity. I would like to control it with Raspberry Pi's GPIO ports. So that by switching 2 GPIO ports on Rpi I would be able to either run th emoto forward, backward or have it stopped.
From my understanding, the best for this purpose is to use 2 contact relay such as HK19F-2C, 3V and hook it up that it provides either positive or negative polarity to the motor.
I have however problem with figuring out how to connect the relay, motor and Rpi together. There will be separate 12V power source for the motors.
Could you please help me with figuring out how to connect everything together? I need a schematics how to connect this properly.

