## 1 Introduction  
Surface Plasmon Resonance (SPR) sensors are well known optical platforms for label-free sensing and testing applications. They are widely used in industrial and research labs for different purposes such as gas sensing [1, 2], chemical sensing [3], colorimetric sensor [4], and bio-materials identification [5]. In most of the commercially available SPR devices, the excitation of SPR is based on a Kretschman configuration, which requires light-prism coupling under oblique incidence [6]. As an improvement, the excitation of SPRs in normal incidence conditions is key to simplify the optical scheme, ease the illumination and acquisition signal system, allowing a lower cost solution [7, 8, 9, 10, 11, 12]. Plasmonic resonances, excited at noble metal surfaces by nanostructures, result in deep spectral reflection dips. They generate large field enhancements near the metal surface [13]. This response is highly sensitive to changes in the optical characteristics of the surrounding materials. Therefore, they are used in many sensing-related applications as mentioned above. Beyond the advantages of a sensor operating at normal incident conditions, the next simplification included in this paper derives from the replacement of the spectral interrogation procedures, which requires high resolution spectrometer. The idea is to use the electric response of solar cells as the base to generate an optoelectronic interrogation of the device. The available low-cost technology used in electrical measurement can greatly simplify the sensing system [14]. This method ensures high measurement reliability and reduces the cost of the whole system. As an additional desirable is to have low-cost flexible devices that can be obtained with proper substrates and thin film technology. Such a sensor generates electrical currents upon light exposure and becomes self-powered, being the extracted signal sensitive to environmental changes. Although a solar cells exemplifies this situation, its plane exposed interface is not selective enough in wavelength, and its sensitivity to small changes in the index of refraction of the exposed medium is not relevant. Therefore, to sensitize a solar cell, it is customary to modify its design and provide the required capabilities. A perovskite solar cell has a high absorption coefficient, and the photo-generated charge carriers present a large diffusion length compared to most of the thin-film solar cell materials [15]. Moreover, we are witnessing a progress in efficiency [16; 17] and stability [18] of perovskite solar cells that is boosting the scientific interest. This type of cell requires a transparent conductive oxide (TCO) electrode for its operation as an energy harvester [19]. Presently, TCO electrodes made of ITO (indium tin oxide) and FTO (fluorine tin oxide) remain as the most efficient in terms of its optical transparency and electrical conductivity. However, these electrodes are expensive to manufacture, rigid, and difficult to apply in flexible devices, which is one of the main advantages of thin-film solar cell technology. It is also known that metallic nanophotonic structures enhance the spectral selectivity of thin-film solar cell [20; 21; 22] at the cost of a lower transmission than TCO. Therefore, the thickness of the metallic film needs to be smaller than the penetration depth (10-50 nm depending on the material). In this contribution, we present a design applicable to perovskite solar cells that is highly sensitive to small refractive index changes of the surrounding medium, for example a gas. We replace the TCO contact in a standard perovskite solar cell with an Ag layer 50 nm-thick. This substitution strongly decreases the absorption of the solar cell. To make the cell operative again, we add a high aspect ratio dielectric grating on the top of the Ag layer. This nanostructure is capable of generating SPRs that are absorbed within the active layer.