Solar cells are electronic devices that convert sunlight into electrical energy. Also, solar cells are known as a clean and renewable energy source. In this paper, for the first time, a new method with closed-form analytical equations is presented for the detailed analysis of a specific solar cell structure based on MEMS (micro-electromechanical system) technology. The proposed method is a comprehensive and complete analytical method, which is applicable and valid for all solar cell structures based on a two-layer cantilever with any piezoelectric. Also, using the proposed analytical method, closed relationships for calculating the open circuit voltage and other important parameters of this type of solar cells based on MEMS technology have been presented. With this proposed method, complex simulation tools will no longer be needed to calculate the open circuit voltage and other important parameters of solar cells with two-layer cantilevers. Also, the proposed closed-form relationships help designers to understand the design compromises and design the two-layer cantilever-based solar cell for their specific and desired conditions. To show the high validity of the proposed method, the simulation results have been compared with the theoretical results. In this comparison, the simulation results and the theoretical results are very close to each other or almost equal. Also, the proposed structure has been numerically simulated using Comsol software.