Upon illumination of the chloroplasts, the pH of the stroma rises from 7.0 to 8.0 because of the proton (hydrogen ion, ) gradient created across the thylakoid membrane. The movement of protons into thylakoids is driven by light and is fundamental to ATP synthesis in chloroplasts (Further reading: Photosynthetic reaction centre; Light-dependent reactions). To balance ion potential across the membrane, magnesium ions () move out of the thylakoids in response, increasing the concentration of magnesium in the stroma of the chloroplasts. RuBisCO has a high optimal pH (can be >9.0, depending on the magnesium ion concentration) and, thus, becomes "activated" by the introduction of carbon dioxide and magnesium to the active sites as described above.