A Verilog-A Model for a Light-Activated Semiconductor Gas Sensor

Light activation is a demonstrated alternative to heating for promoting gas response in semiconductor gas sensors. After two decades of research, the underlying mechanisms behind their responses are still discussed, but experiments have shown consistent trends under different light conditions and gas concentrations. Based on these consolidated qualitative observations, we propose a phenomenological model that predicts quantitatively the resistance changes in light-activated gas sensors, exclusively based on a set of parameters that can be determined in advance, from dedicated experiments. It is a modular Verilog-A model that incorporates effects, such as photoconductivity, dynamic response to gases, irradiance influence on the sensitivity, and baseline drift. We validated the model with experimental data, showing it can predict observations in short and long timescales. We make its source-code fully available to the community, so that it can be used right away to help engineers to design interfaces for this kind of sensors, and it can be modified by peers to incorporate additional refinements.


I. INTRODUCTION
A IR pollution and environmental contamination is one of the main problems of today's society.According to the World Health Organization (WHO), it causes more than 6 million premature deaths every year around the world, regardless of the wealth of the country [1].This reason prompted researchers to study and develop new technologies to monitor and control such hazardous gases, making people aware of how vulnerable we are to the impacts of climate change.
Gas sensors are key components to address this monitoring problem and are present in many industrial and domestic systems for environmental pollution monitoring [2], [3], energy management [4], efficient mobility [5], safety [6], and security [7], [8].These sensors provide critical information not only about the presence of a certain gas or gases, but also about their concentration in a specific location, allowing individuals and organizations to take appropriate actions to protect human health and safety, prevent accidents and damage, and optimize processes and operations.
To date, several gas sensing technologies emerged using MEMS [9], such as surface acoustic wave (SAW) [10] or fiber optic devices [11], among others [12].Solid-state semiconductor gas sensors (interrogated in conductometric mode typically made of a semiconductor, such as metal oxides (SMOs) [13], carbonaceous materials [14], or polymers [15]) offer a robust and cost-effective solution.SMO gas sensors are good candidates for mass production in the monitoring of the environment because of their small footprint, high sensitivity, and fast response times.Nevertheless, further improvements in power consumption and improved selectivity are necessary to satisfy today's demands.
In the presence of a specific gas, the conductance from SMO sensors can only either increase or decrease; limiting the amount of information they can provide.To illustrate this, let us consider oxygen as a representative gas.In materials designed for gas sensing, such as SnO 2 , ZnO, WO 3 , In 2 O 3 , TiO 2 , and so on, which are n-type SMO [16], electrons are the predominant charge carriers.When oxygen ions are adsorbed onto an n-type SMO, they capture electrons from the material, resulting in a decrease in conductance (or an increase in resistance).Conversely, when oxygen ions are desorbed, facilitated by a reaction with a reducing substance, electrons are released into the material's bulk.This process leads to an increase in conductance (or a decrease in resistance).A typical example of this kind of process is the oxidation of carbon monoxide on the surface of metal oxides, leading to the release of carbon dioxides and a free electron (CO ) [17].Reciprocally, in p-type materials (such as CuO, NiO, Co 3 O 4 , Cr 2 O 3 , and so on) [18], where the majority charges are holes, the signal variations develop in the opposite directions, increasing the conductivity in the presence of an oxidizing gas and decreasing it with a reducing gas [19].Therefore, an SMO gas sensor can basically distinguish just the oxidizing (e.g., O 2 , NO 2 , O 3 , and so on) or reducing (e.g., CO, NO, NH 3 , C x H y , alcohols, and so on) character of the target gas, and not strictly its precise composition.
For this reason, research in SMO materials has been devoted during many decades to devise complementary reaction paths, where the fundamental oxidizing/reducing processes can mostly develop in the presence of the gas of interest, to attain some level of gas specificity in the SMO sensors signals.These strategies involved the modification of the basic metal oxide materials with additives, the formulation of multimetallic oxides, or the use of catalytic centers and particles, among many others [20].
Traditionally, heating has been used to operate these devices in thermodynamic conditions that favor the abovementioned oxidation/reduction/catalytic interactions between the semiconductor surfaces and the molecules of the target gas [21].This implies temperatures of a few hundred Celsius degrees, associated with important power consumption levels, despite miniaturization efforts [22].
As an alternative, light can be used to promote such gas-surface interactions [23], rendering equivalent gas sensing performances [24].These conductometric SMO sensors working under illumination can be regarded as an impedance varying with the presence of the target gas [25] (that mimics the SMO response) coupled to an electrooptic light emitter, such as an LED (causing the appropriate reaction activation).Fig. 1 shows an equivalent electrical model of this concept, where R SENSOR represents the variable resistance of the SMO material, C P is the parasitic capacitance of the interconnection, and L S is the LED light source.This model depends on the many design parameters of the device, such as the SMO material chosen, its crystalline microstructure, surface area and thickness, the contacts layout, the placement, and dimensions of the LED [26].
Typically, the R S resistance change of the SMO material has a dynamic range of multiple orders of magnitude in response to gases and light, with a base resistance that will also depend on the reproducibility and variations of the fabrication methods (temperature, humidity, and so on).Such variability adds complexity to the readout interface, the signal processing, and calibration methods used.The capacitive component of the impedance (mainly coming from the contacts) can play a key role during the transient measurements and must be considered, especially in time-modulated measurements.The illumination conditions are key to stablish the working conditions of the SMO material and its reactivity.Therefore, accurate means to control the electric bias of the LED, and consequently, the light irradiance levels reaching the SMO material are needed.A better electrical control of the light emission in LEDs typically calls current driving.
To date, illuminated gas sensors have been much less investigated than their heated counterparts, but there exists abundant evidence of their viability either using conventional metal oxides (SnO 2 , WO 3 , or TiO 2 [27]), carbon nanotubes (CNTs) [28], and other carbonaceous structures (CNF [29] and graphene [30]).Responses to both oxidizing (such as NO 2 or O 3 [31]) and reducing (such as H 2 or CO [32]) species have been demonstrated.Also, light of photon energies above and below the semiconductor bandgap has been used, as well as different intensities, both in steady and time-modulated illumination conditions.
Out of this knowledge, there exist a variety of light-activated sensing mechanisms proposed [33], [34] that mostly share a few phenomenological features.
1) Light lowers the baseline resistance of the sensor, by means of photoconductivity.2) In the absence of light, response to gases is negligible, but in the excess of light, the response also decays (thus, a sweet spot of irradiance for best response should be found).3) Light systematically speeds up the response and recovery times, suggesting that it favors both gas adsorption and desorption mechanisms.Moreover, with light, it is possible to attain dramatic power savings following the usual path of miniaturization combined with energy efficient light sources (such as LEDs) [35].This opens the door to the use of semiconductor gas sensors even in power limited IoT applications, which is an expanding field aiming to supply the high demand of more interconnected daily devices to ease people's life.
However, a sensor device is only useful integrated in an electronic system of a higher complexity.Therefore, taking advantage at a system level of the theoretical power savings attained at a device level implies developing custom electronic interfaces capable of meeting sufficient control (i.e., driving the LED), measurement (i.e., measuring the resistance), processing (e.g., signal processing and calibration), and connectivity (e.g., wireless communications range and data rate) performances, with a moderate power budget.
To address this problem, we present here a phenomenological model, capable of predicting the electrical behavior of illuminated sensors under varying illumination and gas conditions.It is solely based on a reduced set of parameters that can be assessed experimentally in advance.This new model will serve researchers to optimize working conditions toward response, dynamics, or power consumption, as well as system engineers to emulate in full the sensor behavior when implementing electronic control, readout electronics, processing, and communication interfaces.
Ours is a behavioral electrical model described in Verilog-A [36], an analog modeling language commonly used in electronic design automation (EDA) tools.The model can be implemented directly into the design software (e.g., Cadence Virtuoso) to simulate the sensor behavior together with its electronic interface.This powerful feature allows the designer to optimize the circuitry to drive and measure the sensor.Since electronics simulations are computational hungry, the model of the sensor must be efficient.In consequence, we avoided to describe the chemical and molecular processes and focused on the behavior of the output response (i.e., resistance) to a given input (i.e., illumination and gas conditions over time), treating the model as a black box that responds closely enough to the real SMO illuminated gas sensors, for system design purposes.The model is defined by a set of parameters that allow the user to easily modify the behavior without modifying the code.For this reason, the model can describe the response to any kind of gas and/or illumination source (e.g., wavelength and intensity), for which the calibration data needed to set up the model are available.To facilitate revision, access, reuse and improvement of the model, we made it available publicly in a GitHub repository.

II. MODEL DETAILS
In this section, we present a detailed explanation of the model.The complex behavior of the gas sensor is split into the basic contributions presented in the block diagram of Fig. 2, where each block implements mathematically a specific phenomenological aspect of the sensor's behavior.
The model takes as inputs the signal applied to switch on and control the LED brightness, which can be either controlled by a voltage source (V LED (t)) or by a current source (I LED (t)), and the evolution of the gas concentration around the sensor (Gas(t)), both represented by programmable sources.The sensor response to gas blends (accounting for, e.g., interference and selectivity) can be modelized by placing multiple response-model blocks in parallel fed with independent signal sources associated with each one of the gases.Other features of gases, such as the flow speed, can also be introduced through the dynamic properties of voltage source representing the gas.The output, in turn, is the output resistance (R SENSOR (t)) observed between two terminals (R p and R n ) under a constant probing voltage (V REF ).To render quantitative outputs, the model needs a set of experimental parameters described in the following lines.
We begin modeling the illumination source to evaluate the excitation level of the sensor.The inset in Fig. 2 shows the equivalent electrical circuit of an LED used when voltage is used to control the brightness.The current flowing through the LED (I LED ) can be directly obtained in Verilog-A by defining the series resistance (R S ) (modeling the contacts), followed by three parallel branches containing a shunt resistor (R P ), a parallel capacitor (C P ) (modeling the junction leakage and capacitance, respectively), and an ideal diode (D) that follows the electrical behavior where I S is the inverse saturation current, q is the elementary charge, k is the Boltzmann's constant, n the ideality factor, T represents the absolute temperature, and V D is the voltage effectively dropping between the ideal diode terminals.This mathematical model is implemented in Verilog LED operation under current controlled conditions is usually preferred experimentally.Here, the voltage option was given for simplicity.Due to the ideality of the models, negligible effects due to this difference were observed in the results.
Alternatively, the LED current can be directly fed into the model and selected with a multiplexer in the model.The resulting light irradiance (E e ) impinging on the semiconductor surface [37], [38] follows an almost linear relationship with the electrical input power before it saturates [39] and can be modeled with (2) and then fed into a low-pass filter (LPF) to Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.simulate the dynamic behavior of the semiconductor layer in response to the photoexcitation ( 3) where E e0 represents the background irradiance (coming eventually from, e.g., the ambient light) and E eM is the variation of the irradiance with the LED current (I LED ).G IRR is a parameter to adjust the irradiance gain if needed, and T IRR is the time constant of the LPF (see Fig. 3).The Verilog-A implementation of this block is shown in the following code, where it can be observed that the filter is actually defined in the Laplace domain through the laplace_nd() function: // Irradiance irr = IRR_0 + IRR_M * led_curr; // Irradiance low pass filter irr_lp = laplace_nd(irr, {1,IRR_TP}); The first derived from the photoexcitation state (i.e., the irradiance level) is the baseline resistance photoconductance of the sensor exposed to clean air (R base ): the resistance drops under optical excitation due to the additional free charges made available in the semiconductor upon photon absorption (see Fig. 4) following a behavior like: where R 0 is the material resistance under ambient irradiance conditions, and α and β are fitting parameters.The Verilog-A implementation is written as follows: // Light effects on sensor resistance r_base In parallel, to build the sensor response in the time domain, we started with the sequence of gas concentration levels to the gas sensor Gas(t).The sensor output can regarded as a filtered version of this signal, amplified according to the sensor sensitivity and delayed following the sensor dynamic characteristics.This behavior is emulated by a transfer function H (s) in the form shown in (5).We formulated this transfer function as a combination of two exponential transients (τ 1 and τ 2 ) (Fig. 5) with a certain gain (A), following the many multiexponential examples in the literature [34].This operation generates a "filtered" gas concentration signal Gas f (s), denoted in (6), that is then used as a basic s-domain template modified in amplitude in the subsequent blocks An aspect to take into account in the model is that, despite Verilog-A supports S-domain operations, it does not allow a dynamic behavior of the poles and zeros that are observed in the sensor due to different gas concentrations and asymmetric responses.For this reason, the model considers this dynamic output in the form of the time domain differential (7) that corresponds to the transformation of (6).It is worth noting that, to favor the convergence of the simulator between time points, the equation is written in the integral form where A is the gain of the input, and τ 1 and τ 2 are the two time constants of each exponential transient.This also allows us to characterize the dependence of the settling time to the irradiance and gas concentration.To convert the equation into the integral form, the only step is to solve for Gas f (s) in terms of 1/s.Following the experimental evidence from [38], the first time constant τ 1 is related to the irradiance as per (8), while the second, τ 2 , is independent and is associated with the rate of change of the gas surrounding the sensor (e.g., the gas injection speed of the chamber where the tests of the sensor have been carried out).Equation (9) showcases that this second time constant is directly controlled by a parameter to add some flexibility to the model and accommodate multiexponential deviations Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.Comparing the response and recovery processes, it has also been observed that their dynamics are asymmetric [40].This behavior has been parametrized as a ratio between the response (on) and recovery (off) time constants Notice that in the model, all these time constants evolve with time, due to their dependence with the irradiance [hence, the explicit (t) notation].
Finally, the amplitude of this dynamic track is scaled to the different factors that determine the response magnitude (S): the filtered gas concentration (Gas f ) and the irradiance level (E e ).In this work, we used the following definition for the sensor response to gases: Previous works [38] concluded that while response evolves with irradiance following a complex bell-shape trend [see Fig. 6(b)], the peak of such trend scales linearly with the gas This interdependency is in the model as follows: 13) where S M and S 0 are linear fitting parameters and σ is the bell width (also a parameter and treated as a constant, although it can slightly vary from bell to bell).All parameters can be extracted from the calibration curves of a given sensor.Also, alternative relationships can be inserted in our model to describe different response behaviors.Observations in light-activated gas sensors showed that the response of the sensing material is highly dependent on the light source wavelength.In this model, the user can model sensors operating at different wavelengths, by gathering appropriate experimental data acquired at that wavelength and setting up the parameters accordingly.
Once stablished the dynamic and magnitude response of the sensor, we translated these effects into actual resistance values (R gas ) following Also, we included in our model resistance drift effects due to their relevance in SMO gas sensors.Independently of the manifold and complex causes (such as chemical diffusion of oxygen species, physical changes of the semiconductor layer, degradation of metal contacts, and so on [41]), we found that a simple linear term over time with a single drift coefficient (C D ) was enough to sufficiently capture these effects in the experimental data available Again, other laws to depict more complex drift behaviors or a better understating of the underlying mechanisms can be incorporated in future refinements.
Finally, the sensor resistance value observed experimentally (R SENSOR (t)) is the aggregate of all abovementioned terms

A. Summary of Model Parameters
The model behavior is fully defined by the set of parameters summarized in Table I following the order in which they are presented in this article.The column "symbol" shows the notation used in the equations of this article, while the column "parameter" provides for clarity the plain-text notation used in the Verilog-A code.

III. EXPERIMENTAL DETAILS A. Reference Measurements
To validate our model, we compared the predictions of the simulations with experimental measurements from samples of illuminated gas sensors published elsewhere [38] (Fig. 6).
These devices are built around a miniaturized LED (microlight plate configuration-µLP), where the SMO material (ZnO nanoparticles) is placed directly on top of the planar µLP LED structure, only separated by a few hundred nanometers to insulate it electrically.Consequently, almost all the light emitted by the LED impinges on the sensor SMO, allowing for very well-controlled, uniform, and high irradiances levels, with a reduced electrical power consumption.The µLP exposes four independent pads: two to operate the blue InGaN LED (455-nm peak emission) and two more to measure the electrical resistance of the SMO material lying across a pair of interdigitated electrodes.These sensors performed particularly well detecting NO 2 , ranging from a few parts per billion (ppb) Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

TABLE I MODEL PARAMETERS DESCRIPTION
to parts per million (ppm), with electrical power requirements low as 30 µW.
The experimental data from the sensor were obtained by introducing it into a gas-tight chamber and blending gases by means of a set of mass flow controllers (MFCs, Brondkhorst) flowing at a constant rate of 400 mL/min.The reference atmospheres were produced by diluting certified gas patterns with dry synthetic air (SA) (20% O 2 + 80% N 2 in volume ratio, with a purity of 99.999%, H 2 O < 5 ppm, and C n H m < 1 ppm).Patterns of 10 ppm of NO 2 , 100 ppm of NH 3 , 100 ppm of CO, and 1% of CH 4 were used to incorporate the target gases.The gas chamber was equipped with feedthrough electrical connections to drive the LEDs and to measure the electrical resistance of the SMO layer, using a Keithley 2400 sourcemeter unit (SMU).LED driving and resistance measurements were carried out under constant current and light irradiance conditions ranging from 25 ppb to 1 ppm.

B. Extraction of Model Parameters
Setting up realistic parameters to run the model can be achieved from a set of reference experiments in four steps.To understand each step, we illustrate the process using the experimental data from the gas sensor described [38] (Fig. 6).
Step (i): The light source parameters are extracted from the characteristic curves of the LED.The reverse saturation current (I S ) and the ideality factor (n) are found by fitting an exponential law to the I (V ) curve of the LED.The parasitic components (R S , R P , and C P ) needed a more careful characterization of the device, through, e.g., impedance spectroscopy.Another option could be to directly feed the LED current into the model, avoiding the calculation of this voltage-to-current conversion.The irradiance parameters (E e0 , E eM , T IRR , and G IRR ) are also configured at this stage to set the optical excitation level of the SMO and are found by looking at the sensor response curves under different light intensities.
Step (ii): The parameters defining the sensor steady state (α, β, A On , A Off , and r ) are measured during the sensor characterization under constant gas concentration.Here, the sensor "reference" resistance (R 0 ) is found by keeping the sensor under an arbitrarily chosen "reference" irradiance conditions and in clean air.The response is found after exhaustive measurements of the sensor resistance under the desired light and gas conditions [Fig.6(a) shows an example of one these measurements], in relation to their value in clean air.Fig. 6(b) shows a summary of responses that clearly display the abovementioned with the bell-shape trend (from which the σ value can be extracted).Fig. 6(c) gives the relationship between the irradiance and the height of the bell to extract S 0 and S M .
Step (iii): Out of the same measurements [exemplified in Fig. 6(a)], one can identify the long-term drift effects (C D ) by looking at the slow deviation of the senor signal, not following the overall trend due to the external inputs.In this example, a drift term linear over time was enough to capture the data behavior.
Step (iv): The dynamic parameters (T 0 , T M , T 2 , and T OnOff ) were taken again from the same experiments [Fig.6(a)], but now observing the transient behavior of the sensor after each sudden change of the experimental conditions (i.e., gas concentration and/or light irradiance).Fig. 6(d) shows the dependence of the transient times with the gas concentration and the irradiance.

A. Single Irradiance Experiment
After gathering all parameters from the sensor curves, our model can predict quantitatively the resistance measured by the sensor over time (Fig. 7).It follows properly the resistance variations both under a sequence of slow gas pulses (timescale of hours) and under a fast-pulsing illumination background (timescale of seconds).This demonstrates the ability of the tool to predict both the magnitude and the dynamic response of a sensor to varying gas-light environments.Still, the deviations observed reveal operation conditions where the simplifications made in the model start to fail (for example, due to response saturation effects at high gas concentrations).The same experiment modeling illustrates how a linear drift term is a good enough approximation in this particular case.

B. Multiple Irradiance Experiments
The model can also be applied to predict the experimental trends in more complex scenarios, such as comparing the response under widely varying illumination conditions.The same four-step process was used to obtain the parameters needed.
For Step (i), we measured the sensor base resistance as a function of the incident light irradiance.To that end, the device was exposed to light pulses of different intensities with  a period of 4 s and a duty cycle of 50%.Fig. 8 shows the data of this experiment and its fitting to the model curve of (4).It is worth noting that, in this case, we will refer as the resistance in dark conditions (R 0 ) to the response of the sensor with an LED current of 10 nA, which is around 1.7 G .
For Step (ii), we measured the resistance variation in response to different gas concentrations now under varying irradiance levels (Fig. 9).Data from the sensor response were again modeled with a bell-shaped curve, following the variations for multiple irradiance and gas concentrations levels.The cross points denote the maximum height of the bell that follow the linear relationship of (12).We observed a certain deviation of the data points from the ideal bell-shaped law, may be because the sensor response also degrades over time.Anyhow, for the sake of the phenomenological model presented, the overall trend is captured.It should be noted that the model takes the standard deviation of the bells as a constant, and this assumption is another approximation taken for simplicity and to keep the code computationally light.
For clarity in Step (iii), we decided to remove the drift term by subtracting the baseline resistance from the data.
In Step (iv), we again collected the transient times of the data collected for both the gas and light variations.
With this new set of model parameters, we simulated the experimental trends presented in Fig. 10.The hashed bands around the model line illustrate the 95% confidence interval of the predictions.This interval was obtained by carrying  As can be seen, the model follows accurately the sensor behavior for the higher LED currents with all the points within the model confidence interval.Deviations are tough larger for lower LED currents (low irradiance), but are enough to identify the worst case operation points, allowing a designer to simulate the front-end electronics working along with a sensor.
Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

V. CONCLUSION
We presented a Verilog-A model of the electrical behavior of illuminated SMO gas sensors, based on a phenomenological description of the trends observed in this type of sensors, that requires a reduced set of experimental parameters.
The model predicts accurately the variations in sensor resistance once its parameters have been approximated to experimental estimates.The model can deal with the uncertainty in these parameters by means of Monte Carlo methods.
The accuracy of the model is enough to predict qualitative trends and get quantitative estimation of the resistance values.Despite the deviations observed in some cases, static and dynamic values are good enough to identify the design conditions for the design, simulation, and optimization of interfacing electronics.
The model is modular and can be improved by incorporating more detailed and/or complex descriptions of the effects involved, such as drift components and response variation with the light wavelength, among others.To facilitate access and reuse by the scientific community, we published the source code in an open GitHub repository [42].Thus, anyone can use or modify the model for its own purposes, adding new features or improvements.

Fig. 1 .
Fig. 1.Equivalent electrical model of an illuminated SMO gas sensor (inside the dotted box).

Fig. 2 .
Fig. 2. Block diagram of the photoactivated gas sensor model and equivalent electrical circuit of the LED.

Fig. 3 .
Fig. 3. Irradiance model response to a variation in the LED current.

Fig. 6 .
Fig. 6.Examples of the experimental data used to determine the model parameters.(a) Resistance record of the ZnO sensor to increasing concentrations of NO 2 .(b) Summary of the responses obtained to NO 2 concentrations ranging from 25 ppb to 1 ppm with increasing irradiance/power levels.(c) Irradiance at which the maximum response is reached, as a function of the NO 2 gas concentration.(d) Summary of the response times (defined as the 10% to 90% of the signal rise time) obtained to NO 2 concentrations ranging from 25 ppb to 1 ppm as a function of the invers irradiance.Reprinted with permission from [38].Copyright 2024 American Chemical Society.

Fig. 7 .
Fig. 7. Model results compared with experimental data from a UV illuminated gas sensor.Left: curve showing the overall transient response to the gas pulses.Right: zoom into the transient details of the model showing the precise response to the light pulses.

Fig. 9 .
Fig. 9. Gas sensor response model fit for multiple illumination levels and gas concentrations.

Fig. 10 .
Fig. 10.Photoactivated ZnO gas sensor model behavior for different LED currents.The shadows zones of the model curves represent the sensor variations accounted by the model.