Novel approach to optimize quantum dot (QD) materials for specific optoelectronic applications is based on engineering of nanoscale potential profile, which is created by charged QDs. The nanoscale barriers prevent capture of photocarriers and drastically increase the photoelectron lifetime, which in turn strongly improves the photoconductive gain, responsivity, and sensitivity of photodetectors and decreases the nonradiative recombination losses of photovoltaic devices. QD charging may be created by various types of selective doping. To investigate effects of selective doping, we model, fabricated, and characterized AlGaAs/InAs QD structures with n-doping of QD layers, doping of interdot layers, and bipolar doping, which combines p-doping of QD layers with strong n-doping of the interdot space. We have measured spectral characteristics of photoresponse, photocurrent and dark current. The experimental data show that providing the same electron population of QDs, the bipolar doping creates the most contrasting nanoscale profile with the highest barriers around dots.