The problem of pollution due to transportation is extremely serious. Hybrid and fully electric vehicles are increasingly popular, to reduce fuel consumption and gas emissions, and car makers are also starting to equip vehicles with solar panels to extend driving range. These photovoltaic installations pose many challenges, e.g., how to increase their efficiency and decide where and how the solar energy is stored. This paper analyzes the problem of transferring the energy generated by an on-board solar cell system to the main battery pack of an electric vehicle and proposes an optimized solution based on the interaction with the BMS.