This article describes the development and implementation of a control system applied to a photovoltaic panel. The objective of the controller is the automatic tracking of sunlight, for which controllers based on PID and MPC are implemented. For the experimental development, a photovoltaic panel, a personal computer and an ARDUINO card were used as a communication interface. For the simulation, we worked in the environment of the MATLAB and SIMULINK platform. In the case of the analysis of the response of the MPC, three scenarios were used. Comparing the results of the PID vs MPC, it can be stated that better follow-up responses were achieved in the case of the control based on the MPC model.