Photosynthesis is the process by which plants, algae, and some microorganisms use solar energy to convert carbon dioxide and water into glucose and oxygen. It occurs in two stages - the light reactions where solar energy is captured to make ATP and NADPH, and the carbon reactions where ATP and NADPH are used to incorporate CO2 into organic compounds to make glucose. The light reactions take place in the thylakoid membranes of chloroplasts and use two photosystems to transfer electrons and pump protons, generating a proton gradient used to make ATP. The carbon reactions occur in the chloroplast stroma and involve the Calvin cycle to reduce CO2 into glucose using the products of the light reactions.