This work shows the development of an electronic system for the control and the management of a hybrid configuration of generation of energy, based on the use of a PEMFC fuel cell stack (50W) and a supercapacitors module. In order to achieve this aim, a Buck DC-DC converter and an electronic control unit (ECU) based on a microcontroller have been set in the electronic system. The ECU controls the DC-DC converter by adapting the voltage given by the fuel cell to the voltage required by the electronic speed regulator of the truck. Moreover, it limits the extraction of energy from the fuel cell according to its electrochemical behaviour. Two digital PID regulators in closed loop are used for the control. They keep the power extracted from the fuel cell constant and limited by regulating the converter, either at constant voltage (CV) or at constant current (CC). Finally, the ECU regulates the fan speed according to the current which is extracted from the fuel cell, in order to provide enough amount of oxygen inside the cell. A supercapacitors module (7.5V, 66.6F) has been installed between the DC-DC converter and the electronic speed regulator of the truck so as to provide the necessary energy during the load peaks required in the start-up or in the acceleration. The supercapacitors will be recharged by the fuel cell stack as soon as the demand of the vehicle decreases and there is an excess of energy. In order to identify faults in the system, as well as to refine and optimize the control algorithm, the ECU keeps a record of all the variables of the system, such as the temperature of the fuel cell stack and the room temperature, the voltage of all the cells, the voltage and current extracted form the stack, the voltage and the current given by the DC-DC converter, the speed of the fan which provides the stack with air, and the activation of the hydrogen purge valve with respect to time.