Internal combustion engines only take advantage of a quantity of the energy available in the combustion process. In addition to this, the emissions generated alter the balance and natural composition of the air, which represents a current risk to human health. Because of this, to reduce the dependence on fossil fuels and minimize the harmful emissions to the environment of this type of thermal machines, in this work, the implementation of an exhaust gas energy recovery system is proposed. With the recovered energy, is hydroxy through the electrolysis process, and so that partial substitution of diesel fuel with the gaseous fuel produced. For the experimental study, a diesel engine SOKAN SK-MDF300 is coupled to a thermoelectric generator formed by Peltier modules, which transform thermal energy into electrical energy. This energy was used to generate hydroxy, reaching a generation maximum of 1.37 L / min. The influence of the partial substitution using diesel fuel and B10 fuel was studied. The experimental results allow us to conclude that a 3% reduction in fuel was achieved with diesel fuel. In addition to this, CO2 emissions were reduced in 13%, CO in 11.66%, NOx in 35.38%, SOx in 14.84% and 21.69% of reduction in smoke opacity, in the condition of maximum load during the test in the engine. The implementation of the TEG, coupled with the HHO gas generation system increases the overall efficiency of the engine by 4.2%.