Plants obtain carbon from atmospheric CO2 during photosynthesis. They obtain minerals and nutrients such as nitrogen from the soil, or sometimes through other means.