An injection device for injecting medication to a patient, comprising a surface (5) having a through hole (3) for passage of a needle and a capacitive proximity sensor (12, 13, 30) for detecting proximity or contact of human skin to/with said surface (5), is characterised in that said capacitive proximity sensor (12, 13, 30) is so set that a mere contact of a finger on said surface (5) is not detected, and/or is so set to substantially not detect dry clothes, and/or is so set to substantially not detect any of the following materials: dry cotton, dry leather, and/or is so set to substantially not detect any of the following materials: wood, plastic, metal, ceramic, glass.