As the world increasingly turns to renewable energy, green hydrogen produced through water electrolysis has emerged as a clean and promising alternative to fossil fuels. In this work, we explore a solar-powered hydrogen production system that uses real data from an operational photovoltaic (PV) installation, ensuring accurate and realistic modeling of environmental conditions. A DC-DC buck converter is used to regulate the fluctuating PV output, supplying the precise voltage needed by a PEM electrolyzer. Sliding mode control (SMC) strategy is applied to maintain voltage stability, and its performance is compared with a traditional proportional-integral (PI) controller. Simulations in MATLAB/Simulink demonstrate that SMC offers better dynamic performance, including minimal overshoot, faster response, and an impressive hydrogen production rate of 0.98 L/min (98% efficiency). By providing more consistent voltage to the electrolyzer, SMC significantly boosts overall system performance. These findings underline the potential of advanced control strategies, supported by real-world data, to make renewable hydrogen production more reliable and efficient.