|Fig. 1: Diatoms, one of the most promising varieties of algae for fuel production. (Source: Wikimedia Commons)|
By the thermodynamic definition, the Earth is a closed system: negligible amounts of matter flow into or out of it, but energy can flow in from the sun and out as radiated heat. What this means for sustainability is that the energy we use must ultimately come from the sun, and in order to be truly sustainable, we must acquire usable energy from the sun at the same rate at which we wish to use it. The sun doesn't replenish the world's supply of fossil fuels as quickly as we use them, since fossil fuels take millions of years to form, so sustainability requires faster ways to capture solar energy. Photovoltaic and thermal solar panels are one method, and photosynthesis is another. The focus here will be on photosynthesis, and how microorganisms grown and often genetically engineered for this purpose can provide an energy pathway from the sun to our vehicles and electronics that is worthy of consideration.
An advantage of photosynthesis over photovoltaics as a way to capture solar energy is that it comes with a built-in method of energy storage: oils. Formed from elements near the top of the periodic table, oils consist of strong bonds between relatively light atoms, meaning high energy density per unit mass, so it makes sense that organisms tend to use oils as energy storage. Sugars and starches also store energy, but they're not as energy dense as oil because the presence of oxygen adds weight without adding high-energy bonds that will release their energy during combustion. Photosynthesis also removes CO2 from the atmosphere in order to produce any of these hydrocarbons, so even if these fuels are burned later to produce CO2, theoretically no more CO2 will be released into the air this way than was originally taken out of the air, so we'd have a sustainable CO2 cycle if we managed to only combust the products of recent photosynthesis ("recent" meaning not fossil fuels).
The goal, then, is to find and/or engineer organisms that use photosynthesis to produce proportionally high amounts of oil as opposed to starch or sugar, and at the moment several species of algae appear to be promising candidates. Algae produce much higher oil yields per unit land area than agricultural crops, with oil accounting for 40-60% of the ash-free dry weight (a measure of organic mass) in nutrient-stressed diatoms, one of the most promising types of algae. [1,2] Harvesting this oil from the algae, however, as well as getting the algae to produce it, can be a challenge depending on the climate where the algae is grown. To harvest the oil, the algae must be concentrated through centrifugation, flocculation, and/or drying because of how dilute the algae culture is in the water where it's grown. This harvesting process can account for 3.3-30% of the algal production costs - at the higher end if the climate doesn't allow for sun-drying the algae.  Sufficient sun, warmth, and protection from contaminants are required for the algae to thrive and produce their maximum amounts of oil, especially lab-produced algae that may not be as robust when grown outdoors, so enclosed photoreactors have been considered as an alternative to the open raceways used currently for industrial algae growth. [2,3] The enclosures can only provide the algae with a more comfortable temperature and protect them from contaminants, but low amounts of sunlight can still be a problem.  In terms of the land resources required to grow the algae, algae can grow in brackish waters, so algae farms don't have to compete with land crops or freshwater production. It's been estimated that it would take less than 0.1% of the land area in the US with a suitable climate to produce 1.055 x 1018 joules per year, so algae could contribute measurably to the world energy budget (515.5 x 1018 joules consumed in 2011, 33.1% of which were oil). [1,4] In terms of production costs, raceways produced algal oil for $14.44 per liter in 2009, while enclosed photoreactors were $24.60 per liter - much higher than fossil oil is currently, but worth consideration as fossil fuels become increasingly scarce and expensive to extract, especially if research continues to produce algae varieties and methods of working with them that are more energy efficient. Costs can also be lower than these if the algae are grown in more suitable climates than British Columbia, where this study was done.  Finally, in terms of the energy balance, algal oil's energy density is about 37 x 106 joules per liter, and each liter results in a byproduct of ethanol made from the algae's starch: 46.7 x 106 joules for raceways, 21 x 106 joules for photoreactors. The production of each liter of oil plus the ethanol costs 52.4 x 106 joules for raceways and 50.3 x 106 joules for photoreactors, which means a net energy gain in both cases, more for raceways.  Based on these numbers, photosynthesis doesn't appear capable of entirely replacing fossil fuels on its own (unless humanity somehow dramatically decreases its energy demands), but it can at least be a good replacement for gasoline and other fossil oils in applications where high energy-density fuels are needed most.
Even in areas where the amount of sunlight and warmth may not be sufficient to grow and dry photosynthetic algae, there will inevitably still be waste biomass from food waste and agricultural waste, and the chemical bonds in this waste are a potential source of energy if the energy can be harvested with enough efficiency to make the effort worthwhile. Algae and bacteria both have species capable of heterotrophic metabolism, so they can consume the biomass and produce oil without needing additional sunlight. [2,5] The use of algae in this type of fermentation process is the method of algal biofuel production recommended by the British Columbia Innovation Council due to unfavorable outdoor environments for algae in that part of the world. The base case fermenter produced algal oil for $2.58 and 23.4 x 106 joules per liter, much cheaper than the production costs mentioned in the previous section, although the ethanol byproduct is also less: 7 x 106 joules per liter oil.  Alternatively, bacteria such as E. coli are relatively easy to genetically engineer, and researchers have already designed E. coli and other bacteria to produce specific types of oil that are useful as fuel: one group is designing cells to produce "biocrude" oil that can be processed at a refinery similarly to crude oil, and another is trying to get the cells to directly produce oils that would need little or no refinement before they can be used a fuels.  While these more advanced biofuels are in development, there are already simpler, cheaper systems that can be used in individual homes even in a Cairo slum: biogas reactors that use native microorganisms to break down food waste and produce methane, which can then be used in electric generators or simply burned for space heating or in gas stoves. 
Hydrocarbon fuels like oil and methane are not the only fuels that microorganisms can produce. Nitrous oxide's decomposition into O2 and N2 (essentially, air) is also exothermic, and while this reaction isn't as energy-dense as the formation of CO2 through combustion, it's nonetheless a way to harvest energy from the unwanted nitrogen compounds that can be found in waste water. The waste water entering a water treatment plant contains nitrogen compounds such as nitrites and nitrates, especially if the water contains runoff from farms that use nitrogen compounds as fertilizer. These compounds need to be removed from the water in order to prevent eutrophication of bodies of water with limited nutrients, which is to say massive algal blooms that deplete the oxygen in the water and leave vast dead zones along the edges of the oceans, not to mention the toxic effect of ammonia on aquatic life. Microbes are already in use at waste water treatment plants, but they could potentially not only help eliminate unwanted compounds, but also produce nitrous oxide, which can then be decomposed with the help of a catalyst to release heat that can in turn be used to generate electricity. Research has been done at Stanford for this purpose, cultivating bacteria species that efficiently produce N2O from waste water. 
Overall, considering the abundance and existing abilities of microorganisms, as well as the relative ease with which they can be bred or engineered to produce compounds that are useful as fuels, microorganisms seem to be a promising way to replace some of our fossil fuel usage with hydrocarbon and other chemical fuels that can be produced in real-time as we consume them. Photovoltaics, thermal solar power, and other methods of using the sun's energy will inevitably also help meet humanity's demand for power, but making use of the energy in waste biomass and waste water can definitely contribute, and for applications that work best with an energy-dense, oil-like fuel (like aviation, or to a lesser extent, ground vehicles), oils produced by bacteria and/or algae may be the best option.
© Ashley Micks. The author grants permission to copy, distribute and display this work in unaltered form, with attribution to the author, for noncommercial purposes only. All other rights, including commercial rights, are reserved to the author.
 J. Sheehan, et al., "A Look Back at the U.S. Department of Energy's Aquatic Species Program - Biodiesel from Algae," U.S. National Renewable Energy Laboratory, NREL/TP-580-24190, July 98.
 A. O. Alabi, M. Tampier and E. Bibeau, "Microalgae Technologies and Processes for Biofuels/Bioenergy Production in British Columbia: Current Technology, Suitability and Barriers to Implementation," British Columbia Innovation Council, 14 Jan 09.
 D. Chaumont, Biotechnology of Algal Biomass Production: A Review of Systems for Outdoor Mass Culture," J. Appl. Phycology 5, 593 (1993).
 "BP Statistical Review of World Energy 2012," British Petroleum, June 2012.
 N. Savage, "Making Gasoline from Bacteria," Technology Review, 1 Aug 07.
 K. Than, "Cairo Slums Get Energy Makeover,"National Geographic News, 28 Aug 09.
 D. Strain and M. Shwartz, "Stanford Engineers Use Rocket Science to Make Wastewater Treatment Sustainable," Stanford Report, 26 Jul 10.