A stochastic model for diffusion in a semiconductor layer under the effect of an external potential and non-uniform temperature