Sensing by means of electric discharges