We propose a new scheme to systematically design optimized connection atoms for arbitrary quantum mechanics/mol. mechanics (QM/MM) boundaries: the pseudopotential of the boundary atom is optimized such that it minimizes the errors in the electronic structure due to the truncation of the QM region. In plane wave based electronic structure calcns. the interactions between core and valence electrons are usually represented by effective core potentials. These pseudopotentials are usually constructed such that the shape of the at. valence orbitals outside a certain core radius is reproduced correctly with respect to an atomistic all-electron calcn. For the purpose of optimized boundary atoms we tune systematically all parameters in the analytic pseudopotential with the help of perturbation theory. Optimized connection atoms allow a minimization of the size of the QM region and therefore to increase the time scale of current QM/MM calcns. by orders of magnitude. [on SciFinder (R)]