Electric potentials at the atomic scale