Source of energy for producing ATP in the chemiosmotic process is the gradient of protons ( hydrogen ions, H+). An H+ gradient has potential energy and can be used to power chemical reactions when the ions pass through a channel (ATP synthase). H+ will diffuse from an area of their higher concentration to an area of lower H+ concentration. An electrochemical concentration gradient of H+ across a membrane can be harnessed to make energy in the form of ATP. ATP synthase allows H+ to pass through the membrane and uses the free energy difference to phosphorylate ADP (ADP+pi=ATP).
The gradient of H+ is made from the e- movement through electron transport chains during cellular respiration or photosynthesis.