A newly designed thin-layer STM (TLSTM) technique is presented based on a microfabricated probe combining an electrolytic STM probe with an annular iridium oxide microelectrode operating as a potential-controlled generator or scavenger of H+. This TLSTM configuration can be used to combine in situ STM studies of electrode processes with the simultaneous investigation of H+ flux integrals associated with the electrode reaction. In this paper, the technique is applied to investigate the H+ exchange behaviour of electropolymerised polyaniline films and associated STM-relevant properties in 0.5 M NaClO4 + 10-2 M HClO4. For a polyaniline film kept in the intermediate (emeraldine) oxidation state at 0 mV versus MSE it is shown that its thickness increases due to H+ insertion if the pH is lowered from pH 2 to ca. 1.6, and that its conductivity decreases significantly if the pH is increased from 2 to ca. 12. In a second experiment, where the exchange of H+ at pH 2 is monitored during film oxidation and reduction within the potential range of both redox transfer steps, it is shown that significant exchange of H+ occurs only in the interval of the second (emeraldine/pernigraniline) redox transfer. © 2001 Elsevier Science Ltd. All rights reserved.