Morocco is the world's 5th largest olive oil producer with 160,000 tons in 2020/2021 and the production of 1 L of olive oil generated approximately 5 kilos of waste olive cake, this type of waste is dangerous for the environment and especially for groundwater. To address this issue and take into account the thermal properties of olive waste, our project's goal is to produce power and heat by using solid olive waste in a Stirling cogeneration system. Therefore, the goal of this article is to examine by using CFD tools the environmental impacts of the Moroccan solid olive waste burning in a CHP (combined heat and power) unit. The idea is to integrate a smart renewable energy system based on olive cake and the Stirling motor to produce electricity in order to employ this electrical energy for water pumping in rural areas.The impact of the excessive air ratio on temperature profile and exhaust has been investigated and discussed. In addition, the pollutant species in air has been presented, and compared with guideline values given by some international organization for health and environment. Results show that the highest excess air ratio gives high temperatures with a homogeneous distribution around the Stirling motor hot heat exchanger, and minimum emissions of CO, CO2, NO, NO2 and NH3 that do not exceed the values set by WHO, OSHA, and NIOSH.