P n junction with depletion region