{'fraction_non_alphanumeric': 0.031610199091861683, 'fraction_numerical': 0.020520433112120155, 'mean_word_length': 4.801925025329281, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Empowering smartphone users with sensor node for air quality measurement

We present an architecture of a sensor node developed for use with smartphones for participatory sensing of air quality in urban environments. Our solution features inexpensive metal-oxide semiconductor gas sensors (MOX) for measurement of CO, O3, NO2 and VOC, along with sensors for ambient temperature and humidity. We focus on our design of sensor interface consisting of power-regulated heater temperature control, and the design of resistance sensing circuit. Accuracy of the sensor interface is characterized. Power consumption of the sensor node is analysed. Preliminary data obtained from the CO gas sensors in laboratory conditions and during the outdoor field-test is shown.


Introduction
Information on air quality in urban environments is typically generated by a limited number of stationary, accurate, but expensive, monitoring stations. In order to increase quality of information, higher spatial resolution of data can be obtained by extending the traditional air quality measurement infrastructure using a larger number of cheap wireless sensor nodes for environmental monitoring. Early designs featuring stationary sensor nodes [1,2], were later extended into heterogeneous networks including mobile nodes mounted to various vehicles [3,4]. Particularly interesting are concepts of participatory sensing, featuring citizens participating in context-aware collection of information. In such designs, sensors typically use smartphones for geo-tagging and relaying information into the web-service accessed by public [5][6][7][8].
Typically, concentrations of atmospheric gasses and pollutants, such as CO, CO 2 , NO 2 , O 3 , SO 2 , and volatile-organic compounds (VOC), are measured, along with temperature, humidity, barometric pressure and particulate matter. Concentrations of most of the mentioned gasses are measured either using passive electrochemical sensors, featuring lower power consumption, but higher prices and shorter life-time [7], or using longer-lasting and lower priced semiconductor metal-oxide (MOX) sensors [8,9]. Requiring heating, minimization of their high power consumption remains an open research topic [10,11].
In this article, we present an architecture of an air quality measurement sensor node featuring MOX gas concentration sensors and Bluetooth communication, designed for integration into smartphone-based participatory sensing system. We focus on sensor interface circuit design featuring a novel heater implementation, enabling further optimization of power consumption spent for heating.

Methods and materials 2.1. Sensor node architecture
We constructed a sensor node for ambient gas sensing, consisting of sensor interface circuitry, signal processing and communication board, and power-supply, as shown in Fig. 1  Signal processing and communication board is adopted from Texas Instruments EZ430-256x development kit [13]. The board contains 16 bit MSP430 microcontroller running FreeRTOS. It controls the following tasks: (1) gas measurement sequence described in detail in Section 2.3, (2) communication, and (3) power management.
Communication is implemented using Ethermind Bluetooth 2.1 stack featuring Serial Port Profile (SPP). A simple request-response application-layer protocol has been developed on top of SPP to enable integration of the sensor node with the AirSense smartphone application for participatory sensing [14]. Physical layer is implemented by CC2560 Bluetooth radio transceiver.
Sensor node is powered from a single-cell Li-Ion battery through a 3.3 V step-down DC/DC switching-mode voltage regulator. Power supply of the sensor interface is controlled by the microcontroller. Radio wake-up functionality allows the microcontroller to spend its idle time in LPM3 low power mode, and to be turned on by radio transceiver only upon receipt of an incoming radio message.

Gas sensor interface
Repeatable temperature regulation of the MOX heater is required, as the sensitivity of the sensing layer depends on its temperature [10,12]. Heater control can be achieved by regulating the heater's electrical power [11]. Provided that the relationship between temperature and electrical power is known [12], we designed the power-regulated heating circuit shown in Fig. 2.
Heating circuit's main component is a programmable DC current source. It is implemented using a TPS61165 step-up DC/DC switching-mode LED driver, sourcing I h through heater R h . Magnitude of I h is adjustable by duty-cycle D of a PWM signal. Current range can be adjusted by the resistor R F B , as defined by equation (1).

Signal acquisition and processing
Gas concentration measurement sequence consists of heating by the arbitrary heating power function P set (t) and measurement of the sensing layer resistance R s , which is then related to the gas concentration. Regulation of heating power to a set-point P set (t) is implemented with PI regulator shown in Fig. 3. Required heating power range is 40 to 100 mW. Actuated variable is duty-cycle (D) of a PWM signal, used for programming the current I h , as defined by (1). In the feedback loop, high-side voltage of the heater U h is measured, and the low-side voltage U F B is approximated from (1). From there an error signal is calculated, as defined by (3). PI regulator is implemented in the software. Frequency of the regulation loop is set to f reg = 50 Hz. Empirically chosen coefficients of K p = 5 * 10 −4 and K i = 1 * 10 −3 have proved suitable to ensure stability of the regulator in the required heating power range.
Repeatability of the temperature settle-point during heating is ensured by correcting the heating power by its ambient temperature equivalent. Temperature is measured using SHT21S temperature and humidity sensor. Humidity compensation can also be performed, but is claimed to have less effect on sensor sensitivity [15]. Drift of the sensing layer resistance after prolonged period of sensor shut-down is minimized by keeping the sensor layer free of contaminants which may have deposited [15]. We address the issue by including an interval of overheating prior to the heating. Hysteresis of the heating characteristic exhibited during measurement repetition is addressed by introducing a cool-down interval after every measurement sequence.

Power consumption
Durations of stationary operating states and their associated mean current consumption at V bat = 4.0 V were measured for MSP430 microcontroller, CC2560 radio chip, and sensor interface board. This enabled construction of power state-machines used for further power consumption modelling. Autonomy was verified by a battery discharge test. Sensor was powered from a single cell Li-Ion 3.6 V, 780 mAh, charged to 4.15 V. Discharge included alternating periods of sleep and periods of polling the sensor from the Bluetooth peer-device with average frequency of 1 / min. Each polling message caused radio wake-up of microcontroller from LPM3 to the active state, and single measurement sequence after which sensor node returned to sleep.
Measurement sequence consisted of 5 s of overheating by maximum power P max , followed by 10 s of heating by nominal power P nom and 1 s of cool-down. Sensing layer resistance was obtained by averaging the R s sampled by f reg during last 2 s to minimize deviations of R s . Such measurement sequence was used in all subsequent tests.

Validation using gas sensors
Preliminary tests with controlled gas concentrations were performed for CO sensors MICS-5121 and MICS-5525, in order to assess relationship of sensing layers' resistance versus: (1) atmospheric concentration of CO, and (2) 100 ppm of CO. Procedure was conducted using Dräger calibration gasses, at gas volume flow of 0.5 L/s, 23 • C and 45 % relative humidity.
The same CO sensors were used in an outdoor test-run performed in Zagreb, Croatia, on 22 nd of March, 2013. Sensor node was fastened to a sleeve of a jacket with a velcro strap, and carried along a 5 km route around the town centre. Concentration of CO, along with ambient temperatures and humidities were measured with temporal frequency of 1 minute and sent to a smartphone AirSense application. GPS tags and timestamps were added by the application, and information was used by the publish/subscribe-based participatory sensing web-service.

Results
Lower power regulation error is exhibited at higher resistor load as lower current needs to be sourced by TPS61165 DC/DC, as verified by Fig. 4. Mean relative error of power regulation of < 0.5 % can be achieved at R h > 60 Ω. Standard deviation is below 0.5 mW for the whole testing range of R h and P h . Mean value of relative error of resistance measurement of < 5% can be expected for R s > 20 kΩ with R ref < 43 kΩ. Upper boundary of measured R s is defined by A/D converter's reference voltage. Standard deviation of resistance measurement error increases roughly linearly with measured R s , being 1.2 kΩ at 20 kΩ, and 2 kΩ at 140 kΩ.
Simplified power state machine showing states contributing the most to sensor node power consumption is depicted in Fig. 6. Mean power consumption in active state is 141-192 mW, depending on the MOX heating power. Consumption in sleep, with microcontroller in LPM3 and radio in the mode enabling wake-up on incoming message, is 9 mW. Results of battery discharge test are depicted in Fig. 7, showing the autonomy of more than 72 hours before battery voltage dropped below 3.3 V. 28 hours of discharge included sensor polling, and 44 were spent in sleep.
Examples of measurements of R s logged throughout the whole heating interval during the test of CO sensors are shown in Fig. 5. Resistances at atmospheric concentration are R 0 = 279 kΩ for MICS-5121 and 129 kΩ for MICS-5525. Sensitivities to 100 ppm of CO, expressed analogously to data in [12], are S 100 = R 100ppm /R 0 = 5.94 and 1.96 for MICS-5121 and MICS-5525, respectively. Drift of atmospheric R 0 after longer period of non-usage is observed.
Assembled sensor node, with battery pack and Samsung Galaxy Mini 2 running AirSense application is shown in Fig 8. Results of outdoor test as seen through web-interface are shown in Fig. 9. Dots indicate GPS locations where sensor data was acquired. Details can be visualized by clicking the dots [14].  Power regulation error in dependency of heating power and heater's resistance.

Conclusion
In this article we have shown our work-in-progress on the sensor node for gas concentration measurement, suitable for integration with smartphone-based participatory sensing of air quality. We have proposed a heating circuitry design featuring power regulator consisting of programmable current source and software-implemented PI regulator. Results have shown that design enables accurate and repeatable setting of heater power (e.g. temperature). This allows us to further explore advanced measurement techniques featuring arbitrary heating power functions P set (t) to optimize total heating energy in order to prolong the sensor autonomy. Also, in future work we plan additional interventions into the design of the resistance sensing circuitry to maximize accuracy throughout the entire range of sensor response R s , exhibiting high-dynamics and non-linearity. Also, drift of R s when sensor is exposed to prolonged periods of non-activity, temperature compensation, and calibration are to be addressed in detail.