Improving the Quality of Measurements Made by Alphasense NO2 Non-Reference Sensors Using the Mathematical Methods

Conventional NO2 monitoring devices are relatively cumbersome, expensive, and have a relatively high-power consumption that limits their use to fixed sites. On the other hand, they offer high-quality measurements. In contrast, the low-cost NO2 sensors offer greater flexibility, are smaller, and allow greater coverage of the area with the measuring devices. However, their disadvantage is much lower accuracy. The main goal of this study was to investigate the measurement data quality of NO2-B43F Alphasense sensors. The measurement performance analysis of Alphasense NO2-B43F sensors was conducted in two research areas in Poland. Sensors were placed near fixed, professional air quality monitoring stations, carrying out measurements based on reference methods, in the following periods: July–November, and December–May. Results of the study show that without using sophisticated correction methods, the range of measured air pollution concentrations may be greater than their actual values in ambient air—measured in the field by fixed stations. In the case of summer months (with air temperature over 30 °C), the long-term mean absolute percentage error was over 150% and the sensors, using the methods recommended by the manufacturer, in the case of high temperatures could even show negative values. After applying the mathematical correction functions proposed in this article, it was possible to significantly reduce long-term errors (to 40–70% per month, regardless of the location of the measurements) and eliminate negative measurement values. The proposed method is based on the recalculation of the raw measurement, air temperature, and air RH and does not require the use of extensive analytical tools.


Introduction
Air pollution is a complex problem posing multiple challenges in terms of management and mitigation of harmful pollutants [1].
Life quality and human health are affected by air pollution, especially in urban areas, where most of the population lives [2,3]. Europe's most problematic pollutants in terms of health are PM, NO 2 , and ground-level O 3 [4]. Nitrogen dioxide (NO 2 ) is one of the major pollutant gases, and its emanation is mainly caused by traffic [5].
Enhancing the spatial and temporal resolution of air pollution monitoring is nowadays one of the emerging challenges [6]. With the development of low-cost air quality sensors lot of research has been focused on achieving accurate, robust, and reliable air quality data [7,8].
The equipment was evaluated according to its performance in different environments, seasons, and meteorological conditions [9,10]. Critical issues faced by researchers are mostly correction methods [11,12] and the long-term stability of the sensors [13]. To characterize interferences and improve correction functions, both laboratory and ambient tests were conducted [14][15][16][17][18].

Materials and Methods
Alphasense NO2 (NO2-B43F) sensors are popular, low-cost sensors for measuring the concentration of nitrogen dioxide in the ambient air using the electrochemical method (4electrodes). The working principle of the NO2 electrochemical sensor is based on electrochemical reactions [5]. When the air passes through, it creates a reaction in the electrochemical cell. The surface of the working electrode is the site for the first half-reaction (oxidation), generating an electronic charge, balanced by the second half-reaction (reduction) that occurs at the counter electrode [25]. This type of sensor provides high selectivity, low limit of detection, low power consumption, and linear response to the target gas [26,27].
According to the manufacturer's description, together with a dedicated electronic board, they enable the measurement of even small concentrations of nitrogen dioxide (ppb level). To test the sensors measuring devices were built. The main element was a small measuring chamber in which two Alphasense sensors were placed. To take the air directly from the surroundings, a small fan was installed at the inlet to the measuring chamber. The measuring chamber (with direct air intake from the environment) was placed in a larger housing, which contained electronic components necessary to power the sensors and microcontroller to acquire the results (voltages from electrodes acquired from the sensor's transmitter board) and transfer them to the server. The inlet to the measuring chamber was directed downwards (analogous to the air outlet). As a result, the measuring chamber was not susceptible to wind force and rain/snow.
The measurement performance analysis of Alphasense (NO2-B43F) sensors was conducted in two research fields. Sensors were placed at the air quality monitoring stations, carrying out measurements based on reference methods. The

Materials and Methods
Alphasense NO 2 (NO2-B43F) sensors are popular, low-cost sensors for measuring the concentration of nitrogen dioxide in the ambient air using the electrochemical method (4-electrodes). The working principle of the NO 2 electrochemical sensor is based on electrochemical reactions [5]. When the air passes through, it creates a reaction in the electrochemical cell. The surface of the working electrode is the site for the first halfreaction (oxidation), generating an electronic charge, balanced by the second half-reaction (reduction) that occurs at the counter electrode [25]. This type of sensor provides high selectivity, low limit of detection, low power consumption, and linear response to the target gas [26,27].
According to the manufacturer's description, together with a dedicated electronic board, they enable the measurement of even small concentrations of nitrogen dioxide (ppb level). To test the sensors measuring devices were built. The main element was a small measuring chamber in which two Alphasense sensors were placed. To take the air directly from the surroundings, a small fan was installed at the inlet to the measuring chamber. The measuring chamber (with direct air intake from the environment) was placed in a larger housing, which contained electronic components necessary to power the sensors and microcontroller to acquire the results (voltages from electrodes acquired from the sensor's transmitter board) and transfer them to the server. The inlet to the measuring chamber was directed downwards (analogous to the air outlet). As a result, the measuring chamber was not susceptible to wind force and rain/snow.
The measurement performance analysis of Alphasense (NO2-B43F) sensors was conducted in two research fields. Sensors were placed at the air quality monitoring stations, carrying out measurements based on reference methods.  From the research perspective, the city of Nowy Sącz is interesting due to its frequently occurring high air pollutant concentrations and varied weather conditions [28].  From the research perspective, the city of Nowy Sącz is interesting due to its frequently occurring high air pollutant concentrations and varied weather conditions [28].  From the research perspective, the city of Nowy Sącz is interesting due to its frequently occurring high air pollutant concentrations and varied weather conditions [28]. The town is situated in a diversified area-the lowest point of the city is located at an altitude of 272 m above sea level, and the highest point-475 m above sea level. There are typically urban areas with tenement houses, parks, and green areas as well as single-family houses. Some areas are supplied by the district heating network, while others, especially single-family houses, are equipped with individual boilers or fireplaces (mainly for solid fuels), being a key source of particulate matter emissions. On the other hand, Warsaw, which is the capital of Poland, has a slightly different climate but is also quite diverse in terms of the variability of pollutants and main sources of emission [29].
Alphasense sensors record the voltage related to the measured quantity at the two outputs of each sensor: • WE u -voltage of the working electrode (mV); • AE u -voltage of the auxiliary electrode (mV).
At the same time, the following values are provided individually for each sensor (as a result of calibration performed by the manufacturer): • WE e -the value of the electronic offset for the used ISB (Alphasense Individual Sensor Board) for the working electrode (mV); • AE e -the value of the electronic offset for the used ISB plate for the auxiliary electrode (mV); • WE 0 -an indication of the working electrode in (mV) for air free of pollutants; • AE 0 -an indication of the auxiliary electrode in (mV) in the case of unpolluted air; and two parameters independent of a specific sensor: • n T -factor provided by the manufacturer (correction depending on the temperature); • k T -factor provided by the manufacturer (correction depending on the temperature).
The values of the above-mentioned factors from the manufacturer's documentation for the tested type of sensors are shown in Table 1. To convert the measured value to the pollutant concentration, depending on the sensor used, first, the corrected voltage value (WE c ) is calculated and then the appropriate conversion factor (mV/ppb), also, given individually for each sensor, is applied. The last step is to convert the concentration to the appropriate unit (e.g., from (ppb) to (µg/m 3 )).
For the NO 2 -B43F sensors the manufacturer proposes the use of one of the following two equations to determine the corrected voltage (we will refer to them also as method (1) and method (2), respectively): In the comparative measurements carried out at the monitoring station in Nowy Sącz, two NO 2 -B43F sensors were used. For each of these electrochemical sensors, called later in the text as NO2_1 and NO2_2, the following set of parameters was available: WE E , AE E , WE 0 , and AE 0 . Measurement instruments incorporating these sensors recorded the values of the appropriate voltages every few seconds, and then, every minute relayed these data to the server. The data were aggregated, as a result of which, 1 h mean values were determined. The study includes the comparative analysis of the data obtained in this way and 1 h measurement data from SEM's air quality monitoring station. The following statistical measures were used to compare the measurements from Alphasense sensors to measurements from the SEM station: Pearson's correlation coefficient, mean error, mean percentage error, mean absolute error, mean absolute percentage error, and mean square error. All these statistical measures were determined for particular months of the measurement periods.

Results
In order to determine the quality of the obtained measurements, the measured voltage at both outputs of individual sensors was converted into concentrations with the use of both methods presented above. For the obtained results, the basic statistics for each month were calculated. The results are shown in Table 2. These statistical parameters were calculated by comparing the data from a given Alphasense sensor with the values obtained from the SEM measurement station.  Table 3 shows the average monthly temperature measured in the chamber of the device. It should be emphasized that the instrument was intentionally left unsheltered and therefore the maximum temperatures inside the device during the summer period often exceeded +40 • C. Table 3. Mean, maximum, and minimum temperature and air humidity in the chamber of the measuring device and mean NO 2 concentration from SEM station in particular months of the analyzed period. The data presented in Table 2 show relatively different errors; in particular, months of the measurement period. For both tested sensors and both methods for converting voltages into concentrations suggested by the manufacturer, the lowest values of this factor were recorded in July. The best parameters were recorded in October. To some extent, this may have been related to the variability of actual concentrations.

July
The highest absolute percentage error occurred for the measurements conducted in warm months. The decrease in the average temperature lowered the error. While in July, the absolute percentage error exceeded 130%; in November, it oscillated around 50%.
A similar tendency is also visible in case of the absolute errors. The absolute errors decreased from 11-15 µg/m 3 in July to 8-10 µg/m 3 in November. It is also worth mentioning the high correlation of low-cost sensors' indications-for the entire period, it was r = 0.952 after applying the method (1) and r = 0.949 after applying the method (2). This means that the readings of the sensors were repeatable and that they both reacted similarly to the parameters and changes in the atmospheric air, and the actual concentration values (and possibly other pollutants). This repeatability also implies the assumption that a single, universal method of mathematical correction of sensor indications can be created.
During warm and hot days, when the temperature was approximately or exceeding 30 • C, both sensors regularly generated voltage that corresponded to negative concentrations of nitrogen dioxide after applying methods (1) or (2). The variability of 1 h mean concentrations of NO 2 and the temperature during one of the study days are shown in Figures 4 and 5.
Individually for both methods (1) and (2), deviations due to high temperature were corrected. After calculations, negative WE C values and the relevant minimum T WEC temperature were determined in this set. For method (1), it was T WEC = 23.1 • C, while for method (2), T WEC = 23.8 • C. Then, for all hours for which the average temperature was higher or equal to the determined minimum, the average temperature and the determined voltages WE U and AE U were collected. For each hour, the desired WE C • voltage was determined, which would correspond to the NO 2 concentration measured in the SEM station. It means that the WE C • value denotes the result of the relationship (1) or (2) where the result from the Alphasense sensors would correspond exactly to the value determined by the SEM station. In the next step, the difference WE C = WE C • − WE C (offset) was calculated, determined by how much the current indication from the lowcost sensor should be corrected to obtain the value corresponding to the measurement from the SEM. During warm and hot days, when the temperature was approximately or exceeding 30 °C, both sensors regularly generated voltage that corresponded to negative concentra tions of nitrogen dioxide after applying methods (1) or (2). The variability of 1 h mean concentrations of NO2 and the temperature during one of the study days are shown in     Individually for both methods (1) and (2), deviations due to high temperature were corrected. After calculations, negative WEC values and the relevant minimum TWEC temperature were determined in this set. For method (1), it was TWEC = 23.1 °C, while for method (2), TWEC = 23.8 °C. Then, for all hours for which the average temperature was higher or equal to the determined minimum, the average temperature and the determined voltages WEU and AEU were collected. For each hour, the desired WEC° voltage was determined, which would correspond to the NO2 concentration measured in the SEM station. It means that the WEC° value denotes the result of the relationship (1) or (2) where the result from the Alphasense sensors would correspond exactly to the value determined by the SEM station. In the next step, the difference WEC' = WEC° − WEC (offset) was calculated, determined by how much the current indication from the low-cost sensor should be corrected to obtain the value corresponding to the measurement from the SEM.
Multiple regression was applied to the set of 1 h mean values (T, WEU, AEU, and Multiple regression was applied to the set of 1 h mean values (T, WE U , AE U , and WE C ), where the independent variables were: 1 h mean temperature (T), 1 h mean voltage WE U , and 1 h mean voltage AE U . The dependent variable was the WE C value.
As a result, for (1) and (2) the following relationships were obtained, respectively: These additional WE C values were added to the WE C for measurements where the T WEC was higher than the predetermined cutoff for both methods. In the case of the previously presented data from 20 July 2019, the new volatility patterns are presented in Figure 6. Equations (3) and (4) were added to (1) and (2), respectively, and again NO2 concentrations were recalculated for both Alphasense sensors. The results for July and August 2019 (being the months with the highest temperatures) are presented in Table 4. The use of an offset (methods (3) or (4)) in most cases improved the quality of the results. First of all, the "negative" concentrations were removed, and the correlation with the measurements from the SEM stations was significantly improved. The highest improvement appeared in August, where correlation coefficients in relation to the SEM stations were r = 0.8. Correlation between NO2_1 and NO2_2 sensors in July were: r = 0.934 (for (3)) and r = 0.923 (for (4)), while in August: r = 0.959 (for (3)) and r = 0.946 (for (4)). The mean values of the absolute percentage errors and thus the absolute errors also improved Equations (3) and (4) were added to (1) and (2), respectively, and again NO 2 concentrations were recalculated for both Alphasense sensors. The results for July and August 2019 (being the months with the highest temperatures) are presented in Table 4. The use of an offset (methods (3) or (4)) in most cases improved the quality of the results. First of all, the "negative" concentrations were removed, and the correlation with the measurements from the SEM stations was significantly improved. The highest improvement appeared in August, where correlation coefficients in relation to the SEM stations were r = 0.8. Correlation between NO2_1 and NO2_2 sensors in July were: r = 0.934 (for (3)) and r = 0.923 (for (4)), while in August: r = 0.959 (for (3)) and r = 0.946 (for (4)). The mean values of the absolute percentage errors and thus the absolute errors also improved significantly. In most cases, they were reduced by half.
The next step was to analyze the set of measurement data and determine the new correction functions. First, the relationship between the Alphasense sensor indications and the measurements from the SEM stations was examined. Figure 7 presents that the best fit function was a 2-degree polynomial regression.  The obtained relationship is as follows: where • NA-NO2 concentration measured by the Alphasense sensor, determined from the equation: where • sA-conversion factor (mV) to (ppb) given by Alphasense individually for each sensor; • nA-factor for converting the NO2 concentration from (ppb) to (µ g/m 3 ); In the last step, multiple regression was used to bind the sensor indications with the meteorological parameters. The independent variables were: 1 h mean temperature (T), 1 h mean relative humidity (H), 1 h mean NO2 concentration expressed by the Equation (5), 1 h mean measured voltage (WEU − WEE), and the 1 h mean measured voltage (AEU − AEE). The dependent variable was the concentration of NO2: NA″.
Although the Equation (5) is based on the measured WEU and AEU voltages, it was decided to include them as additional, independent variables (or in fact, as differences in relation to the WEE and AEE values) to obtain a relationship with the interval, to which these measured voltages belong (as opposed to Equation (5), where information about the measured voltage values is lost). Secondly, the lack of additional consideration of WEU and AEU voltages led to worse results than those presented below.
The obtained, final relationship for the original method (1) is as follows: The obtained relationship is as follows: where • N A -NO 2 concentration measured by the Alphasense sensor, determined from the equation: where • s A -conversion factor (mV) to (ppb) given by Alphasense individually for each sensor; • n A -factor for converting the NO 2 concentration from (ppb) to (µg/m 3 ); • WE C -described by Equation (1); • WE C -described by Equation (3).
In the last step, multiple regression was used to bind the sensor indications with the meteorological parameters. The independent variables were: 1 h mean temperature (T), 1 h mean relative humidity (H), 1 h mean NO 2 concentration expressed by the Equation (5), 1 h mean measured voltage (WE U − WE E ), and the 1 h mean measured voltage (AE U − AE E ). The dependent variable was the concentration of NO 2 : N A ".
Although the Equation (5) is based on the measured WE U and AE U voltages, it was decided to include them as additional, independent variables (or in fact, as differences in relation to the WE E and AE E values) to obtain a relationship with the interval, to which these measured voltages belong (as opposed to Equation (5), where information about the measured voltage values is lost). Secondly, the lack of additional consideration of WE U and AE U voltages led to worse results than those presented below.
The obtained, final relationship for the original method (1) is as follows: The analysis for the second method (described by the original Equation (2)) was carried out similarly. The best fit (among regression: linear, exponential, polynomial-see Table 5) between the indications of Alphasense sensors and measurements from the SEM stations was obtained by a polynomial regression of the second degree (Figure 8). The obtained relationship is as follows:  (1) and (2). stations was obtained by a polynomial regression of the second degree ( Figure 8). The obtained relationship is as follows:  After applying multiple regression, the final form of the relationship for the original method (2) is as follows:

Kind of Regression Equation (1) Equation (2)
Statistical parameters after the conversion of the measurement results for NO2_1 and NO2_2 sensors using Equations (7) and (9) are presented in Table 6. Table 6. Statistical parameters of the measurement results from the NO2_1 and NO2_2 sensors in particular months of the analyzed period for methods (7) and (9). After applying multiple regression, the final form of the relationship for the original method (2) is as follows: Statistical parameters after the conversion of the measurement results for NO2_1 and NO2_2 sensors using Equations (7) and (9) are presented in Table 6.
The effectiveness of the determined relationship was checked with the use of a new NO 2 -B43F (indicated later in the text as NO2_3) sensor during the measurement campaign conducted at the Warsaw-Chrościckiego SEM station from December 2019 to May 2020. The results were calculated using Equation (7) and the basic equation recommended by the manufacturer. The results are presented in Table 7. Table 6. Statistical parameters of the measurement results from the NO2_1 and NO2_2 sensors in particular months of the analyzed period for methods (7) and (9). During the analyzed period, the statistical parameters describing the measurements calculated using method (1) were closer to the results received from the SEM air quality monitoring station than those presented in Tables 2-5. Therefore, the application of the correction method did not bring such a spectacular improvement as in the measurements in Nowy Sącz. The reason for this could be the fact that in the analyzed period, there were no very high temperatures, as was the case during the measurements carried out between July and September 2019.

Sensor
Nevertheless, the application of the correction function resulted in the improvement of the measurement data quality. The value of the correlation coefficient improved each month-the highest increase was recorded in May and the lowest in March. In all months, the mean absolute percentage error improved, with the best values obtained for the colder months, and slightly worse for the warmer months. Similarly, to the measurements carried out in Nowy Sącz, and also in Warsaw-Chrościckiego, it can be observed that the sensors during the colder months tend to underestimate the measurements, and during the warmer months-to overestimate (even after applying the correction method).

Discussion
As the analyzed low-cost NO 2 sensors at the output do not indicate the measured concentration of the pollutant, Alphasense recommends the use of one of two different methods to determine the voltage. The analysis showed that slightly better results were obtained using method (2)-especially in terms of the mean absolute percentage error. Taking into account the correlation coefficient, in the case of the NO2_1 sensor, the method using the relationship (1) turned out to be better, and in the case of the second sensor-it is difficult to indicate a better variant.
Additionally, none of the methods proposed by the manufacturer offer a satisfactory quality of measurements, as the long-term percentage error maybe even be over 150%, and in certain situations, implementation of the recommended methods may lead to negative concentrations of the pollutant.
The conducted research presented in this paper as well as other studies have shown that high temperature, in particular, is one of the factors interfering with the accuracy indications of Alphasense NO 2 sensors [24]. As it results from the relationships provided by the manufacturer, to determine the value of the measured pollutant concentration, calculations should be made using the measured voltages and individual values provided for a given sensor by the manufacturer. However, in both Equations (1) and (2) there is also a temperature-related parameter (n T or k T , depending on the method) given by the manufacturer (these values are common to all instances of a given series of sensors). In both relationships, it is used for indications related to the auxiliary electrode, which reduces the temperature influence. However, the values of the n T and k T coefficients provided by the manufacturer do not completely fulfill their role, because, during high air temperature, the determined NO 2 concentration turned out to be negative. Therefore, we proposed an additional factor (offset), modifying the corrected WE C voltage. Its role was to react when the temperature exceeds a certain threshold. In the presented analysis, the threshold was determined empirically, observing the temperature above which voltage disturbances appeared on the electrodes, causing a negative concentration.
The result of the application of the proposed coefficient is shown in Figure 6. It shows a significant improvement in the results from Alphasense sensors during periods with high temperatures. First, there were no longer any negative concentrations. Secondly, the corrected values resulted in a significant approximation of the values measured by low-cost sensors to the values determined by the SEM station. This was also reflected in the improved coefficient of determination between the corrected measurement results of the Alphasense sensors and the indications of the SEM stations. The values for the relationships proposed by the manufacturer and after adding the designated offset are presented in Table 8.
The introduced offset did not improve the situation in the remaining period when the temperatures were closer to those recommended by the manufacturer. Taking into account the high correlation of NO 2 Alphasense sensor indications with the concentrations measured in SEM stations, correction functions were determined for both methods recommended by the manufacturer. Their application in the form of Equations (7) and (9) resulted primarily in the improvement in the correlation coefficients, and the reduction in the mean absolute errors and the mean absolute percentage errors. As is presented in Figures 9 and 10, the implementation of the correction function resulted in the improvement in R 2 values as follows: R 2 = 0.39 without correction to R 2 = 0.63 after correction.  (7) and (9) resulted primarily in the improvement in the correlation coefficients, and the reduction in the mean absolute errors and the mean absolute percentage errors. As is presented in Figures 9 and 10, the implementation of the correction function resulted in the improvement in R 2 values as follows: R 2 = 0.39 without correction to R 2 = 0.63 after correction.  Comparable changes (this means-improvement) in R 2 values can be found in other research results [20,30], presenting that the correction formula improved the coefficient of determination between analyzed measurement stations from R 2 = 0.207 to R 2 = 0.709. The  (7) and (9) resulted primarily in the improvement in the correlation coefficients, and the reduction in the mean absolute errors and the mean absolute percentage errors. As is presented in Figures 9 and 10, the implementation of the correction function resulted in the improvement in R 2 values as follows: R 2 = 0.39 without correction to R 2 = 0.63 after correction.  Comparable changes (this means-improvement) in R 2 values can be found in other research results [20,30], presenting that the correction formula improved the coefficient of determination between analyzed measurement stations from R 2 = 0.207 to R 2 = 0.709. The results show also that the sensor's performance is better in the months with lower tem- Comparable changes (this means-improvement) in R 2 values can be found in other research results [20,30], presenting that the correction formula improved the coefficient of determination between analyzed measurement stations from R 2 = 0.207 to R 2 = 0.709. The results show also that the sensor's performance is better in the months with lower temperatures. Although, regardless of the method used-in such months, the correction formula tends to underestimate the measurement values. The opposite trend was visible in other studies. An Alphasense NO 2 sensor was used in calibration research in Beijing China, where the impact of seasonal changes in its performance was observed [31]. Relative bias was growing with the increase in the temperature. The R 2 = 0.76 for measurements conducted in the fall decreased to R 2 = 0.12 in the summer.

Conclusions
Several months of comparative measurements of Alphasense low-cost NO 2 sensors with a professional device in various climatic conditions have shown that using the manufacturer's algorithms, the obtained measurement results are characterized by large measurement errors. It indicated the need to identify factors influencing the measurement values and to mathematically correct the obtained results. In the case of the presented research, the focus was on meteorological factors-air temperature and relative humidity.
Using the collected comparative data, to improve the quality of the measurements, a correction function was proposed that uses raw measurements as well as data on temperature and relative humidity. To verify its effectiveness, several months of comparative measurements were carried out with the use of other sensors and in a different location. This correction function-in many cases-significantly improved the quality of the data. In most cases, after applying the correction, the mean monthly absolute percentage error was reduced to 40-50%. In addition to the reduction in deviations from the actual values, the stabilization of long-term measurement errors was also achieved. Using the original equations recommended by the sensors' manufacturer, the range of long-term percentage measurement errors was over 100%. The application of the proposed methods reduced the range of these errors to approximately 20%.
The achieved improvement in the quality of measurements may significantly expand the potential applications of this type of sensor. The potential area of application is portable devices that can be easily placed in those locations where, for example, there is a suspicion of high concentrations of pollutants.
However, research on Alphasense sensors cannot be considered complete-the analysis requires, for example, a thorough examination of the scale of the increase in measurement errors with time, or the influence of other pollutants. It would also be desirable to place more sensors in more locations and compare the effectiveness of the proposed algorithm with a professional device. This type of analysis can also be found in other research works.