Development of Anaerobic Biodigester for the Production of Biogas Used in Semi-Continuous System Bioprocesses: An Efﬁcient Alternative for Co-Digestion of Low Biodegradability Biomass

: The objective of this work was to develop an automated anaerobic biodigester capable of operating in a semi-continuous or batch system for biogas production. Low biodegradability biomass has little efﬁciency in the production of biogas by anaerobic digestion processes and an efﬁcient alternative is the use of bioprocesses in semi-continuous system. Two experiments were carried out in the same proportions but in different processes, and all control and automation parameters were tested and evaluated. For testing, mixtures of organic waste, anaerobic sludge (inoculum) and raw sewage without any treatment from the sewage treatment plant, in mesophilic phase (37 ◦ C), were used during the 60 days of experiment. The semi-continuous system showed the greatest reduction in organic matter, expressed by the removal of 80.7% Total Solids Volatile (TVS) and the greatest volume (68.5 L) and methane percentage (78.5%). Finally, with these and other results found, it is possible to conclude that the biodigester developed for semi-continuous system, with the automation and control system, was satisfactory for the reduction in organic matter and biogas production. In addition, all operating system worked properly and with the use of current, low-cost technologies, the application and development on a larger scale becomes viable in the future.


Introduction
One of the main environmental problems of today's society is the continuous increase in the production of solid organic waste and sewage and their disposal. In many countries, sustainable waste management, as well as waste prevention and reduction, have become important policy priorities, representing an important part of common efforts to reduce pollution and mitigate global climate change [1,2]. Intelligent management of organic waste enables energy recovery, whether carried out by the still traditional incineration or by composting and anaerobic digestion [3,4]. Therefore, an alternative for energy recovery of organic waste is the use of biogas, whether generated in landfills or in anaerobic digestion process [5]. The anaerobic digestion process carried out in anaerobic biodigesters can play a significant role in fundamental issues for our society: waste and sewage management and treatment and production of renewable energy. The biodigester is an alternative to the Clean Development Mechanism prescribed by the United Nations and contributes to the reduction in pollutants emission into the atmosphere [6]. In addition, it promotes local sustainable development through the treatment of organic waste generated by a particular activity, enabling not only energy generation but also the final use of waste as biofertilizer, reduces the generation of electricity from a non-renewable source and reduces water consumption of processes [7][8][9][10]. The use of the biodigester enables the improvement of sanitary conditions of properties, resulting in better quality of life and health for the population and the environment. Currently, biodigesters built in Brazil and in several countries are expensive, especially in terms of implementation and operation. One of the main reasons is the lack of national technology for monitoring, control and automation systems.
Anaerobic digestion is one of the solutions to reduce these problems and also an attempt to reuse urban solid waste (USW). It is notorious that anaerobic digestion is a process by which organic waste is biologically converted through the use of a microbial consortium in the absence of oxygen [11]. In addition to stabilizing the organic load of waste, it generates products such as biogas digested and rich in methane, which can be used as soil conditioner, historically used to stabilize sludge from sewage treatment, although it is a viable application for any matter treatment [12]. Besides the potential for generating renewable energy, anaerobic digestion has become increasingly studied and also more popular due to several factors, such as reduction in waste disposal in landfills and energy supply to small communities far from urban centers. Another very evident advantage is the lower sludge generation. In anaerobic digestion, about 10% of organic waste is transformed into sludge and the remaining 90% is used as biogas. It is also important to highlight the application of anaerobic processes in both small and large scale, with low implementation cost, low area demand and good tolerance to high organic loads [13]. Therefore, biogas production and the development of technologies for biomethane generation have been encouraged by many countries as an alternative for electricity generation or cogeneration of internal engines [14][15][16][17].
However, to make energy generation viable, it is necessary to use anaerobic biodigesters built at low cost and with high technology, and simple methods of using the system aiming at large-scale reproducibility and industrial use. For this reason, the main objective of this study was to develop anaerobic biodigester in a semi-continuous system, with control and automation systems, in order to play a significant role in two crucial issues for our society, which are environmental protection and resource recovery. Other very important aspects are the production of national technology and the mitigation and reduction in organic waste and sewage disposal in communities, rural and industrial areas. That will be possible with the reduction in waste in the environment and the generation of new sources of energy for the generators of these wastes themselves and as an alternative for biomass anaerobic digestion with low biodegradability.

Development and Construction of Biodigester
The design of this project was based on the use of materials resistant to the environment of the anaerobic digestion process and the development of systems with current technologies and simple and robust methods of use. Having that in mind, it was decided to develop jacketed vertical anaerobic biodigester, on bench scale and in a single stage, with semi-continuous or batch feeding and equipped with heating systems with an element external to the bioreactor, mechanic agitation using a long axis and with vertical entry to the bioreactor, collection and storage of biogas, and control, monitoring and automation. A glass-jacketed bioreactor was developed, with cylindrical geometry, nominal volume of 1.3 L and the following dimensions: 170.0 mm high, 100.0 mm in diameter and wall thickness of 3.0 mm. The jacket has the same volume as the bioreactor and measures 190.0 mm high, 150.0 mm in diameter and 3.0 mm in wall thickness. The first stage of this work was the development of a 3D model and technical drawing of the bioreactor (Figure 1), used for manufacturing, using Solidworks software, version 2019. It should be noted that this software was used to create 3D models and technical drawings of all parts and assemblies developed in this project.

Development and Construction of Heating System
The heating system was based on a heating element external to the bioreactor. Heat transfer occurs by means of heating of a thermal fluid, through an electrical resistance, transferred to the bioreactor jacket by a centrifugal pump. The design of this system consists of a container to hold the thermal fluid, an electrical resistance, a lid for the container, a thermowell for a temperature sensor and a water pump. The container to hold the thermal fluid was designed in 3D model, made of glass, having cylindrical geometry, a nominal volume of 1.7 L, and the following dimensions: 150.0 mm high, 136.0 mm in diameter and wall thickness of 3.0 mm. A polyurethane lid was also designed for the heating container, in order to prevent/reduce the thermal liquid evaporation. Four holes were drilled in this lid: one for fixing the electrical resistance, one for a thermowell, one for the thermal fluid inlet hose and the last one for the thermal fluid outlet hose. The perforations were developed to receive three commercial cable glands, model PG9, to adjust the hoses and the thermowell, with diameters between 4-8 mm and a connector, designed for resistance. This heating system was designed to use a commercial, cartridge-type resistor as a heating element with the following characteristics: 12.7 mm in diameter, 152.4 mm long and power between 850-1000 Watts (W); a stainless steel straight thermowell with an internal diameter of 6.0 mm and a water pump fed with 12 Volts Direct Current (VDC).

Development and Construction of the Agitation System
At this stage, a model of agitation by mechanical means was developed using a long axis with vertical entrance to the bioreactor. This model provides a better mixture compared to magnetic stirring bars. This stirring system was projected to use an electric motor with speed control and a stirring rod. Therefore, a stainless-steel stirring rod with a straight-blade propeller was developed. The passage and rotational movement of the rod in the bioreactor lid is a sensitive point in sealing the system to ambient air. Due to that, a double sealing system was used in this project, by means of a retainer with dimensions of 8.00 mm × 14.00 mm × 3.00 mm and a sealing ring with a section diameter of 3.53 mm and an internal diameter of 7.52 mm.

Development and Construction of Control, Monitoring and Automation System
The control, monitoring and automation system chosen to create the biodigester was a Programmable Logic Controller (PLC) that communicates with a microcomputer

Development and Construction of Heating System
The heating system was based on a heating element external to the bioreactor. Heat transfer occurs by means of heating of a thermal fluid, through an electrical resistance, transferred to the bioreactor jacket by a centrifugal pump. The design of this system consists of a container to hold the thermal fluid, an electrical resistance, a lid for the container, a thermowell for a temperature sensor and a water pump. The container to hold the thermal fluid was designed in 3D model, made of glass, having cylindrical geometry, a nominal volume of 1.7 L, and the following dimensions: 150.0 mm high, 136.0 mm in diameter and wall thickness of 3.0 mm. A polyurethane lid was also designed for the heating container, in order to prevent/reduce the thermal liquid evaporation. Four holes were drilled in this lid: one for fixing the electrical resistance, one for a thermowell, one for the thermal fluid inlet hose and the last one for the thermal fluid outlet hose. The perforations were developed to receive three commercial cable glands, model PG9, to adjust the hoses and the thermowell, with diameters between 4-8 mm and a connector, designed for resistance. This heating system was designed to use a commercial, cartridge-type resistor as a heating element with the following characteristics: 12.7 mm in diameter, 152.4 mm long and power between 850-1000 Watts (W); a stainless steel straight thermowell with an internal diameter of 6.0 mm and a water pump fed with 12 Volts Direct Current (VDC).

Development and Construction of the Agitation System
At this stage, a model of agitation by mechanical means was developed using a long axis with vertical entrance to the bioreactor. This model provides a better mixture compared to magnetic stirring bars. This stirring system was projected to use an electric motor with speed control and a stirring rod. Therefore, a stainless-steel stirring rod with a straight-blade propeller was developed. The passage and rotational movement of the rod in the bioreactor lid is a sensitive point in sealing the system to ambient air. Due to that, a double sealing system was used in this project, by means of a retainer with dimensions of 8.00 mm × 14.00 mm × 3.00 mm and a sealing ring with a section diameter of 3.53 mm and an internal diameter of 7.52 mm.

Development and Construction of Control, Monitoring and Automation System
The control, monitoring and automation system chosen to create the biodigester was a Programmable Logic Controller (PLC) that communicates with a microcomputer through a supervisory software. This system was fully developed: hardware, firmware and supervisory software [18]. The designed hardware can be divided into four main parts: microcontroller-Central Processing Unit, input modules and sensor signal conditioning, output and power modules and communication between microcomputer-microcontroller.
The conception of this hardware aimed to meet the following system needs: three analog inputs for temperature and pH sensors; five power actuators-for the electrical resistance manufactured by the company Dennex, model 29858, water pump manufactured Yimaker, model GDB390, digital stirring motor manufactured by Fisatom, model 713D, and 2 peristaltic pumps manufactured by Intilab, model OFA460-and the communication system between the microcomputer-microcontroller, as shown in Figure 2. In the part of the central processing unit, the PIC16f877a microcontroller from the manufacturer Microchip was used. This Programmable Integrated Circuit (PIC) was designed due to the fact that its characteristics meet all the needs pre-established in this project.
Biomass 2022, 2, FOR PEER REVIEW 4 through a supervisory software. This system was fully developed: hardware, firmware and supervisory software [18]. The designed hardware can be divided into four main parts: microcontroller-Central Processing Unit, input modules and sensor signal conditioning, output and power modules and communication between microcomputer-microcontroller. The conception of this hardware aimed to meet the following system needs: three analog inputs for temperature and pH sensors; five power actuators-for the electrical resistance manufactured by the company Dennex, model 29858, water pump manufactured Yimaker, model GDB390, digital stirring motor manufactured by Fisatom, model 713D, and 2 peristaltic pumps manufactured by Intilab, model OFA460-and the communication system between the microcomputer-microcontroller, as shown in Figure  2. In the part of the central processing unit, the PIC16f877a microcontroller from the manufacturer Microchip was used. This Programmable Integrated Circuit (PIC) was designed due to the fact that its characteristics meet all the needs pre-established in this project. In the PLC inputs part, the analog signals coming from the sensors were previously conditioned in order to be in adequate conditions to be requested by the microcontroller. This conditioning was performed by means of an electronic low-pass filter in three PIC inputs (two for the bioreactor internal temperature sensors and for the heating tank and one for the pH). Two 10 K Ohm NTC (Negative Temperature Coefficient) temperature sensors were used to obtain the temperature values. The NTC Thermistor is a semiconductor that decreases its resistance value as the temperature increases and has a measurement range of −40 to 125 °C. The temperature sensors were calibrated using a thermal bath. The temperature of the bath was varied between 20 and +60 °C with an accuracy of ±0.1 °C. The polynomial equation obtained was saved in the supervisory software. PH monitoring was performed using a shielded, diffusion-type combined electrode produced by MSTecnopon Instrumentação. This pH probe presented the following specifications: measuring range from 0 to 14, operating temperature from 0 to 60 °C, reference system: Ag/AgCl, reference electrolyte: KCl 3M, Coaxial cable and BNC type connector. The calibration of the pH sensor was performed with pH 4 and 7 standard solutions and the calibration curve obtained was automatically saved by the supervisory software. Regarding the PLC output module, the different voltages (12VDC for the water pump and peristaltic pumps) and 220 Volts Alternating Current (VAC) for the heating element and the stirring In the PLC inputs part, the analog signals coming from the sensors were previously conditioned in order to be in adequate conditions to be requested by the microcontroller. This conditioning was performed by means of an electronic low-pass filter in three PIC inputs (two for the bioreactor internal temperature sensors and for the heating tank and one for the pH). Two 10 K Ohm NTC (Negative Temperature Coefficient) temperature sensors were used to obtain the temperature values. The NTC Thermistor is a semiconductor that decreases its resistance value as the temperature increases and has a measurement range of −40 to 125 • C. The temperature sensors were calibrated using a thermal bath. The temperature of the bath was varied between 20 and +60 • C with an accuracy of ±0.1 • C. The polynomial equation obtained was saved in the supervisory software. PH monitoring was performed using a shielded, diffusion-type combined electrode produced by MSTecnopon Instrumentação. This pH probe presented the following specifications: measuring range from 0 to 14, operating temperature from 0 to 60 • C, reference system: Ag/AgCl, reference electrolyte: KCl 3M, Coaxial cable and BNC type connector. The calibration of the pH sensor was performed with pH 4 and 7 standard solutions and the calibration curve obtained was automatically saved by the supervisory software. Regarding the PLC output module, the different voltages (12VDC for the water pump and peristaltic pumps) and 220 Volts Alternating Current (VAC) for the heating element and the stirring motor) must be controlled at the output of the microcontroller, creating the need to design a drive system regardless of the load. The most viable option both economically and practically, was the load activation through a relay system. Five relays from the manufacturer ZND were used in this final system, model ZD-3FF-S-1Z-T, with five pins, operating voltage of 12VDC which allows the activation of loads up to 250VAC at 7 Amperes (A) or 14VDC at 12A. In the last part, the communication system that allowed the exchange of information between the microcontroller and the computer was carried out by means of an asynchronous serial communication, using an Integrated Circuit (IC) MAX232, whose function is to convert the voltage levels of TTL pattern (0-5VDC) from PIC microcontroller to RS-232 pattern (±12VDC) of the RS232 serial type communication port of the microcomputer (PC), and vice versa. The firmware was developed in the MikroC programming and compilation environment, from the company Mikroelektronika, using the C programming language and libraries-Analog to Digital Converter (ADC), Conversions and Universal Asynchronous Receiver/Transmitter (UART)-available in the compiler. These libraries have definitions for the analog/digital conversion and serial port functions that made programming easier. The recording of the program in the PIC microcontroller was performed using the PICkit2 tool together with the MPLAD IDE software from the manufacturer Microchip Technologies Inc. The Firmware was programmed to perform a sequence of functions in a cyclic way, called sweep cycle or scan. The scan time, i.e., the period of time in which the PLC performs this sequence of functions repetitively while in operating mode, was defined in this work in one second. In the initialization stage, the PLC runs tests on the hardware itself to ensure that the system is working properly and loads the process variables and their libraries.
Then, the microcontroller receives information from the supervisor, initial conditions of the experiment or any changes made during the process. In the processing of readings, the values read by the temperature sensors and the pH probe are obtained. In the next step, the microcontroller stores in its memory the parameters from the supervisory software and the values read by the sensors. During the program execution process, the software performs the proportional temperature control procedure and defines the time for which the heating will be on. Therefore, the microcomputer updates its outputs (turning on, off or keeping the current state), the heating element, stirring motor, water pump and peristaltic pumps. Finally, the values read by the sensors and the current states of each actuator are sent to the supervisor, and then a new cycle begins. After assembling the hardware and programming and recording the firmware, several tests were carried out to verify the functioning of the developed PLC. The first test took place in the communication module, when a simple procedure was performed to send information from the computer to the PLC and a return message from the PLC to the computer and vice versa. This test could prove the efficiency of the communication system that was programmed in the software, as well as the physical connections made by the serial connection cable. Then, PLC inputs tests were performed analyzing the measurements made by the sensors. To carry out these tests, a program was developed, which performed the readings of the sensors connected to the PLC every second, and reported: the values of the last reading, the lowest and highest measured values, their average, the number of readings and the historic. It then became possible to analyze the operation of the analog inputs and to test the sensors in controlled temperature and pH environments. Regarding the output module, the actuators activation tests were carried out simultaneously with the supervisory software functioning tests. Finally, a metallic box was developed, with dimensions of 300 mm × 165 mm × 350 mm, called control unit, to accommodate the PLC, the power supplies, water pump and peristaltic valves used in the system for entrance and removal of material from the bioreactor.

Development of Supervisory Software
The supervisory software for control, monitoring and automation was developed by means of a Microsoft Visual Studio 2012 software using the object-oriented programming and the Visual Basic.NET (VB.NET) programming language. The requirements, defined in its initial conception, were temperature and pH online monitoring, automated control of water pump activation, stirring and temperature motor, alarm system for the main critical parameters, storage of collected data in a database, analysis and visualization of parameters monitored in loco and remotely.

Construction and Development of a Biogas Collection and Storage System
The continuous feeding process requires the development of an anti-reflux collection and storage system for biogas due to the different pressures formed in the system during input/output of material and formation of biogas. The system design for this project consists of a gas washer bottle without commercial porous plate, a low-pressure retention valve and a storage device for the generated biogas. In this system, replacing the washer bottle, a gas/liquid trap was developed using a reagent bottle, with 250 mL in volume, and two quick coupling type connectors in order to protect the retention valve and the biogas storage device. 5 L Sigma Aldrich tedlar bags, also known as gas collection bags, were used for gas storage. These bags are built from very thin tedlar film, characterized as a nonreactive material, are extremely low in permeability and flexible over a wide temperature range. The biogas generated in the biodigester was directed to the gas collection bag through a polyurethane hose.

Characterization of Samples to Test Operability of the Biodigester Developed and Biogas Production
In order to evaluate the operational performance of the biodigester developed and the efficiency of biogas production, two experiments were carried out, the first with a batch bioprocess and the other in a semi-continuous system of food residue co-digestion, anaerobic sludge (inoculum) and raw sewage. The raw sewage sample was obtained before any type of treatment of the sewage treatment plant. The characterization was performed considering moisture, pH, Total Solids Volatile (TSV), Total Solids Fixed (TSF) and Total Kjeldahl Nitrogen (TKN). The anaerobic sludge used as inoculum in the experiments was collected from the Upflow Anaerobic Sludge Blanket (UASB) reactor in operation at a local industry, and the same characterizations were carried out for the raw sewage. After the characterization, the sludge was refrigerated (4 • C) until the moment of use. All analyzes were determined according to APHA [19]. The collection of food residues was carried out after lunch in the restaurant of the Federal University of Rio de Janeiro, where leftovers removed from the dishes and utensils were sorted to separate the organic fraction, and homogenized by quartering, following Brazilian standard [20]. Then, the homogenized material was ground with distilled water in appropriate proportions, with part of the crushed material (called food waste) refrigerated (4 • C) until the moment of use, and part frozen (−20 • C). The two experiments were carried out in the same proportion for 60 days, with the addition of anaerobic sludge (inoculum) in the proportion of 20%, to evaluate the seeding effect. In the batch system, there was only one addition of the mixtures (waste, raw sewage and sludge) at the beginning of the experiment, whereas in the semi-continuous system it was fed in the same proportions of the mixtures until 1 L of the biodigester volume was completed, every 10 days during the experiment. The selected moisture was also used as basis for mixing the residues in the biodigester experiments. The mixtures had their pH corrected to values between 7 and 8 using 1 M sodium bicarbonate solution (NaHCO 3 ). In these experiments, analyzes of Total Solids (volatile and fixed), moisture and pH were performed in triplicate before and after the anaerobic digestion process.

Characterization of Biogas Produced
Characterization of the biogas produced was carried out for the CO 2 , CH 4 and H 2 S compounds and performed in a gas chromatograph (GC). The calibration curve of the chromatograph was constructed from 6 points of known concentrations. All samples were made in duplicate, with error less than 5%. The samples were analyzed in duplicate and CO 2 , CH 4 and H 2 S standards, by White Martins were used to calculate the concentrations. The chromatographic conditions for CO 2

Construction of Bioreactor
The bioreactor is the central part of the biogas production process. Figure 3 shows the glass jacketed bioreactor with a volume of 1.3 L and the following dimensions: 170 mm high, 100 mm in diameter and wall thickness 3 mm. The jacket had the same volume as the bioreactor and dimensions of 190 mm in height, 150 mm in diameter and wall thickness of 3 mm. To keep the environment hermetically closed, a polyurethane cover and a base for fixing were designed, connected by threaded bars, with butterfly nuts, which keep the bioreactor hermetically closed, in addition to 5 mouths with nylon connectors that allowed to fix the thermowell, a commercial pH probe, the biogas removal hose and the hose for material inlet/outlet. made in duplicate, with error less than 5%. The samples were analyzed in duplicate and CO2, CH4 and H2S standards, by White Martins were used to calculate the concentrations. The chromatographic conditions for CO2 and CH4 are described as follows: Equipment: Agilent Technologies, model 7820A, with thermal conductivity detector (TCD); Column Type: HP-PLOT Q (30 m x 0.53 mm x 40 μm); Input with Flow splitter 2:1; Heater: T = 200 °C; P = 8 psi; Column: Flow = 7 mL/min, P = 8 psi; Oven: T = 35 °C, Time = 6.0 min; Detector Temperature = 160 °C; Reference Flow = 26 mL/min; Auxiliary Flow = 5 mL/min and Carrier Gas = He and the chromatographic conditions for H2S are describe as follows: Equipment: Varian CP-4900 Micro GC was used with TCD detector; Column Type: PoraPlot Q (PPQ); Column Pressure = 21 psi; Injector Temperature = 80 °C; Column Temperature = 50 °C, Injection Time = 20 ms; Time = 100 s and Carrier Gas = He.

Construction of Bioreactor
The bioreactor is the central part of the biogas production process. Figure 3 shows the glass jacketed bioreactor with a volume of 1.3 L and the following dimensions: 170 mm high, 100 mm in diameter and wall thickness 3 mm. The jacket had the same volume as the bioreactor and dimensions of 190 mm in height, 150 mm in diameter and wall thickness of 3 mm. To keep the environment hermetically closed, a polyurethane cover and a base for fixing were designed, connected by threaded bars, with butterfly nuts, which keep the bioreactor hermetically closed, in addition to 5 mouths with nylon connectors that allowed to fix the thermowell, a commercial pH probe, the biogas removal hose and the hose for material inlet/outlet.

Construction of Biodigester with Heating and Agitation Systems
The purpose of supplying heat to a biodigester is to keep the temperature inside the bioreactor constant. The cartridge-type resistance used at 1000 W power and the water pump were acquired to be used in the heating system. A mechanic agitation model was developed using a long axis with vertical entrance to the bioreactor and that rotates the

Construction of Biodigester with Heating and Agitation Systems
The purpose of supplying heat to a biodigester is to keep the temperature inside the bioreactor constant. The cartridge-type resistance used at 1000 W power and the water pump were acquired to be used in the heating system. A mechanic agitation model was developed using a long axis with vertical entrance to the bioreactor and that rotates the agitators slowly and in brief and previously defined time intervals. A digital, bivolt mechanical stirrer with two drive shafts was used to perform the rotation of the stirring rod. Figure 4 shows the heating and agitation system of the biodigester developed.
Biomass 2022, 2, FOR PEER REVIEW 8 agitators slowly and in brief and previously defined time intervals. A digital, bivolt mechanical stirrer with two drive shafts was used to perform the rotation of the stirring rod. Figure 4 shows the heating and agitation system of the biodigester developed.

Construction of Control Unit and Supervisory Software Development
The Programmable Logic Controller is a digital electronic equipment, consisting of hardware and embedded software (firmware), which performs automation, control and monitoring functions. After assembling the hardware and programming and recording the firmware, the PLC, the power supplies, the water pump and the peristaltic valves, used in the system for input/output of material from the bioreactor, were placed in a metal box designed to this project, as shown in Figure 5. The supervisory software developed is a software for supervision and control of processes in real time and for data acquisition, aimed to perform all steps in simple and intuitive interfaces.

Construction of Control Unit and Supervisory Software Development
The Programmable Logic Controller is a digital electronic equipment, consisting of hardware and embedded software (firmware), which performs automation, control and monitoring functions. After assembling the hardware and programming and recording the firmware, the PLC, the power supplies, the water pump and the peristaltic valves, used in the system for input/output of material from the bioreactor, were placed in a metal box designed to this project, as shown in Figure 5. The supervisory software developed is a software for supervision and control of processes in real time and for data acquisition, aimed to perform all steps in simple and intuitive interfaces.
Biomass 2022, 2, FOR PEER REVIEW 8 agitators slowly and in brief and previously defined time intervals. A digital, bivolt mechanical stirrer with two drive shafts was used to perform the rotation of the stirring rod. Figure 4 shows the heating and agitation system of the biodigester developed.

Construction of Control Unit and Supervisory Software Development
The Programmable Logic Controller is a digital electronic equipment, consisting of hardware and embedded software (firmware), which performs automation, control and monitoring functions. After assembling the hardware and programming and recording the firmware, the PLC, the power supplies, the water pump and the peristaltic valves, used in the system for input/output of material from the bioreactor, were placed in a metal box designed to this project, as shown in Figure 5. The supervisory software developed is a software for supervision and control of processes in real time and for data acquisition, aimed to perform all steps in simple and intuitive interfaces.

Biodigester Complete Operating System
A scheme of test equipment, developed and used in this project, is represented in Figure 6, consisting of the jacketed vertical anaerobic biodigester, in bench and batch scale and in a single stage, which can be used in semi-continuous or batch system and is equipped with heating systems, mechanical agitation, collection and storage of biogas, and control, monitoring and automation.

Biodigester Complete Operating System
A scheme of test equipment, developed and used in this project, is represented in Figure 6, consisting of the jacketed vertical anaerobic biodigester, in bench and batch scale and in a single stage, which can be used in semi-continuous or batch system and is equipped with heating systems, mechanical agitation, collection and storage of biogas, and control, monitoring and automation.

Characterization of Waste
During the efficiency stage between biogas production with biodigester in semi-continuous system and the operation in batch system, three collections of secondary sludge, food waste and raw sewage were made before treatment in the sewage treatment plant. The other characterizations are presented in Table 1. The residues had an acid pH, below 7, indicating that their final mixture will have acid pH, and that the addition of an alkalizing agent was necessary in order to adjust the pH at the beginning of the experiments. Initially, the pH adjustment was performed with NaHCO3, which could make the anaerobic treatment difficult, as it would cause an increase in the concentration of sodium at inhibitory levels. The high TVS value in food waste indicates the possibility of increase in biogas production, especially methane, when mixed with anaerobic sludge. A TFS concentration higher than TVS for the raw sewage can be observed, a result that may be due to the fact that the raw sewage collection is

Characterization of Waste
During the efficiency stage between biogas production with biodigester in semicontinuous system and the operation in batch system, three collections of secondary sludge, food waste and raw sewage were made before treatment in the sewage treatment plant. The other characterizations are presented in Table 1. The residues had an acid pH, below 7, indicating that their final mixture will have acid pH, and that the addition of an alkalizing agent was necessary in order to adjust the pH at the beginning of the experiments. Initially, the pH adjustment was performed with NaHCO 3 , which could make the anaerobic treatment difficult, as it would cause an increase in the concentration of sodium at inhibitory levels. The high TVS value in food waste indicates the possibility of increase in biogas production, especially methane, when mixed with anaerobic sludge. A TFS concentration higher than TVS for the raw sewage can be observed, a result that may be due to the fact that the raw sewage collection is performed before entering the primary decanter, i.e., there is still a lot of solid to be removed.

Efficiency of Co-Digestion in Different Types of Processes
At this stage, the objective was to test the biodigester and the efficiency of co-digestion for biogas production. Two experiments were carried out. Experiment 1 was performed in a batch system and experiment 2 in a semi-continuous system, both for 60 days. In both of them, a mixture of food waste, raw sewage without treatment and anaerobic sludge (inoculum) were used in the same proportions. Experiment 2 was fed every 10 days until the 60th day and in the feeding, 80% of the volume was removed and the same amount was added with food waste and raw sewage and experiment 1 was only fed at the beginning. The efficiency of the anaerobic co-digestion bioprocess showed, for experiment 1, low removal of volatile solids, compared to experiment 2, but with constant removal from the beginning. In experiment 1, there was removal of total and volatile solids of 52.5% TS and 60.4% TVS, and experiment 2 showed high removal of organic matter, expressed by the removal of 68.5% TS and 80.7% TVS. The average production rate and the total biogas volume produced in experiment 1 were respectively 0.4 L/day and 18.5 L, and in experiment 2, respectively, 1.5 L/day and 68.5 L. Srisowmeya et al. [21] evaluated that for processes carried out with USW and at mesophilic temperatures, it was possible to find volatile solids removals in the ranges of 71.6% with 24 days of experiment and in cases where there was recirculation, the removal can be optimized, reaching 80% in 12 days of experiment. The efficiency of methane production associated with pH variation in biogas production is shown in Figure 7. H 2 S behavior was similar for the two biodigesters.

Discussion
During the experiments carried out with the developed biodigester, some adjustments were necessary, such as the PLC communication test that demonstrated the information dispatch and receipt was working within the programmed time of one second. On

Discussion
During the experiments carried out with the developed biodigester, some adjustments were necessary, such as the PLC communication test that demonstrated the information dispatch and receipt was working within the programmed time of one second. On the other hand, the test experiments of PLC input showed that the input module was working; however, the readings were oscillating, especially the pH sensor. In general, these variations occur due to electronic noise in the system and for this reason electronic filters were previously installed in each of the inputs. The solution for this problem was the implementation of a digital average moving filter, for a set of five samples, to the embedded software. This type of filter is obtained by calculating the average of a set of values, always adding a new value to the set while discarding the oldest one at each reading. After the application of this filter the sensors showed, in 25 readings, a variation of +/− 0.4 • C; temperature and pH +/− 0.06. It can be concluded that the PLC analog input module and the sensors worked well and presented a stable reading signal. The developed software supervised and controlled the processes in real time, including data acquisition. In the developed window, the operator can determine all parameters of control and monitoring and the biodigester automation, before and during the experiment, and provide the operator with interaction and visualization of the equipment. Regarding the biodigesters, it was observed that, during the 60 days of the experiment, the materials used in the bioreactors construction showed good results and were suitable for the anaerobic digestion process. The sealing system was efficient and maintained the environment hermetically closed, which was evidenced by the absence of odors in the place with low H 2 S concentration, efficiency of the organic matter removal process and biogas production. Throughout the test experiment, the heating and temperature control systems were efficient, considering that they did not present any faults; the volume of thermal fluid was adequate for heating the medium in fermentation; and the resistance was able to reach and maintain the temperature at the value established by the control system. The temperature in most of the experiments was maintained at 37 ± 0.3 • C. In addition, the agitation automation systems worked as expected and did not present failures in the test experiment. The motor and stirring rod were able to maintain mixing and homogenization of the medium.
After carrying out the experiments in batch and semi-continuous systems, it could be observed that the semi-continuous system showed better efficiency in the removal of organic matter, biogas volume and CH 4 percentage. H 2 S behavior was similar for the two experiments. The behavior of the gases (CH 4 , CO 2 and H 2 S) was similar during the experiments, i.e., initially there was a high production of CO 2 (acetogenesis phase) and over time the concentration was decreasing and increasing methane concentration with basic pH. In experiment 1 it was necessary to adequate the pH during the first 20 days and in experiment 2 in the initial 15 days. The necessary pH control had addition of using 1 M sodium bicarbonate solution (NaHCO 3 ).

Conclusions
It was possible to evaluate the influence of both food waste and raw sewage codigestion without treatment in the biogas production for different processes of anaerobic digestion, with the semi-continuous process being the most efficient in the removal of organic matter and production of biogas. This greater efficiency, compared to the batch process, can be attributed to the addition of residue, raw sewage and sludge mixtures throughout the experiment, as it may have increased the amount of organic matter and microorganisms in the medium, facilitating biodegradation and, consequently, greater biogas production. The lower efficiency of the experiment in the batch system may be associated with the composition of substances present in the raw sewage of low biodegradability. The main results obtained in this work allowed us to evaluate/conclude that the biodigester developed, in addition to the operation flexibility, is clean and presents easy maintenance. The agitation system developed for the biodigester provided the mixture of the medium according to its design, and the heating system was effective in the mesophilic biodigestion process. The control, monitoring and automation system developed for the anaerobic biodigestion process proved to be efficient and presented the main functionalities and architecture of commercial PLCs. In addition, the supervisory software was efficient in all aspects defined in its conception: display of monitoring data and process parameters; storage of monitored data, system and experiments configuration; display of historical monitoring data in different formats; visual alarm system and e-mail of critical parameters to the process; and remote equipment monitoring and control. Regarding the biodigestor developed, it can be used for semi-continuous and batch bioprocesses, allowing the flexibility of operation for different types of substrates. The biodigester physical system was adequate and allowed us a clear visualization of the fermentation medium, in addition to checking whether the agitation system is being effective or not, and to ensuring the low production of H 2 S in biogas, due to the complete sealing of the system which prevents oxygen into the medium. Finally, with these and other results found, we can conclude that the biodigester developed with the automation and control system was satisfactory for the reduction in organic matter and biogas production. All operating parameters worked properly and with the use of current, low-cost technologies, the application and development on a larger scale becomes viable in the future.