A measure of water chemistry, pH does not exist in a vacuum; carbon dioxide levels, water hardness and alkalinity (the amount of acid water can buffer before reaching a set pH level) all interact with pH, and each other. Aquatic plants are part of this system, effecting and affected by changes in these four factors.
Aquarium pH is a measurement of acid vs. basic ions (H+ and OH-) in the water on a scale of zero to 14. Lower than 7 is acidic, higher than 7 is alkaline. Plants have a wider range of tolerance for pH in an aquarium than fish or other aquatic creatures. Some studies show aquarium plants healthy within a pH range of 6 to 9. Most fish are healthy at a range of 6.5 to 7.5. Slightly acidic pH allows plants to absorb ammonium—produced by the animals in the aquarium—as nutrients.
If your aquarium plants must share their aquarium environment with fish or other animals, you will need to monitor the pH so that plant and animal needs can be met at the same time. Plants may be healthy at high pH levels where levels of ammonia are toxic to fish. Conversely, pH that is lower than optimum inhibits the fishes' ability to absorb oxygen through the gills.
High concentrations of carbon dioxide (CO2) will lower pH, usually found with lower concentrations of oxygen (O2). Photosynthesis can build O2 levels faster than the O2 is consumed, and greatly reduce CO2 levels. If CO2 levels are not high enough, plants will manufacture it from calcium and magnesium in the water, raising the pH. The toxicity of ammonia increases with higher pH.
Daily fluctuations in pH can be expected based on the day/night cycle. At night, while plants stop taking in CO2 for photosynthesis, animals are still producing CO2 and both plants and animals use O2 at night. The excess CO2 released into the water combines with water molecules to become carbonic acid, lowering the pH. Water hardness is a large factor in daily fluctuation of pH: hard water—usually with calcium and magnesium in solution—will show more stable pH due to the high buffering capacity of the water alkalinity, where soft water—with low alkalinity—will show changes in pH from under 6 in the early morning to as high as 11 by mid-afternoon, due to photosynthesis by aquatic plants.
To balance pH with aquarium plants and fish in the tank, moderate to high water alkalinity and hard water will keep fluctuations in CO2 and O2 levels, and ammonium vs. ammonia levels in check. A healthy biological filter will reduce ammonia levels. Devices to add CO2 can be purchased at aquarium supply stores.
If you use a mechanical means to add CO2 to your aquarium so that photosynthesis does not raise pH, be sure to turn off the device when the aquarium lights are turned off. Plants do not use CO2 at night and the excess CO2 can suffocate fish.