## 1 Introduction  
Undoubtedly, heavy metals pose a significant risk to human health [1], so certain elements such as As, Cd, Pb, and Hg have been designated among the top 10 most dangerous substances of public health concern by the World Health Organization [2]. Due to their low clearance from the human body and significant environmental pollution from anthropogenic and human activities, the issue of detection and removal of heavy metals has become of paramount importance. In addition to classical methods based on atomic absorption for heavy metal ion detection, electrochemical detection offers a complementary approach that excels in sensitivity, selectivity, and versatility [3]. Moreover, with the need for less complex equipment, the electrochemical approach becomes simpler to implement. Among various electrodes utilized as sensors for the detection of heavy metal ions, semiconductors have garnered significant attention due to their excellent electrochemical properties and wide range of working potentials, cost effectiveness, non-toxic nature, and, notably, their substantial geometric surface area, particularly in the form of nanostructures [4]. This unique characteristic enables them to effectively accumulate a large quantity of metal ions on their surface, leading to improved detection capabilities. From the various semiconductor materials, Ti/TiO\({}_{2}\) received great attention when Fujishima and Honda [5, 6] unveiled its remarkable potential in the photocatalytic splitting of water on a TiO\({}_{2}\) electrode under UV light irradiation. Applications for TiO\({}_{2}\) have emerged in a number of exciting domains in recent decades, including photovoltaics, photocatalysis, and sensors [7]. Apart from the aforementioned intrinsic benefits, nanomaterials based on TiO\({}_{2}\) also possess non-toxic, biocompatible, photocorrosion-resistant, and economic properties [8; 9]. Furthermore, a wide range of mild temperatures and mild environmental conditions enables the production of TiO\({}_{2}\)-based nanomaterials at a low cost, owing to the availability of a variety of nanostructures that permit an exceptionally high real surface area in relation to geometric and unique chemical, physical, and electronic properties [5; 6]. Consequently, research into the structures, transmission mechanisms, and system modulation functions of TiO\({}_{2}\) nanomaterials for sensing applications has generated great interest [10; 11]. For instance, in order to improve the sensing properties of TiO\({}_{2}\) nanotubes, [PERSON] et al. [12] used electrochemically self-doped TiO\({}_{2}\) nanotubes to monitor the electrochemical oxidation of Fe(CN)\({}_{6}\)\({}^{4-}\) and p-phenylenediamine, revealing them to be an excellent platform for sensors. Self-doped Ti/TiO\({}_{2}\) nanotube electrodes have drawn much interest as sensors because of their large surface area, improved electrical conductivity, stability, and durability. Because of its improved adsorption capacity and effective charge transfer capabilities, self-reduced TiO\({}_{2}\) with enhanced defect states increases the sensitivity, selectivity, and limit of detection of heavy metal ions in electrochemical sensing. Nevertheless, the applications of TiO\({}_{2}\) nanotubes as a sensor for the electrochemical detection of heavy metal ions are still in their infancy, and to our knowledge, only few examples based on TiO\({}_{2}\) oxide [13; 14] or functionalized TiO\({}_{2}\) nanotubes [15; 16] can be found in the literature. Usually, the process of electrochemical detection entails the deposition of metal ions onto the electrode surface either through controlled potential (typically employed with solid electrodes) or under open-circuit conditions (commonly used with modified electrodes). The former technique allows for the simultaneous detection of multiple ions, whereas the latter method enhances selectivity.