NOVELTY - The process comprises feeding an anaerobic digester with organic substrate, extracting a sample of biogas from a headspace of the anaerobic digester, analyzing a composition of the sample of biogas, detecting the quantity of volatile fatty acids in the sample of biogas, controlling feeding of the anaerobic digester in view of the quantity of volatile fatty acids detected in the sample of biogas, and performing concomitant process of diluting the sample of biogas in air when it is extracted from the headspace of the anaerobic digester. The analyzing step is carried out by a detector.    USE - The process is useful for online and direct control of production of biogas comprising methane and carbon dioxide from biomass and organic substrate in an anaerobic digester provided with a headspace for collecting biogas, where the produced biogas is useful as cooking fuel and in combined heat and power gas engines.    ADVANTAGE - The process ensures simple, economic and reliable production of biogas in an environmentally friendly manner by avoiding the overloading and underloading rates in the anaerobic digester, ensuring an optimal feeding rate and avoiding process dysfunction such as acidosis.    DETAILED DESCRIPTION - The process comprises feeding an anaerobic digester with organic substrate, extracting a sample of biogas from a headspace of the anaerobic digester, analyzing a composition of the sample of biogas, detecting the quantity of volatile fatty acids in the sample of biogas, controlling feeding of the anaerobic digester in view of the quantity of volatile fatty acids detected in the sample of biogas, and performing concomitant process of diluting the sample of biogas in air when it is extracted from the headspace of the anaerobic digester. The analyzing step is carried out by a detector, which comprises an ion mobility spectrometer. The ion mobility spectrometer is a time-of-flight ion mobility spectrometer, a high field asymmetric waveform ion mobility spectrometry or a differential ion mobility spectrometer. The high field asymmetric waveform ion mobility spectrometry or the differential ion mobility spectrometer is a micro-electro-mechanicals system detector chip based on silicon or ceramic substrates.    DESCRIPTION OF DRAWING(S) - The diagram shows a block diagram of an automated process for online and direct control of production of biogas.