Here the construction of a motorized awning with 4 panels is described
The awning is extended and retracted using a bidirectional DC motor DGO-3512ADA. The TB6612FNG dual motor driver is used to control the motor.
The extension and retraction is time controlled. That is, forward or reverse current is supplied to the motor for a specified time. To protect the motor, a limit switch is used to break the circuit when the end position is reached.
The motor driver is connected to a Rasperry Pi Zero, with the layout as shown below: