1 Introduction

Due to their outstanding electrical and optoelectronic capabilities, organic–inorganic mixed halides perovskite materials have garnered much attention in the past decade for energy-related applications [1,2,3,4,5,6,7]. Miyasaka and colleagues first reported the synthesis of a lead halide perovskite solar cell (PSC) from CH3NH2PbI3 with high light absorption in 2009 [8], which has rapidly developed as an effective photon-absorbing material. Methylammonium lead halide (MAPbX3) has garnered significant attention due to its favorable attributes: high mobility, appropriate band gap, and ease of production leading to exceptional power conversion efficiency (25.7%) [9,10,11,12]. Nevertheless, two primary concerns need to be addressed: perovskite stability and lead toxicity, which are believed to be critical factors impacting photovoltaic devices, as lead is toxic to humans and the environment. It is crucial to develop eco-friendly alternatives [13]. Hence, over the last decade, the research focus has shifted towards commercializing environmentally friendly and stable devices. One approach to achieve this goal is to replace the toxic lead with non-toxic metallic elements in the initial MAPbX3, which can alter the electronic characteristics of the material [14,15,16]. The band gap of perovskites varies with the element at the B site, as reported by Kulkarni et al. [17]. Eliminating the Pb toxicity from perovskite materials requires replacing Pb with other nontoxic elements. In previous work, to reduce the toxicity of CH3NH3PbI3 powders, we have used a novel, simple methodology based on the ball milling process to include various metal salts, such as Zn2+ and Co2+ ions [18]. Zinc and cobalt are added to enhance morphology, formation, granularity, optical and photoluminescent characteristics. These materials indeed exhibit a wide variety of structural dimensions. Crystal structures ranging from zero to three dimensions have been seen in several organic–inorganic hybrid materials, including [N(CH3)3H]2ZnCl4 as 0D [19], [C5H9–NH3][CdCl3] as 1D, (CH3NH3)2CuCl4 as 2D, CH3NH3PbI3 CH3NH3GeI3 [20] CsSnGeI3 [21] as 3D. Currently, the most efficient Sn-halide perovskite solar cells (PSCs) achieve power conversion efficiencies (PCEs) exceeding 14%, exemplified by 2D/3D perovskite solar cells reaching 14.03% efficiency. Germanium (Ge) has shown promise, with MAGeI3-based PSCs reaching an 18.3% PCE. CsSnGeI3 has been particularly successful, achieving the highest possible efficiency of 28.4% [21]. Additionally, Bi-based perovskites have demonstrated low toxicity and stability, achieving a 4.3% PCE with Ag3BiI6 [22]. While having deeper trap states, Sb-based perovskites reached a 7.05% PCE with Sb2(SxSe1-x)3 [23]. Alternative elements like Ca, Sr, and Ba have been considered but face challenges due to large band gaps unsuitable for photovoltaic applications [3, 24,25,26,27]. Generally, The particular physical and chemical features of 2D perovskite materials have made them a focus of contemporary research [28, 29]. When perovskites, for instance, have their dimensions reduced to 2D, many distinctive properties are exhibited, and much-enhanced stability in the ambient is attained [30,31,32]. Various kinds of synthesis methods have successfully realized the fabrication of 2D perovskite till now [33, 34]. Wei et al. have studied zinc halide perovskite. The as prepared samples are characterized without cell fabrication. The results indicate that zinc halide perovskite crystal is a monoclinic with good thermal stability until 270 °C and a wide band gap of about 3.88 eV. Besides, the PL characterization exhibited a green fluorescence emission band with a maximum value of 521 nm [35].

This study represents a significant step forward in the field of perovskite solar cell research by focusing on lead-free alternatives, specifically (CH3NH2)2ZnI4 and (CH3NH2)CoI4 perovskites [33, 34]. The novelty of this work lies in the exploration of these unique lead-free materials and their application in solar cells. The environmentally friendly nature of these materials is of paramount importance in the context of sustainable energy solutions. Furthermore, the distinct band gap properties of (CH3NH2)2ZnI4 and (CH3NH2)CoI4 perovskites, and their potential for high efficiency in solar cell applications, make this research significant. By addressing the crucial need for lead-free alternatives and exploring the distinct electronic properties of (CH3NH2)2ZnI4 and (CH3NH2)CoI4, this study contributes to the advancement of clean and efficient energy technologies. This work aims to not only shed light on the viability of lead-free perovskites but also to underscore their importance in the broader landscape of renewable energy research.

In this work, we choose potential metal elements to replace the toxic Pb material. Zn and Co can occupy the B site, encouraged by the flexibility of the A2BX4-type hybrid material's structure. A2BX4-type mixed hybrid substance (CH3NH2)2ZnI4 and (CH3NH2)CoI4 are successfully prepared. The samples are analyzed at the atomic level, characterizing everything from their crystal phase and shape to their composition, chemical classes, and bond types. In addition, the optical and photoluminescence of the samples are assayed. Finally, the perovskite organic halide solar cell fabrication and the power conversion change were described.

2 Materials synthesis

2.1 Starting materials

Methylammonium iodide (CH3NH3I) was synthesized through the hydroiodic acid (57 wt. % in water), CH3NH2 (40 wt. % in H2O), as precursors, zinc iodide (ZnI2), and cobalt iodide (CoI2) are used, methylammonium zinc iodide (CH3NH3)2ZnI4, methylammonium cobalt iodide (CH3NH3)2CoI4, bathocuproine (BCP) and cyclohexane were purchased from Sigma-Aldrich. All chemicals were used without further purification.

2.2 Synthesis of methylammonium iodide (CH 3 NH 3 I)

Methyl ammonium iodide (CH3NH3I) was typically synthesized by reacting one mole of CH3NH2 solution with one mole of HI while stirring under an ice bath for about 2 h. After three hours at 80 degrees Celsius in an evaporator, the CH3NH3I crystallized [18].

2.3 Synthesis of methylammonium zinc iodide (CH 3 NH 3 ) 2 ZnI 4 and methylammonium cobalt iodide (CH 3 NH 3 ) 2 CoI 4

To create (CH3NH3)2ZnI4, we mixed 3.19 g of ZnI2 powder and 1.59 g of CH3NH3I powder. In order to moisten the mixture, 4.78 g were soaked in cyclohexane. To test the effectiveness of the grinding bowl air environment, we put 4 balls made from zirconium materials and diameter 1.0 cm weighing a total of 20 g into the 125 cm3 jar. One ball had ten times as much material as it did weight. The balls were milled at a speed of 550 rpm for 30 min. The methylammonium cobalt iodide (CH3NH3)2CoI4 was synthesized with a similar pathway with 3.12 g CoI2 (1 mol).

2.4 Device fabrication

An ultrasonic cleaning system was used to clean the ITO substrate, which was initially submerged in a cleansing agent combination and deionized water before being rinsed many times with deionized water. Spinning for PEDOT:PSS was accustomed to HTL preparation at 6000 rpm on ITO substratum for 40 s at room temperature [36, 37]. For 30 s at 4000 rpm, a perovskite precursor solution was spin-coated onto HTL to create the active layer. After 12 s, the 350 \(\mu \) L of chlorobenzene was cast vertically. After 90 s of annealing at 50 \(^\circ{\rm C} \), the spin-coated film was transferred to a different hotplate and annealed at 100 \(^\circ{\rm C} \) for 10 min. The solution of PC61BM was deposited at 4000 rpm for 30 s for the ETL on the perovskite absorber sheet. For 30 s, the buffer layer of the BCP solution was spun to cover the surface. The heat evaporation of Ag at 120 nm eventually formed the back contact. The overlap between the electrode ITO and the Ag reveals an active area of 0.1 cm2.

2.5 Materials characterization

Cu K radiation (= 1.5406) was used in a Brucker D8-advance X-ray powder diffractometer to determine the XRD patterns of the final products. Field emission scanning electron microscopy (FESEM) images were used to inspect finished products (JSM-5400, JEOL instrument, Japan). A JEOL-JEM-1230 microscope was used for transmission electron microscopy (TEM). The JASCO 3600 spectrophotometer was used to get a Fourier transfer infrared spectrum (FT-IR). Using a UV–VIS-NIR spectrophotometer (Jasco-V-570 spectrophotometer, Japan) equipped with an integrating spherical reflectance unit (ISN) in the 200–2000 nm wavelength range, the UV–Vis absorption and diffuse reflectance spectra were recorded at room temperature. At room temperature, a fluorescence spectrophotometer with a 50 W xenon light was used to take PL spectra (Shimadzu RF-5301PC, Kyoto, Japan). The J–V curves were collected using a TriSOL Class AAA Solar Simulator (TSS300). At the same time, using a Keithley 2420 source meter, we determined the optimal intensity of the simulated light to be 100 mW/cm2. We programmed the 1.2 V to 0.3 V forward scan with a ten mV voltage step and no delay (in milliseconds).

3 Results and discussion

3.1 X-Ray Diffraction (XRD)

All the raw ingredients were significantly purified in the lab to get high-quality substances at a reasonable price. Figure 1 a displays the XRD profile obtained, which confirms the CH3NH3I structure. CH3NH3I has a tetragonal structure, as seen by its XRD patterns, with lattice constants of a = b = 5.12 and c = 8.74 [11]. Figure 1 a illustrates the XRD result of the optimized (CH3NH3)2ZnI4 perovskite structure, the 4/mmm space group tetragonal lattice. The cuboctahedral structure is made possible by the Zn2+ cation, which forms six metal bonds with its adjacent I- anions. The temporal XRD pattern has been calculated, and the highest peak for (CH3NH3)2ZnI4 was found at 25.20 degrees compared to its similar counterpart’s perovskite structure CH3NH3PbI3 was found to be at near 32.13 degrees, experimentally [33, 35]. Supercell structures were not used; instead, the primitive unit was. Some standard planes were found in both) CH3NH3(2ZnI4 and CH3NH3PbI3 structures, that is because of CH3NH3I. The X-ray diffraction analysis shows that (CH3NH3)2ZnI4 structures have XRD patterns of JCPDS Card No: 020–1996, as shown in Fig. 1. For (CH3NH3)2CoI4, the peaks at 15.9°, 19.8°, and 24.5° are assigned as the perovskite (110), (220), and (330) planes. Other peaks belong to CH3NH3I due to the interaction between the organic and inorganic parts [34].

Fig. 1
figure 1

a XRD patterns of CH3NH3I, (CH3NH3)2ZnI4, and (CH3NH3)2CoI4 samples. b A lattice structural representation of the organometal trihalide perovskite CH3NH3BI3 (B: Zn and Co)

3.2 Raman spectroscopy

Raman spectra with a 532 nm excitation wavelength for (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 samples, respectively, are shown in Fig. 2. Vibrational stretching in the C–N bands at 934 cm−1 in both (CH3NH3)2ZnI4 and (CH3NH3)2CoI4, respectively. The CH3 rocking vibration is responsible for the 682 and 951 cm−1 bands. The NH3+ vibration that rocks are at 1294 cm−1. Both (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 are analyzed for their scissoring vibration of CH3 at 1438 cm−1. The stretching vibration of [ZnI4]2 and [CoI4]2 is detected at 121 cm−1 and 116 cm−1, respectively. Vibrational data corroborated the single crystal diffraction results, proving that both the organic and inorganic frameworks of (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 are valid [38, 39].

Fig. 2
figure 2

a Raman spectra of (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 samples. b FTIR spectra in the wavenumber range 400 to 4000 cm−1 for (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 samples

3.3 Fourier-transform infrared spectroscopy (FT-IR)

Figure 2 b displays the FTIR absorption spectra of the nanostructure (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 samples prepared by ball milling. FTIR spectroscopy was used to examine how the preparation method affected the chemical bonds in molecules. Different bonds showing bending and stretching were seen. At 971 cm−1, the C–N bands vibrate in a stretching manner. CH3 rocking vibration is the cause of the bands at 668, 920, and 915 cm−1 in the infrared spectrum. In (CH3NH3)2ZnI4 and (CH3NH3)2CoI4, the NH3+ vibration is situated at 1261 cm−1 and 1250 cm−1, respectively. For (CH3NH3)2ZnI4 and (CH3NH3)2CoI4, the CH3 scissoring vibration was measured at 1422 cm−1 in the infrared and 1422 cm−1 in general. In the infrared, the bands of NH3+ vibrate asymmetrically at 3178 cm−1. The asymmetrical deformation vibration of NH3+ is accompanied by the bands at 1608 cm−1. The NH3+ scissoring vibration is linked to the bands at 1467 and 1465 cm−1. In all samples, the N–H and C–H stretching bands are visible [40]. Bonds that are subjected to stretching and bending show a consistent change. Only for (CH3NH3)2ZnI4 were distinctive IR peaks seen in the 3000–3200 cm−1 range (Fig. 2 b), which were ascribed to symmetric NH3+ and CH3 stretching modes. Notably, the O–H stretching bond was present in the bond positions found for the samples made of (CH3NH3)2ZnI4, while the sample made of (CH3NH3)2CoI4 had no traces of the small peaks associated with the stretching vibration, which is related to O–H group at 3466 cm−1. O–H oscillations of H2O influence the H2 bonds among the N–H group and iodide due to N–H stretch vibrations, which were known to be sensitive to the intensity of the interaction between MA and I. According to Fig. 2 b, features of absorption in the range of 1400–1470 cm−1 are attributed to symmetric NH3+ bending and asymmetric CH3 bending, whereas CH3 occupies the 900–1250 cm−1 region–NH3+ rocking and C–N stretching modes. These peaks, agreed with previously reported results, have shown that the suggested conversion technique is quite effective [41, 42].

3.4 X-ray Photoelectron Spectroscopy (XPS)

Figure 3 a displays an analysis of XPS spectra for both (CH3NH3)2ZnI4 and (CH3NH3)2CoI4. The XPS scan pinpointed the precise positions of the perovskite films corresponding to the oxidation states of C, N, Zn, Co, and I. Peaks at 781.3 and 1022.9 eV in the (CH3NH3)2ZnI4 and (CH3NH3)2CoI4, respectively, are consistent with the Zn 2p and Co 2p, showing that Zn2+ and Co2+ are successfully inserted into the (CH3NH3)2ZnI4 and (CH3NH3)2CoI4, respectively. The data in Fig. 3 b also demonstrates the Zn2+ ion in the lattice of perovskite with energy levels of Zn 2p3/2 and Zn 2p1/2 at 1,021.8 eV and 1,045.1 eV, respectively [43]. Cobalt ion peaks, Co 2p3/2, are located at 781.1 eV and Co 2p1/2 at 797.1 eV (Fig. 3 c). Co 2p3/2 and Co 2p1/2 both exhibit satellite features at 786 and 803 eV. The 786 eV satellite peak is commonly used to confirm the existence of Co2+ [44]. In addition, the peaks for I 3d5/2 and I 3d3/2 is attributed at 619.18 eV and 630.68 eV, respectively for both (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 samples.

Fig. 3
figure 3

a XPS survey spectra of (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 samples and b Zn 2p and c Co 2p and d I 3d

3.5 Field Emission Scanning Electron Microscope (FESEM)

The photogenerated exciton was predicted to be separated by a large organometal halide perovskite contact region. However, successful charge extraction requires morphological changes that effectively deliver charge carriers to the electrode. Figure 4 a, b shows the morphology of (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 perovskite powders, respectively. The morphology of the (CH3NH3)2ZnI4 film was denser than the (CH3NH3)2CoI4 film, which agreed with the XRD results. The (CH3NH3)2ZnI4 film exhibits a few pinholes uniformly with practically the complete surface coverage, which is better than the (CH3NH3)2CoI4 film, according to the figure of the film where nanoparticles aggregate on the surface. These images provide the impression that crystals of varying sizes are distributed over a film's surface, much like semi-spheres. Perovskites' enormous grain size allows for efficient charge transport, lowering stimulated recombination and producing incredibly efficient optoelectronic devices.

Fig. 4
figure 4

FESEM images of a (CH3NH3)2ZnI4, b (CH3NH3)2CoI4. TEM images of c (CH3NH3)2ZnI4 (d) (CH3NH3)2CoI4

3.6 Transmission electron microscopy (TEM)

Figure 4 c, d shows a TEM image that was used to evaluate and understand the microscopic structure of (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 samples at the nanoscale. The (CH3NH3)2ZnI4 TEM picture reveals homogenous particles, agreeing with the FESEM image. At the same time, outstretched nanocrystals with sphere-like morphologies were seen in the (CH3NH3)2CoI4 sample, with particle sizes ranging from 15 to 30 nm. The large, circular nanocrystals in Figs. 4 c, d show that these films possess a polycrystalline nature on a nanoscale.

3.7 Optical properties

The optical properties and attributes of the produced powders were investigated using a UV–vis spectrophotometer to collect the absorption and reflectance spectra in the wavelength range 200–2000 nm. Figure 5 depicts the findings. The (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 samples have strong absorption in the visible light wavelength range, as shown in Fig. 5 a. The absorption edge for the (CH3NH3)2ZnI4 sample changes towards the lower intensity direction. Still, the (CH3NH3)2CoI4 sample has a high-intensity wavelength, indicating that the band gap energy of the cobalt ion is lower than that of the zinc ion. Two peaks at 250 and 400 nm were clearly evident in ultraviolet and visible light spectra, as shown in Fig. 5 a [45, 46].

Fig. 5
figure 5

a Absorbance spectra of the (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 powder. b Diffuse reflectance spectra of the (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 powder. c Band gap energy of produced (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 powder. d photoluminescence (PL) spectra of the (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 perovskite

Using diffuse reflectance UV–Vis data, the optical band gap energy (Eg) was estimated. Figure 4 b explains the reflectance spectra for the (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 samples. Equations (1) and (2) can be used to compute the Kubelka–Munk Eq. (2) [47,48,49].

$$F\left(R\right)=\frac{a}{s}=\frac{{(1-R)}^{2}}{2R}$$
(1)
$${[F\left(R\right)hv]}^{p}=A(hv-Eg)$$
(2)

where light reflectance is denoted by R, the absorptions (α), and scattering coefficients (S) [50]. Another factor, like constant (A), relies on the possibility of the transition. P is a direct or indirect band gap (2 or 1/2), respectively. Figure 5 c shows (h \({\varvec{v}}\))2 versus h, which finished the operations. These graphs' straight lines are extrapolated to the h-axis, and from their junction point; band gap values for (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 were found to be 2.42 and 1.87 eV, respectively. After this, the sample was synthesized using the cobalt ion, which was more effective in band gap energy than the zinc ion method used in perovskite material synthesis. As a result, it is possible to say that the procedure employed to make these specimens was crucial. The statistics clearly show that the energy band gap relies on the crystal size. As a result, it was conceivable to conclude that the crystalline and amorphous phases influence the optical band gap.

3.8 Photoluminescence (PL)

Aside from the semiconductor's optical properties material, which is associated with intrinsic and extrinsic qualities, photoluminescence spectroscopy was used to broaden the application domains of perovskite materials and develop novel optoelectronic devices. The following factors indicated a photoluminescence quenching in our materials: Exciton formation depends on photoabsorption effectiveness. It is possible that charge separation occurs at the contact because of the excitons' migration speeds [51, 52].

Figure 5 d displays the PL emission spectra of (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 as a powder at standard temperature. An excitation band with a wavelength of 360 nm was utilized so that the PL spectra could be measured. (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 powder displayed a broad blue luminescence band around 460—470 nm with a 2.42 and 1.87 eV band gap, respectively (Table 1). Thus, the emission of (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 LMCT (ligand-to-metal-charge-transfer) pathways may be to blame. Photoluminescence test findings indicate that (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 samples could be used in fluorescent technology.

Table 1 Difference between (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 in absorption edge, band gap (Eg), and Photoluminescence (PL)

3.9 Solar cells application

Figure 6 a depicts the design of the perovskite solar cells discussed in this study. The experimental section includes detailed illustrations of the methods, materials, and equipment employed. In this device, the hole and electron transport layers are represented by PEDOT:PSS and PCBM, respectively, while the light-absorbing materials are perovskite (CH3NH3)2ZnI4 and (CH3NH3)2CoI4. Under simulated solar illumination (AM 1.5G, 100 mW.cm−2), current–voltage (J–V) characteristics were measured. Figure 6 b shows the J–V curves of the cells, and Table 2 summarizes the device performance characteristics. The device that was built from (CH3NH3)2ZnI4 had an open circuit voltage (VOC) of 0.50 V, a short-circuit photocurrent density (JSC) of 5.19 mA/cm2, and a fill factor (FF) of 0.28 had the lowest PCE of 0.73%. On the other hand, the Voc, Jsc, FF, and PCE for (CH3NH3)2CoI4 increased considerably to 0.49 V, 14.27 mA.cm−2, 0.37, and 2.54%, respectively. As far as we know, this is the first initiative to investigate and grow an interest in (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 perovskite solar cells.

Fig. 6
figure 6

a Configuration structure for the p-i-n inverted of the cell b The J–V curves of the cell based (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 as an absorber

Table 2 A summary of the device performance parameters

In the discussion of the performance enhancement of the perovskite solar cells using (CH3NH3)2ZnI4 and (CH3NH3)2CoI4, it's important to consider the impact of the band gap on the photovoltaic performance of these materials [53, 54]. The band gap, which is the energy difference between the valence band and the conduction band, plays a significant role in determining the efficiency of solar cells. The band gap of a material is a critical parameter in photovoltaic devices. In this study, it is clear that (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 have different band gaps: 2.42 eV and 1.87 eV, respectively. A smaller band gap, as seen in (CH3NH3)2CoI4, allows for the absorption of a wider range of solar spectrum photons, resulting in a higher photocurrent (JSC) [55, 56]. This is evident from the significant increase in JSC for (CH3NH3)2CoI4 compared to (CH3NH3)2ZnI4. The TEM images also provide some insights into the morphology, with (CH3NH3)2CoI4 having nanocrystals with larger, spherical morphologies. These features may be associated with better light absorption and charge generation. Open-circuit voltage (VOC) is influenced by the difference in energy levels of the materials, which are related to their band gaps [18, 36, 57]. A larger band gap, like that of (CH3NH3)2ZnI4, may contribute to a slightly higher VOC. VOC is also influenced by recombination rates and charge carrier mobility, which can be connected to the material's structure as observed in TEM images. (CH3NH3)2ZnI4's homogeneous particles may affect VOC. TEM results that show different morphologies for the two perovskite materials can be linked to FF. (CH3NH3)2CoI4's nanocrystals may contribute to efficient charge transport, reducing recombination, and enhancing FF. The information provided above regarding the microscopic structures of the (CH3NH3)2CoI4 film samples obtained using FSEM and TEM indicates that the large grain size and improve the orientation and surface morphology of perovskite film by accelerating crystallization kinetics. In summary, the difference in band gaps between (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 perovskites is a key factor influencing the performance of the solar cells, particularly in terms of JSC, VOC, and FF. The observed morphological differences in TEM images can provide insights into these variations.

4 Conclusion

In summary, the two-dimensional crystals (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 are synthesized and characterized in this study. Organic metal halide perovskites devoid of Pb: their structural and optical characteristics (CH3NH3)2ZnI4 and (CH3NH3)2CoI4 are investigated and compared. Different techniques such as XRD, Raman spectroscopy, FT-IR, FESEM, and TEM are used to determine the zinc and cobalt-based perovskite characteristics. According to this study, the electronic band gap value is affected based on the cation type where (CH3NH3)2ZnI4 has a bandgap of about 2.42 eV, while (CH3NH3)2CoI4 has a bandgap of about 1.87 eV. It provides assignments of the different bands observed in the Raman spectra perovskites with different cations, which is essential information that also helps other researchers to understand better fundamental properties of this class of materials concerning their efficiency in optoelectronic devices. A comparative study suggests that (CH3NH3)2CoI4, containing cobalt, could be a better lead replacement than (CH3NH3)2ZnI4, containing zinc. The device made of (CH3NH3)2ZnI4 showed the lowest PCE of 0.73%, while, for (CH3NH3)2CoI4, the PCE raised dramatically to 2.54%. This work introduces a new material to perovskite solar cells, which will help the scientific community reduce the toxic effects of lead-based perovskite solar cells.