A method of detecting proximity, comprising the steps of: a) manufacturing a mobile device including a proximity sensor formed by a capacitive touch controller and a sensing element coupled to the capacitive touch controller; b) using a reading of the capacitive touch controller to determine a first compensation value of the capacitive touch controller while manufacturing the mobile device when an area adjacent to the sensing element is substantially free of material external to the mobile device having an effect on capacitance of the sensing element; c) storing the first compensation value in a register implemented as a read-only memory; d) using a further reading of the capacitive touch controller to determine a second compensation value of the capacitive touch controller under environmental conditions in which the mobile device is likely to be used, and storing the second compensation value in a proximity compensation offset register; e) comparing the second compensation value to the first compensation value to evaluate the second compensation value as a valid compensation value or an invalid compensation value, wherein the second compensation value is a valid compensation value if the second compensation value is within an allowable range relative to the first compensation value; f) repeating steps d) to e) if the second compensation value is evaluated as an invalid compensation value; g) adjusting subsequent readings of the capacitive touch controller using the second compensation value stored in the proximity compensation offset register by an offset compensation if the second compensation value was evaluated as a valid compensation value. a) manufacturing a mobile device including a proximity sensor formed by a capacitive touch controller and a sensing element coupled to the capacitive touch controller; b) using a reading of the capacitive touch controller to determine a first compensation value of the capacitive touch controller while manufacturing the mobile device when an area adjacent to the sensing element is substantially free of material external to the mobile device having an effect on capacitance of the sensing element; c) storing the first compensation value in a register implemented as a read-only memory; d) using a further reading of the capacitive touch controller to determine a second compensation value of the capacitive touch controller under environmental conditions in which the mobile device is likely to be used, and storing the second compensation value in a proximity compensation offset register; e) comparing the second compensation value to the first compensation value to evaluate the second compensation value as a valid compensation value or an invalid compensation value, wherein the second compensation value is a valid compensation value if the second compensation value is within an allowable range relative to the first compensation value; f) repeating steps d) to e) if the second compensation value is evaluated as an invalid compensation value; g) adjusting subsequent readings of the capacitive touch controller using the second compensation value stored in the proximity compensation offset register by an offset compensation if the second compensation value was evaluated as a valid compensation value.