1 Introduction

The global need for inexpensive, sustainable energy sources has spurred a plethora of research to increase the sustainability and effectiveness of alternative energy systems. The shift toward sustainable and environmentally friendly energy sources such as solar systems has been fueled by the realization that conventional fossil fuels are finite. A solar system is a sustainable, renewable, and eco-friendly power system that can be owned by both institutional and home levels [1, 2]. Despite the well-known efficiency of converting sunlight into electrical power, the production of silicon- cells production is still not environmentally acceptable. Hence, researchers are actively working to produce alternative solar cells that are affordable, efficient in converting energy, eco-friendly, and have a sustainable environmental impact by looking into new materials and manufacturing procedures [3, 4]. In comparison to silicon-based photon-to-electricity converting systems, dye-sensitized solar cells (DSSCs) are more advantageous in low cost, simplicity of fabrication, and effective light collecting, which have drawn a considerable deal of research interest to them [5]. Because they use available natural materials and don't require high-energy production methods, DSSCs have a substantially lower environmental effect than silicon-based cells [6]. This puts DSSCs in a strong position to be widely adopted in the movement for sustainable energy alternatives.

Plant-derived natural colors are becoming more and more popular as viable photo catalysts for dye-sensitized solar cells (DSSCs) because of their quantity, renewability, and ecological sensitivity. In keeping with the global movement toward alternative energy, these natural colors offer a distinctive substitute for synthetic sensitizers [7]. Optimized photon-to-electricity conversion can be accomplished with the least amount of environmental impact by utilizing naturally occurring pigments, such as those from saffron, red onion, mallow, and oregano [8]. Natural pigments that include Carotenoids and chlorophylls have a wide range of spectra that improve light absorption and photoelectron production [9]. These plants are promising sources for DSSCs because of their high pigment content and electrochemical activity, which provides efficient, eco-friendly, and sustainable sensitizers. The successful use of hibiscus acetosella pigments, which combine anthocyanin and betacyanin, in dye-sensitive solar cells (DSSCs) underscores the significance of dye stability, electron transfer capability, and light absorption range [1, 10]. Finding the best natural dyes that strike a balance between these attributes and are simple to extract and purify still presents a difficulty [11].

The Persicaria lapathifolia (species of Polygonaceae family), is a plant frequently found in marshes and wetlands, offers a plentiful supply of natural colors that are appropriate for use in DSSC applications. This plant, which is well-known for its vigorous growth and broad dispersion, is a sustainable and easily accessible source of flavonoids, anthocyanins, and other pigments with potent light-absorbing abilities [12]. It is a strong contender for large-scale pigment extraction due to its adaptability to a variety of climatic conditions. Furthermore, the ecological advantages of using a plant with a large abundance and rapid growth, such as Persicaria lapathifolia, are in line with the ideas of sustainable development [13]. Hence, it has diversified natural pigments, especially anthocyanins, and others that have broad absorption spectra and outstanding stability are two essential qualities for successful DSSC dyes.

For that reason, appropriate extraction techniques and the meticulous choice of plant material for electro active phytochemicals encourage researchers to obtain sensitizers that may significantly enhance the long-term reliability and effectiveness of DSSCs. In addition, a high yield and stable pigments for DSSC applications can be achieved by using the right solvent-to-acid ratio along with varying the types of acids utilized, such as organic and inorganic acids. More to illustrate, [14] reported that the solvent effect on extraction and stability of anthocyanin extracted from Caesalpinia pulcherrima using distilled water, water mixed with HCl, ethanol, ethanol mixed with HCl, and citric acid as a sensitizer for DSSC. According to the study, citric acid performed better than other solvents by acylating anthocyanin with photonic functional groups via glycosidic bonds. Additionally, the types of anthocyanins and their stability vary with source plant variation. For instance, pigments such as anthocyanins from potatoes, red sweet, purple corn, purple carrot, and red grape are acylated. In contrast, others from red grape and purple corn are nonacylated. Consequently, [15] have documented that a specific functional group of acylated pigments exhibits enhanced stability and extended photon absorption capacity compared to non-acylated pigments. Hence, it is imperative to choose carefully the optimal extraction methodologies to conduct feasibility assessments on the photo-electrochemical attributes and potential plant source for appropriate pigments before the utilization of pigments in DSSC applications.

Therefore, this study aimed to the best extraction techniques, phytochemical profiles, and electrochemical characteristics of these pigments to assess whether these pigments are effective at improving DSSC performance. We optimized the extraction process by employing ethanol with acetic acid for the flower sample. Likewise, ethanol with hydrochloric acid for root sample extraction to increase the yield and purity of the pigments made from Persicaria lapathifolia. Further, in UV–Vis spectrophotometry, we determined the explicit absorption peaks with expansive spectra from visible to near IR spectrum range for both dyes. Through the identification and quantification of flavonoids, anthocyanins, betacyanin, and glycosides contained in the extracts of both flower and root, phytochemical analysis shed light on the extracts' potential as photosensitizes. Furthermore, the redox potentials and charge transfer properties of these pigments were assessed by electrochemical tests, such as cyclic voltammetry. Finally, we constructed DSSCs using these dyes in a similar environment and explored the incident photon to electrical energy conversion performance. Since, to the best of our knowledge the natural pigments from the Persicaria lapatheoflia have not yet been utilized for DSSC investigation, we evaluated the photoelectrochemical potential and feasibility of extracted pigments for potential application in DSSCs. In addition to advancing our knowledge of natural dye applications in solar technology, the research’s discoveries opened the door for more affordable and environmentally friendly renewable energy options.

2 Materials and methods

2.1 Materials

Transparent Conductive Glass Plates (FTO Electrodes, TECHINSTRO, India), TiO2 (powder, Sisco Research Lab. Pvt. Ltd, Maharashtra, INDIA), and Triton X-100 (Sisco Research Laboratories Pvt. Ltd, India) were bought from India. An adhesive tape (china), Graphite pencil (NATARAJ), fluorescent lump (9 W), and Binder clips were purchased from Jimma town. Potassium iodide/KI (INDENTA, INDIA, Pvt, analytical reagent), Iodine/I2 (INDENTA, INDIA, Pvt, analytical reagent), CH3COONa.3H2O (Alpha chemical, Laboratory Reagent, INDIA), acetonitrile (99.5%, LOBA Chemie, Laboratory reagents, Mumbai, India), ethanol (96%HAYMAN, Ltd), HCl (37%), Standard buffer solutions(pH = 6.4&4.0, Blulux, Laboratory(P) Ragent, Ltd), and Acetone (99.8%, Blulux Laboratory (P), Ltd, analytical reagent) were also purchased from India. NaOH 0.1 M (Blulux Laboratory (P), Ltd analytical reagent), 0.1 M HNO3 (69–72%, Blulux Laboratory (P), Ltd, analytical reagent), H2SO4 (98%, Blulux Laboratory (P), Ltd, analytical reagent) and glacial acetic acid (99.5%, Blulux, Laboratory (P), Ltd, analytical reagent) were bought as reagents. 0.1 M KNO3 (NICE, Laboratory Reagent), 0.1 M KCl (Blulux Laboratory (P) Ltd analytical reagent), Mg slice (Riedel–de Haen), FeCl3 (Blulux, Laboratory (P), Ltd, analytical reagent), NH3 (25%, LOBA, Chemie, Laboratory reagents) were also bought. The pestle, mortar, hot plate (Bibby, Steriling, LTD, Stone, Staffordshire, ST150SA, UK), UV–Vis spectrophotometer (6705 UV–Vis, JENWAY), Cyclic Voltammetry analyzer (CV, Basi Epsilon-EC-Ver.1.60.70-XP) and Extech-Multiviews digital multimeter (MV 120) were used from Jimma university Physical chemistry laboratory.

2.2 Methods

2.2.1 Collection of the sample materials and preparation of dye solution

The fresh flowers and root samples of Persicaria lapathifolia were collected from the vicinity of Jimma University's main campus and Jimma town, Oromia region, southwestern Ethiopia. The plant is available as weed crop in the open field such as abandoned ditches and marshy places in wild habitat of study area. Since Persicaria lapathifolia is accessible in non-protected area the permission from either local or regional authorities did not involved for sample collection. Furthermore, Dr. Kitessa Hundera (Botanist at Jimma University College of natural and computational science) completed the plant identification. The Voucher of specimen was deposited at Herbarium of Biology department with Voucher ID/deposition number AP003/2018. Subsequently, we washed the collected samples with water to remove adhering dust and rinsed them again with distilled water. After washing over, we let the sample dry for 1 week and crushed it into a fine powder with mortar and pestle, see Fig. 1. Then, 20 g of each sample was individually taken into separate 500 mL conical flasks. We added 200 mL of 96% ethanol and 37% HCl in a ratio of 99:1 into a conical flask with a root sample. We also added 200 mL of the same ethanol and glacial acetic acid in a ratio of (85:15) to another conical flask with the flower sample, see Fig. 2 [16]. We wobbled both solutions of samples three times within 18 h for extractability. After 24 h, the solutions were filtered off with Wattman filter paper (541–110 mm), and the filtrates were taken to the rotary evaporator to remove solvent from the dye solution. The concentrated dyes were kept in the dark at room temperature with amber bottles to protect them from light sources and to protect the pigments from degradation before sensitization [17]

Fig. 1
figure 1

(a) for Persicaria lapathifolia (P.l); (b) for samples of flowers and roots; washed and left for dry, (c) for samples that were being ground or crushed

Fig. 2
figure 2

The soaked samples of Persicaria lapathifolia (P.l.) root (a) and flower (b)

2.2.2 Phytochemicals screening

The extract of flower and root samples was subjected to a phytochemical screening test using a standard protocol [18] to determine whether or not it possesses chemical compounds. That would make it a good candidate for a sensitizer for DSSC. Regarding this, we took 1 ml of each dye extract separately in the test tube and mixed each sample with 1 ml of NaOH to test the presence of flavonoids and betacyanin pigments in the root and flower dye extracts of Persicaria lapathifolia [19]. We also blended 2 ml of each dye extract with 2 ml of HCl and NH3 solution to confirm the existence of anthocyanins. Finally, we mixed 1 ml of each dye extract with 2 ml of chloroform and 1 ml of NH3 solution to confirm the presence of glycoside [20].

2.2.3 Optical properties

We documented the photon absorbance data of the prepared dye extract in the wavelength range of 400–800 nm by spectrophotometry. We also evaluated the optical absorbance of the sintered TiO2 paste mixed with dye solutions for dye loading effect at the same wavelength range [21]. Likewise, pure TiO2 optical density was certain at wavelength ranges of 350–800 nm. We dissolved 1 g of sintered TiO2 into ethyl alcohol and distilled water as the solvent in a ratio of 4:2 for band gap analysis [22]. We evaluated the threshold of optical energy gaps in the partially conductive TiO2, pure dyes, and dye-loaded film by employing the Tauc equation.

$${\varvec{\upalpha}}\mathbf{h}{\varvec{\upnu}}={\mathbf{A}(\mathbf{h}{\varvec{\upnu}}-{\mathbf{E}}_{\mathbf{g}})}^{\mathbf{m}}$$
(1)
$${\mathbf{E}}_{\mathbf{g}}=\mathbf{h}\frac{\mathbf{c}}{{\varvec{\uplambda}}}$$
(2)

where A is a material properties dependant optical constant, α is the absorption coefficient, Eg is the optical band gap, h is plank’s constant, c is the speed of light, λ is the wavelength, m values are \(\frac{1}{2}\) for allowed direct transitions and 2 for allowed indirect transitions [23].

2.2.4 Electrochemical analysis of prepared dyes

By using cyclic voltammetry, we assessed the energy level of transformative entities in the natural dye extract of the flower and root of Persicaria lapathifolia [24]. We used pencil/4B/graphite as the main electrode, platinum wire as the secondary electrode, and AgCl as the reference electrode With a Basi Epsilon-EC-Ver.1.60.70-XP voltammeter. We set the scanning rate at 50 mV/s and the potential windows from − 0.5 to 0.8 V by using 0.1 m KnO3 as a supporting electrolyte for both dye analyses [25]

2.2.5 Preparation and assembly of DSSC

2.2.5.1 Preparation of TiO2 electrode (photo anode)

The FTO glasses with dimensions of 25 × 25 cm2, a resistance of 27 cm2, and a transmittance of 79% were cleaned with a detergent solution by using an ultrasonic bath for 30 min. They were rinsed with water and ethanol. Then after, they were dried in an oven at 60c for 30 min. The TiO2 paste was prepared by mixing 3 g of TiO2 powder and 5 ml of nitric acid solution 0.001 M in a mortar and pestle, and then we added 4 ml of distilled water drop by drop and four drops of triton x-100 while continuously grinding to ensure uniform adhesion to FTO glass. Finally, we added 1 g of polyethylene glycol peg to make the paste porous the mixture was homogenized in the ultrasonic bath for 30 min and was stirred for 48 h. We adjusted two FTO glasses in a U-shape by using adhesive tape to the active area of 1 cm2. We dropped the paste on each FTO and spread it uniformly on the space by sliding a glass rod along the tape spacer by the doctors-blade technique. Each of the pasted electrodes was sintered on a hot plate at 450 °C for 1 h, cooled, and immersed in the dye bath for 24 h to load dye on the surface of TiO2, see Fig. 3. Finally, we rinsed each electrode with water and anhydrous alcohol to remove non-adsorbed dye molecules dried them, and left them for testing [26].

Fig. 3
figure 3

For reparation of cathodes (a), preparation of anodes (b) from flower and root

Preparation of counter electrode (cathode) the conductive face of FTO glasses cleaned with ethanol, shaded with graphite from a 2B pencil, and densely covered with catalytically active carbon from the soot of a candle flame [27]

2.2.5.2 Preparation of electrolyte

We transferred 8.298 g of potassium iodide salt into 50 ml of acetonitrile in a beaker and dispersed it with a magnetic mixer into a perfect dissolution. After we poured the admixture into a 100 ml volumetric flask, we added 1.269 g of iodine and finished up the label with acetonitrile [28]

2.2.5.3 DSSC assembling

We assembled the DSSC by facing up the anode and facing down the cathode on the anode face. We allowed offset at the opposite terminal of the assembly. We clumped it to be a DSSC and then injected the electrolyte solution along the edges of the plates to percolate into the cell. Finally, we attached the alligator clips of the multi-meter to the offset side of the cell with respective polarity negative working electrode and the positive terminal counter electrode to measure photovoltaic performance [29], See Fig. 4.

Fig. 4
figure 4

assembled DSSCs of flower (a) and root (b) of Persicaria lapathifolia

2.2.6 Photovoltaic performance test of DSSCs

We analyzed the light radiation and operative photon-assisted electric current-changing capability of the prepared DSSCs by using a digital Keithley multimeter model 2400 and a solar simulator model 4200-secs for indoor testing [30]. We again took out the voltage and current readings for the outdoor photon to electricity achievement evaluation using the digital multimeter and a variety of color-coded resistors set up as loads. Based on the data, we evaluated the DSSC following the power transformation parameters such as short current is maximum current imax maximum voltage vmax fill factor, and cell efficiency [31].

In addition, by adopting Ohm's law, we calculated power and current values according to the equations and plotted the I-V curve using data.

$$\mathbf{P}=\mathbf{V}\mathbf{I}$$
(3)
$$\mathbf{I}=\frac{\mathbf{V}}{\mathbf{R}}$$
(4)
$${\mathbf{P}}_{\mathbf{m}\mathbf{a}\mathbf{x}}={\mathbf{V}}_{\mathbf{m}\mathbf{a}\mathbf{x}}\mathbf{*}{\mathbf{I}}_{\mathbf{m}\mathbf{a}\mathbf{x}}$$
(5)
$${\varvec{\upeta}}=\frac{{\mathbf{P}}_{\mathbf{m}\mathbf{a}\mathbf{x}}}{{\mathbf{P}}_{\mathbf{i}\mathbf{n}}}=\frac{{\mathbf{V}}_{\mathbf{m}\mathbf{a}\mathbf{x}}*{\mathbf{I}}_{\mathbf{m}\mathbf{a}\mathbf{x}}}{{\mathbf{P}}_{\mathbf{i}\mathbf{n}}}*100$$
(6)
$$\mathbf{F}\mathbf{F}=\frac{{\mathbf{I}}_{\mathbf{m}\mathbf{a}\mathbf{x}}\mathbf{*}{\mathbf{V}}_{\mathbf{m}\mathbf{a}\mathbf{x}}}{{\mathbf{I}}_{\mathbf{s}\mathbf{c}}\mathbf{*}{\mathbf{V}}_{\mathbf{o}\mathbf{c}}}$$
(7)

where η is the efficiency.

Voc is the open-circuit voltage;

Isc is the short-circuit current;

FF is the fill factor;

P in is the incident light intensity; the input power for efficiency calculations is 100 mW/cm2.

3 Results and discussion

3.1 Extraction efficiency and solvent selection

The crude natural pigments were extracted in good yield from Persicaria lapathifolia roots and flowers. The Efficient separation of pigments from the plant matrix was carefully done by using HCl for the root and acetic acid for the flower as optimal extraction methods. The high-quality pigments appropriate for dye-sensitized solar cells were obtained by the selection of ethanol and hydrochloric acid (HCl) for root extraction and ethanol-acetic acid (CH3COOH) for flower extraction. When HCl is used in root extraction, it is attributed to dissolve cell walls and release color molecules; on the other hand, ethanol makes a wide variety of chemicals dissolve more easily, which promotes effective pigment recovery and stability [32]. On the other hand, ethanol and acetic acid worked better together to dissolve the colors in the flower sample [33]. Consequently, the significance of refining extraction techniques to optimize pigment production and quality for DSSC applications is highlighted by the careful selection of solvents and extraction ratios [34]. In general, the results of the study showed that effective pigment extraction depends on the use of the right solvents—ethanol and hydrochloric acid for roots, and ethanol and acetic acid for flowers. Moreover, this methodological development can be used as a guide for future studies on the extraction of natural pigments for a range of uses, such as optoelectronic devices and DSSCs, See Fig. 5.

Fig. 5
figure 5

extract of flower (a) and root (b) of Persicaria lapathifolia

Further, the dye solutions show good optical, phytochemical, and electrochemical potential in assessment before use in dye-sensitized solar cell applications.

3.1.1 Root pigment analysis

The natural dye extracted from Persicaria lapathifolia roots by using ethanol and HCl showed absorbance maxima at 462 and 654 nm. The peak at 462 nm suggests the existence of pigments with high light-absorbing qualities, such as betacyanin, anthocyanin, or anthraquinone. However, the presence of other dye components with perhaps lesser light absorption capacities is indicated by the absorption peak at 654 nm [35]. In addition, the root pigment effectively sensitized TiO2 as evidenced by a shift in absorption peak positions from 462 to 466 nm and from 654 to 665 nm when mixed with TiO2. This change implies that the root pigment is a possible sensitizer for dye-sensitized solar cells, as it can interact with TiO2 to improve light absorption and perhaps affect energy levels and electrical structures.

3.1.2 Flower pigment analysis

The ethanol and acetic acid floral extract from Persicaria lapathifolia showed absorption peaks at 535, 606, and 666 nm. These peaks show the existence of several dye molecules, such as betacyanins, anthocyanins, and probably chlorophyll, with differing capabilities to absorb light. The broad absorption profile of the floral pigment indicates that it can absorb light in a broad range of visible light wavelengths. Moreover, The flower pigment effectively sensitized TiO2 as seen by absorption peak shifts from 535 to 540 nm, 606 nm to 614 nm, and 666 nm to 670 nm when coupled with TiO2 [36]. When compared to the root pigment, the flower pigment performs better at causing bathochromic and hyperchromic variations in sensitization, which suggests that it may be used to increase the efficiency of dye-sensitized solar cells.

3.1.3 Sensitization effects of pigments

Significant absorption peak changes were seen when the root and flower pigments were mixed with TiO2, suggesting that the pigments had successfully sensitized the semiconductor material. The absorption peaks’ shift to longer or upper wavelengths indicates that both dyes may sensitize TiO2 and improve its ability to absorb light. The energy levels and electrical characteristics of the system are influenced by this sensitization effect, which is essential for enhancing the performance of dye-sensitized solar cells [37]. The flower pigment appears to be a better choice as a sensitizer for DSSC applications since it can cause more noticeable alterations in sensitization than the root pigment. Further investigation and improvement of these pigments could lead to the creation of more sustainable and effective energy systems, presenting encouraging opportunities for developments in the production of solar electricity.

Ultimately, the thorough examination of the extraction processes, optical characteristics, and sensitization impacts of natural pigments derived from the roots and flowers of Persicaria lapathifolia highlights their importance for use in dye-sensitized solar cell applications [38]. Future developments in sustainable energy systems may be facilitated by using plant-based dyes to improve the effectiveness and performance of renewable energy technology. This is demonstrated by the complex interaction between the extracted pigments and TiO2, See Fig. 6.

Fig. 6
figure 6

extracted dyes of Persicaria lapathifolia (roots and flowers) Absorption spectra of before and after adsorption on TiO2 surface

3.2 Onset wavelength (λ) and onset energy

Onset wavelength and onset energy analysis critically characterized the efficiency of light absorption and the subsequent conversion to electrical energy of pigments from Persicaria lapathifolia. The natural pigments from Persicaria lapathifolia showed strong absorption qualities at the longest wavelength and minimum energy required for the photon to electrical energy conversion in DSSCs. Therefore, the λ onset (wavelength onset) and onset energy are important factors to consider when assessing these pigments [39].

3.2.1 Onset wavelength (λ)

The onset wave length (λ onset) was determined by extrapolating the best-fit tangent line to the absorption peak from the absorption maxima (λ max) to the x-intercept along a longer wavelength to make zero absorbance value (y-axis) [40]. For instance, pigments from Persicaria lapathifolia make electronic transition at the inflection point of the lowest energy regardless of whether the lowest energy transition is the highest intensity peak in the spectrum or not. Consequently, the dye solution of flower and root samples exhibited the onset wavelengths at 693 and 699 nm respectively. These longest wavelengths at which pigments start to absorb light are known threshold points of respective pigments, see Fig. 7. Those points are important because they show what portion of the sunlight spectrum the pigment can absorb [41]. This indicates that at longest λ onset is advantageous for dye-sensitized solar cells (DSSCs) because it enables the dye to absorb the solar spectrum, including the near-infrared region, which can lead to improved photovoltaic efficiency. The λ onset of pigments isolated from Persicaria lapathifolia's roots and flowers are different depending on the particular components and their quantities. These plants' natural colors, such as flavonoids and anthocyanins, typically exhibit strong absorption in the visible spectrum, sometimes even reaching the near- infrared. Pigments of flowers with a longer λ onset than root can capture more sunlight, enhancing the light-harvesting efficiency of DSSCs.

Fig. 7
figure 7

Onset Wavelength (λ)

After sensitization of both roots and flower pigments, the onset wavelength made a shift to 700 and 710 nm respectively. This indicates that the sensitization of pigments with TiO2 enables the absorption of a photon with lower energy and reduces heat energy in the DSSC.

3.2.2 Onset energy analysis

The least amount of energy needed to excite an electron from its ground state into its excited state in the pigments of Persicaria lapathifolia is known as the “onset energy” (E_onset). These values are calculated by using the formula;

$${\mathbf{E}}_{\mathbf{o}\mathbf{n}\mathbf{s}\mathbf{e}}=\mathbf{h}\frac{\mathbf{c}}{{{\varvec{\uplambda}}}_{\mathbf{o}\mathbf{n}\mathbf{s}\mathbf{e}\mathbf{t}}}$$
(8)
$${\mathbf{E}}_{\mathbf{o}\mathbf{n}\mathbf{s}\mathbf{e}}=\frac{1240.8}{{{\varvec{\uplambda}}}_{\mathbf{o}\mathbf{n}\mathbf{s}\mathbf{e}\mathbf{t}}}$$
(9)

where the speed of light is represented by c and h Planck's constant, E-onset relates inversely to the λ onset.

The onset energy of pigments from roots and flowers of Persicaria lapathifolia is 1.79 eV and 1.775 eV respectively lie in a range that allows for effective electron injection into the conduction band of TiO2, common DSSC semiconductors. After sensitization, the onset energy of roots and flowers shifted to 1.77 and 1.75 eV respectively. The flower pigment shows lower onset energy than the root does. This indicates it can produce a high photocurrent and overall device efficiency, effective electron transfer from the excited dye to the semiconductor.

The lower and appropriate onset energies that are closely aligned with the semiconductor's conduction band edge and lemma onset at the longer optical position make the pigments of persicaria lapathifolia suitable for DSSC application, maximize energy transfer and reduce energy losses [42]. The onset energy is minimum energy, which is equivalent to the photon that the pigment must acquire for the charge transfer from the dye to the semiconductor in dye-sensitized solar cells (DSSCs).

3.2.3 Optical band gap

The energy gap between the state of the lowest boundary of electron unoccupied and the uppermost boundary of electron occupied is called the band gap. The band gaps energy of pigments from Persicaria lapathefolia of roots and flowers of Persicaria lapathifolia are 1.9 eV and 1.86 eV respectively. The values are calculated from the maximum wavelength of roor (654 nm) and flower (666 nm) at the region where pigments absorb light with the lowest frequency by using Eq. (2). This analysis helps to understand the electron injection efficiency and photon absorption capacity of pigments from Persicaria lapathifolia in dye-sensitized solar cells (DSSCs) [43]. Additionally, combining TiO2 (band gap 3.2 eV) with dye solutions of root and flower exhibited peaks at 665 and 670 nm respectively. Persicaria lapathifolia extracts showed notable shifts in absorption peaks, indicating changes in band gap energy and light absorption behavior that might improve electron transport efficiency and DSSC performance as a whole.

Sensitization of TiO2 with root dye shows a remarkable shift in the band gaps of the root dye from 1.79 to 1.87 eV. The improved light-absorbing characteristics and photo-assisted electron-generating potential of the root dye upon integration into the TiO2 layer have been observed by using band gap analysis. These values indicate that the electron excitation energy gap has been narrowed up on sensitization [44]. Consequently, the narrow band gap of root pigment enhances light-harvesting efficiency and electron transfer processes. This makes possible the root dye pigments applicable for the DSSC fabrication [45].

Similarly, the floral dye's band gap reduces from 1.86 to 1.85 eV after sensitizing. The chemical bond conjugation of the TiO2 surface with functional groups on the pigment structure brings about a significant narrowing of the energy gap. This indicates that the floral dye successfully sensitizes TiO2 to improve light absorption and electron transfer. For instance, [46] analyzed the band gap reduction by using Tauc relations and reporting on the impacts of sensitizing TiO2 with flower dye pigments on photon harvesting and charge separation efficacy in the DSSC system. Therefore, the band gap energy of floral dye was successfully reduced by sensitization, underscoring the value of environmentally responsible methods in the development of solar energy technology and the potential of plant-based dyes to improve the sustainability and performance of DSSCs.

Generally, Tauc relations (Eq. 1) help to examine the reduction of band gaps after the sensitization of TiO2 films with pigments from flowers and roots, see Table 1. The precise measurement to evaluate changes in band gap energy gives critical information about the effective light absorption capabilities of the pigments from the root and flower used in the solar cell device (see Fig. 8). As a result, the approach increases the efficiency and usability of DSSC for scaling up sustainable energy conversion devices [47].

Table 1 For maximum absorption wavelength, onset absorption wavelength, band gaps for pure dye extract, and their adsorption on TiO2 surface
Fig. 8
figure 8

Optical band gaps energy of flower dye; flower dye with TiO2 (a), root dye; root dye with TiO2 (b), and, Pure TiO2 (c)

The enhanced electron mobility, decreased charge recombination, and easier electron migration from the Highest Occupied Molecular Orbital (HOMO) to the Lowest Unoccupied Molecular Orbital (LUMO) and ultimately to the conduction band of TiO2 are responsible for the narrowing of the band gaps of the root and floral dyes after sensitization with TiO2. This simplified electron transfer channel makes it possible to use absorbed photons more effectively, which enhances electrical conductivity and the dye-sensitized solar cell system’s overall performance. Plant-based dyes have been successfully used to sensitize TiO2, demonstrating its applicability for improving the efficiency and sustainability of DSSCs in the advancement of renewable energy technology.

3.2.4 Phytochemical screening

The goal of the phytochemical screening assays carried out on Persicaria lapathifolia roots and flowers was to discover and characterize the diverse range of chemical compounds found in these plant sources. With an emphasis on combining the potential quality of these pigments in dye solutions for DSSC applications, this screening procedure was crucial in the extraction and characterization of the naturally occurring pigments that are plentiful in Persicaria lapathifolia. [20]. The extraction method indicated the existence of important phytochemical groups in the root and flower pigments, such as flavonoids, betacyanins, anthocyanins, and glycosides, by qualitative confirmation tests. The dye solutions' observed color changes yellow for flavonoids and betacyanin, orange for anthocyanins, and pink or yellow for glycosides further supported the extracts of Persicaria lapathifolia diverse range of bioactive substances. Therefore, the discovery of these important phytochemicals such as glycosides, anthocyanins, flavonoids, and betacyanin from roots and flowers of Persicaria lapathifolia highlights their significance as essential TiO2 sensitizers in DSSC applications. These natural pigments have an amazing ability to absorb photons across a wide wavelength range, which makes it easier for electron–hole pairs to form at the semiconductor interface and raises the efficiency of DSSCs’ ability to convert photons into electricity.

The experimentation revealed that the root and flower dye extracts blended with a NaOH solution had a yellow color confirming the abundance of flavonoids and betacyanin pigments in both the root and flower of Persicaria lapathifolia. The dye extracts also showed an orange color for the flower and a pinkish-red color for the root, indicating the presence of anthocyanins. Finally, yet importantly, the dye extracts showed a pink color for the root and a yellow color for the flower in the chloroform and ammonia tests, indicating the presence of glycosides in flower and root pigments [48]. The crude dye solution is used for qualitative confirmation tests for feasible phytochemicals (see Table 2).

Table 2 The results of the phytochemical qualitative test of roots and flower extracts of Persicaria lapathifolia

Certainly, these pigments have a tremendous capacity to harvest photons in a broad wavelength range and generate pairs of the electron-to-hole population to the semiconductor boundary [49]. Therefore, organic dyestuff that has been drawn from roots and flowers can effectively improve photon to photon-to-electricity conversion efficiency of DSSC.

Predominantly, since flavonoids have specific characteristics to receive and donate electrons either intermolecular or entramolecular interaction they are crucial for promoting charge transfer activities in the DSSC. Because of that, the existence of flavonoids in dye solution from roots and flowers of Persicaria lapathifolia has pivotal power to induce effective charge separation and electron transport in DSSC’s operation. Hence, flavonoids are very important for stimulating charge transfer activities in DSSCs because of their ability to donate and receive electrons. The flavonoids that are isolated from Persicaria lapathifolia's roots and flowers are essential for promoting efficient charge separation and electron transport within the solar cell device, which enhances performance and efficiency.

In addition, the attachment of glycosides to the pigment structure supports the stability of pigment to improve the overall durability of the solar cell device [50]. The stability of the pigments is supported by the attachment of glycosides to the pigment structures of Persicaria lapathifolia roots and flowers, which enhances the DSSC device's overall endurance. This structural support makes the solar cell more resilient and long-lasting, guaranteeing steady performance over prolonged operation. The pigment composition's glycoside content increases the DSSC system's stability and dependability, which in turn increases how well it captures solar energy for use in renewable energy applications. Therefore, the identification of betacyanins, flavonoids, anthocyanins, and glycoside ensures the feasibility of dye solution for roots and flowers of Persicaria lapathifolia for DSSC application in renewable energy revolution [51].

3.2.5 Electrochemical characterization of natural pigment

The characterization of electrochemically active natural pigments extracted from roots and flowers of Persicaria lapathifolia offers valuable insights into their redox characteristics and electron transfer kinetics. They are critical for the sensitizers in dye-sensitized solar cells (DSSCs) [52].

3.2.5.1 Redox activity and electron transfer in root extract

The extract from the root of Persicaria lapathifolia demonstrated distinguished redox activity with two peak potentials at − 0.109 and 0.463 V. These potentials indicate that the pigments can undergo irreversible redox reactions, essential for promoting electron flow within a DSSC system. The negative peak potential (− 0.109 V) with an anodic peak current of 125 μA corresponds to the easy electron donating behavior of pigments at lower, while the positive peak potential (0.463 V) corresponds to further the oxidation process possibility of pigments. The presence of these distinct redox peaks suggests effective electron transfer capabilities, which are vital for the function of the DSSC [53], see Fig. 9.

Fig. 9
figure 9

cyclic voltammogram of flower dye (a) and root dye (b)

3.2.5.2 Redox activity and electron transfer in flower extract

In the same way, the flower extract exhibited promising redox performance with peak potentials at − 0.135 and 0.542 V. These potentials also suggest a slightly more pronounced electron transfer capability compared to the root extract. The more negative peak potential (− 0.135 V) with an anodic peak current of 145 μA indicates the higher electron-donating capacity of pigments in flower dye solution, whereas the positive peak potential (0.542 V) indicates the additional oxidation state of the pigments. The higher anodic peak current of 145 μA compared to the root extract signifies a more efficient electron transfer process, which can enhance the overall performance of the DSSC [54].

3.2.5.3 Comparative electrochemical analysis of root and flower extracts

According to electrochemical activity, the extracts of both roots and flowers indicate significant potential as new sensitizers for DSSC application. Nevertheless, due to higher anodic peak current and more pronounced redox potentials the flower dye might exhibit better electron transfer efficiency. However, both roots and flower pigments have good quality of redox as well as electron transfer they are promising candidates for effective DSSC operation [55].

3.2.6 Photon frequency and luminescence positions

The natural pigments extracted from the roots and flowers of Persicaria lapathifolia exhibited pronounced photon reception and luminescence potential. Based on the relative frequency limit of photons that could promote electrons from the figments of roots and flowers their luminescence positions are determined at the proper level [56]. This is critical insight into the energy levels and efficiency of the pigments as good sensitizers in dye-sensitized solar cells (DSSCs) [57].

Based on band gap energy and cyclic voltammetry results the determined (HOMO–LUMO gap) of pigments by using;

$$\mathbf{H}\mathbf{O}\mathbf{M}\mathbf{O}=\mathbf{e}\left({\mathbf{E}}_{\mathbf{o}\mathbf{x}}-{\mathbf{E}}_{\mathbf{r}\mathbf{e}\mathbf{f}}\right)$$
(10)
$$\mathbf{L}\mathbf{U}\mathbf{M}\mathbf{O}=\mathbf{H}\mathbf{O}\mathbf{M}\mathbf{O}-{\mathbf{E}}_{\mathbf{g}}$$
(11)

An Ag/AgCl under NaCl saturated solution with a reference potential of + 0.197 V [58] the calculated numerical values are tabulated as follows:

For the root dye the Onset photonic energy (1.79 eV), Onset oxidation potential (− 0.42 eV), HOMO (0.617 eV), and LUMO (− 1.173 eV). Likewise, for the flower dye Onset photonic energy (1.77 eV), Onset oxidation potential (− 0.45 eV), HOMO (0.647 eV) and LUMO (− 1.123 eV), see Table 3. These oxidation potentials show the feasibility of the efficiency of electron injection and the ability of the dyes to regenerate. The positioning of the HOMO levels for the electron population lies below the iodine/tri-iodide redox couple potential (0.41 eV) suggesting promising potential for effective dye regeneration. Furthermore, the LUMO levels are located above the TiO2 conduction band potential (− 0.5 eV), indicating favorable electron injection into the semiconductor [59].

Table 3 Calculated energy level results

Even though both flower and root dyes show the thermodynamically favorable potential position and driving force for charge diffusion, the flower dye takes a kinetically favorable position due to its LUMO closeness to the conduction band of the semi-conductor (TiO2). This closer immediacy assists surplus electron injection from flower pigment to the charge collector leading to higher short-circuit current to earn higher overall efficiency in DSSCs. Therefore, due to the promising redox behavior and favorable energy level of the pigments from roots and flowers of Persicaria lapathifolia proposed that they can efficiently shuttle photons to electrical and electrical-to-chemical energy transfer, See Fig. 10.

Fig. 10
figure 10

The forecasted energy level diagram for dyes extracted from the root and flower of Persicaria lapathifolia sensitized solar cell

3.2.7 Photovoltaic performance of pigment-sensitized DSSCs

The photovoltaic performance assessment of pigments extracted from Persicaria lapathifolia sensitized solar cells under standard sun-simulated illumination conditions (AM 1.5, 100 mW/cm2 light intensity at 25 °C) shows promising results [60]. More specifically, the pigment extracted from the flower part of Persicaria lapathifolia sensitized solar cell(DSSC) exhibited superior performance over the root part dye-based DSSC in terms of Current, Voltage, and overall efficiency, See Fig. 11.

Fig. 11
figure 11

I-V curves of Dye-sensitized solar cells under illumination set up for flower DSSC (a) and set up for root DSSC (b)

Voltage and Current Output The pigments extracted from the flower part sensitized DSSC generated an open circuit voltage (Voc) of 649 mV, while root-based DSSC produced 550 mV. This result variation can be attributed to the superior electron-donating capability of pigments from flowers and its LUMO level closeness to the conduction band of TiO2, which contributed to electron kinetics and electron density increase [61].

Moreover, the higher voltage result of the flower pigment-sensitized DSSC over the root part dye-based DSSC indicates a better capability of photoelectron generation at longer wavelengths. Likewise, the flower pigment-based DSSC exhibited a short circuit current (Isc) of 3.8 mA, whereas root pigment-based DSSC generated 3.7 mA. This slightly higher short current output of flower pigment shows its more efficient electron injection and transport properties due to better electron kinetic and higher electron population density [62]. In addition, the closer LUMO level of flower pigment to the TiO2, conduction band also enhances electron flow density and reduces resistance. Thereby improving current output and overall DSSC efficiency.

Fill Factor (FF) The flower pigment-based DSSC attributed to the fill factor was 66.24%, while root pigment-based DSSC was 65.36%. Accordingly, the higher fill factor of flower pigment-based DSSC indicates better quality of the device, with reduced internal losses and more efficient energy conversion [63].

Efficiency (ɳ) The efficiency of flower pigment-sensitized DSSC (1.6335%) is higher than root pigment-based DSSC (1.33%) exhibits. This variation can raise several attributive factors like lower oxidation potential, lower LUMO level, and narrower band gap of the flower pigment, which facilitate easier photo-excitation and more efficient electron transfer [64]. Additionally, at the longer wavelength, the electron excites with minimum initial energy cost results reduced heat within DSSC. This is due to the energy emission of electron transition from LUMO to the conduction band of TiO2, increasing the DSSC stability and efficiency. As a whole, the higher voltage output and short circuit current results in increased power output for the better efficiency of flower-based DSSC.

3.2.8 Contribution to current knowledge, relevance, and future of findings

3.2.8.1 Contribution to current knowledge

The broader and intense light absorption spectra of pigments from roots and flowers in the visible region for sufficient photon capturing, their sensitization effect on semiconductor (TiO2), and diverse phytochemical accommodating character of sensitizers from new source plants remarkably contribute to the current body of knowledge. In addition, as the Persicaria lapathefolia is a non-edible weed crop that no one competes for food security and widely available vegetation it might be a viable source of natural pigments for DSSC technology. The study looked into the extraction optimization and description of dyes from Persicaria lapathifolia highlighting their potential to scale up the efficacy and sustainability of DSSC technologies. The red and yellow color of extracts indicates the existence of pigments such as flavonoids, anthocyanins, and betacyanin in Persicaria lapathifolia making comparability and in some circumstances better than others, the findings reported in existing literature for natural dye. The observed performances of this study underscore the relevance of assessing alternative natural dye from new source plants for renewable energy applications. As a result, fabricated DSSCs' output efficiency for root (1.33%) and flower (1.6335%) acknowledge the feasibility of extracts as new sensitizers for DSSC. These unexpected performances of pigments from Persicaria lapathifolia are attributed to the synergistic effects of the diverse phytochemicals present in the extract and optimal extraction.

Comparison with Existing Studies Our findings successfully demonstrate the highest potential of pigments from roots and flowers of Persicaria lapathifolia for DSSC application when compared to some current studies that reported the same work in DSSC fabrication, see Table 4, underscoring their novelty and importance. Most studies reported the efficiencies of natural dye-based DSSC below 1.3%, but our achievement is 1.6335% for flower-based DSSC and 1.33% for root dye-based DSSC highlights a significant improvement in renewable energy progress. For instance. Nafisatus Zakiyah, etal. reported the achievement of DSSCs sensitized with an extract of natural dye from pandanus(0.93%), papaya leaves (1.07%) and sappan-mangosteen (1.17%) [65], and Yuan et al., reported the achievement of DSSC sensitized using Extraction of Natural dye from Anthocyanins from Blueberry (0.45%) [66].

Table 4 Photovoltaic performance of DSSCs prepared from roots and flowers of Persicaria lapathifolia

Relevance of results and future direction the study explored the yellow-colored pigments from the flower and red-colored pigments from the root showing the existence of anthocyanins, betacyanin, and flavonoids in the Persicaria lapathifolia. Consequently, the extracts absorb photons widely in the visible and near-infrared regions of the electromagnetic radiation spectrum. In addition, both pigments are capable of interacting with semiconductors for sensitization achievement. Moreover, the results highlight the photoelectrochemical feasibility of pigments from roots and flowers of Persicaria lapathifolia as new potential sensitizers for DSSC technology. Furthermore, the studies explored low-cost, non-edible, widely available uncultivated weed crops and environmentally friendly source plants for pigment extraction.

For future extensive research should focus on scaling up the extraction process, optimizing the stability of the pigments, and exploring their long-term performance in DSSCs.

4 Conclusion

The study of the optimal extraction, phytochemical, and photo-electrochemical potential evaluation of natural pigments from the flowers and roots of Persicaria lapathefolia for dye-sensitive solar cell application has yielded better results and drawn attention. The pigments are effectively retrieved from the plant matrix using ethanol with acetic acid (85:15) for flower sample extraction and ethanol with HCl (99:1) for root sample extraction. The biochemical compound detection resulted in glycosidic bonds, flavonoids, anthocyanins, and betacyanin. Those phytochemicals are the backbone of DSSC construction. Further, in the optical absorption assessment, both flower- and root-based pigments show broad coverage in the visible region, which is critical for efficient photo excitation conversion. In addition, cyclic voltammetry ensured the optimum redox characteristics and electron kinetics suitability of both pigments for DSSC. The estimation of proper energetic level and electron kinetics of pigments from roots and flowers of Persicaria lapathifolia gives basic information on their fitness for utilization in DSSC applications. Finally, the efficiency of fower pigment-based DSSC and root pigment-based statistics are 1.6335 and 1.33% respectively. These results support the evaluation of the feasibility of these organic pigments for DSSC application. The sophistication of the pigments extraction techniques and the characterization have significant implications for evaluating the potential of persicaria lapathefolia for renewable energy applications. Therefore, this research stimulates the broader investigation and exploitation of botanical resources from Persicaria lapathifolia emerges as a promising contender in the pursuit of environmentally friendly and more effective energy resolutions.