This study aims to mathematical modeling of a mechanism for a solar tracker system of two axes as well as the modeling of stepper motors that drive each axis, that to get the best angle of incidence between the sun and photovoltaic plate (90o). The proposed architecture was modeled using the conversion method of the kinetic energy and potential of Lagrange and stepper motors were modeled by detailed analysis of their internal characteristics. With ready models, we used the software Matlab (R) to perform simulations in order to view the system response to the step. As engine speed is too high the system response is oscillatory, the need of using a PID controls system to improve system position control efficiency. For this, we used the second method of Ziegler and Nichols for determining the parameters of the PID controller gains. Thus, the system modeling was completed through the fine tuning of the PID controller in order to find the best values for the controller parameters using the embedded system Arduino UNO R3.