Electric energy generated by clean and renewable sources, such as biogas, is a subject widely discussed and of global importance. Biogas, besides being an alternative to other fuels uses a raw material, which in many cases is considered disposable, worthless and harmful to the environment when not correctly disposed of. Several factors influence the design, operation and collection of the final product. This paper is a technical economic viability report about three biogas projects, which have already been published, and presents the main difficulties and advantages encountered during the whole process involving biogas production, as well as its economic viability when used to generate electrical energy. The analysis show that the use of biogas from wastes of pig farms is economically viable, since all biogas produced is nearly totally used for electrical power generation.