When the right limit sw is activated the relay coil is energized reversing the motor direction to the left. Normally upper and lower are closed but at limits one will open and shuts off motor.
![2278 Double Pole Relay Wiring Diagram Wiring Library](https://www.the12volt.com/installbay/uploads/B78_motor_reverse_relays.gif)
2278 Double Pole Relay Wiring Diagram Wiring Library
Dc motor reversing circuit with limit switches. Diode will be reversed biased. It doesnt start on its own you have to push a limit switch. This is a minimal reversing circuit. Switch stops motor at limit and diode allows reversing of motor. Diode will allow motor to go in reverse direction. It consists of a dpdt relay two spdt limit switches and 5 diodes.
Wiring diagram of a dpdt connected motor plus two snap action switches for user control with limit stops. The interlocks are specially important because if both relays are on it would be a short circuit. The motor runs to the right with the relay de energized as shown. The circuit uses 2 relays 2 limit switches and a dc motor. It would be nice to add a couple of additional switches to automatically stop the motor when it has gone too far but still allow the operator to return the motor to an allowed position. Below is a simple circuit that should do what you want.
It doesnt have interlocks or a stop button but it can all be added to it.