The energies for the ground and excited states of a D 0 impurity located at the center of a GaAs/ Ga 1Àx Al x As spherical quantum dot are calculated, in the effective-mass approximation, as functions of the dot radius R and spatial size. We use a variational procedure and take linear combinations of Gaussian and Slater orbitals for the impurity-envelope wave functions. A model barrier potential is proposed to study changes in the potential introduced by diffusion effects. The binding energy of a 1s 2 -like D À impurity is also studied by considering a parabolic correlation factor. It is found that the D 0 and D À binding energies increase as the dot size decreases up to a critical dot radius R R c and then, for R slightly smaller than R c , the impurity wave function spreads to the barrier region and the 3D character is rapidly restored. The critical dot radius R R c is estimated by using the uncertainty relations.