Sensor Characteristics

The sensor is a transducer that converts a physical property into an electrical signal. The physical property can be Weight, Temperature, Pressure, Percentage Composition, Force, Electric or Magnetic or Electromagnetic, Position and Orientation, etc.

The sensors are classified as active sensors and passive sensors based on their working principle. The active sensors use an external or self-generated signal to measure. For example, RADAR emits a series of intense radio waves for a short time and waits for the radio waves or signal to return and calculate the distance of the distant object using the signal flight time. The passive sensors work by changing their electrical properties like resistance or capacitance based on the physical property. For example, an LDR changes its resistance based on the intensity of light.

Sensors must have the following significant properties to define the quality of a sensor:


Every sensor has a range in which they work with an acceptable error. If the input is not in range, then the output is unpredictable.


The signal level varies for the same input over a long period; this is called as drift. The drift will cause an error in the measured value. The drift may result from aging of the sensor or temperature variance.


Sensitivity is defined as the change in output per unit change in input of the property being measured. The sensitivity of the sensor may be constant or linear for the entire range of sensor or vary exponentially if the sensor is a non-linear sensor


Selectivity is the ability of the sensor to measure a target property in the presence of other properties. For example, if an oxygen sensor does not react to other gasses like CO2 then it has good selectivity.


The resolution of a sensor is the minimum change in the target property that can produce a detectable change in output. For example, consider a temperature sensor with a resolution of 1C; this temperature sensor cannot produce a different output for 0.1C change in input.

Response and Recovery Time

The response time is the time taken by the sensor for its output to reach 95% of its final value when it is exposed to a target material. The Recovery Time is defined conversely.


If the sensitivity of the sensor is constant for the range, then it is called as linearity of the sensor. The linear sensors are easier to use while the non-linear sensors require complex mathematical equations to measure the physical property.


The hysteresis is the characteristic of a sensor by which the sensor produces a different set of outputs if the data is recorded in different directions (increasing input or decreasing input). The hysteresis can be observed in the following figure:



If a meaningful measurement is to be made, it is necessary to tune the output of the sensor with accurately known input.

Full-Scale Output

The full-scale output is the difference between the output for maximum input and the output for minimum input. Based on this, the ADC’s reference voltages have to be selected properly.


The precision of a sensor is its ability to produce same output when repeatedly measured for the same input. The precision is determined using statistical analysis standard deviation.


The accuracy of a sensor defines how close the output is to the real value. The accuracy defines the maximum error the sensor may produce.

sensor-characteristics Accuracy


Working with MQ2 Gas Sensor


The MQ-2 Gas Sensor module detects gas leakage in home and industry. The MQ series of gas sensors use a small heater inside with an electrochemical sensor. They are sensitive to a range of gasses and are used indoors at room temperature. The output is an analog signal and can be read with an analog input of the Arduino.


  1. Wide detecting scope
  2. High sensitivity and fast response
  3. Long life and stable
  4. Simple drive circuit


Due to its fast response time and high sensitivity, measurements can be taken as soon as possible. The sensor sensitivity can be adjusted by using the potentiometer.


They are useful in gas leakage detection of LPG, propane, methane, i-butane, alcohol, Hydrogen, and smoke.

Working Principle

The MQ2 has an electrochemical sensor, which changes its resistance for different concentrations of varied gasses. The sensor is connected in series with a variable resistor to form a voltage divider circuit (Fig 1), and the variable resistor is used to change sensitivity. When one of the above gaseous elements comes in contact with the sensor after heating, the sensor’s resistance change. The change in the resistance changes the voltage across the sensor, and this voltage can be read by a microcontroller. The voltage value can be used to find the resistance of the sensor by knowing the reference voltage and the other resistor’s resistance. The sensor has different sensitivity for different types of gasses. The sensitivity characteristic curve (Fig 2) is shown below for the different type of gasses.





1. Ro is the resistance of the sensor in clean air

2. Rs is the resistance of sensor when exposed to gasses

Procedure to Calculate the Concentration of a Particular Type of Gas

To find the concentration of gas, two values has to be measured using a microcontroller with ADC such as Arduino,

1. Ro – The resistance of the sensor when measured in clean air,

2. Rs – The resistance of the sensor when it is exposed to any of the mentioned gasses

To find Ro, connect the sensor to one of the Analog pins of Arduino, note 100 values, and select the median value. This will reduce if any dynamic errors present in the values. The sensor is connected in the series with a variable resistor (Potentiometer on the sensor board). So, to find the resistance of the sensor (Ro or Rs), the resistance of the variable resistor (R1) is required. In most of the MQ2 sensor modules, any one end of the potentiometer and the middle pin of potentiometer will be connected between Sig or Vout Pin and Ground. Find the resistance of R1 using a multimeter and note it down.

The voltage across the sensor Vs (Vs is Vo in Clean Air) is calculated by using the following formula:

Vs=VRef – ADC_Value * (VRefH-VRefL)/(2R)


VRefH is the higher Reference voltage of the ADC, in Arduino, it is usually 5V or 3.3V

VRefL is the lower reference voltage of the ADC, in Arduino, it is usually 0V

R is the resolution of the ADC, in most of the Arduino boards, it is 10 Bits

Once the voltage across the sensor and value of R1 is known, the resistance of the sensor can be calculated by using the formula

Ro=R1 Vo/ (VRef-Vo)

Where Vo is the voltage across the sensor in clean Air

Similarly, the Resistance of the sensor when exposed to gas can be calculated by repeating the above steps and using the formula

Rs=R1 Vs / (VRef-Vs)

Where Vs is the voltage across the sensor in the Air contaminated with LPG molecules

Note: The value of R1 is only for finding the value of Rs and Ro. For finding the concentration of gas, R1 is not required as the concentration is dependent on the Rs/Ro ratio. R1 is not required for finding just the ratio.

Finding the Concentration of a Gas

The concentration of a gas can be calculated by measuring the sensor’s Ro and Rs values and using the following formula

Concentration = Xo (Y/ Yo) Φ

Where Φ is the slope, which can be found using the Sensitivity Characteristic curve and the following formula

Φ = Log (Y2/Y1) / Log(X2/X1)

Where (X2, Y2) and (X1, Y1) are any two points on a section (lines between indicated points on the curve) of the curve. Since the curve has different slopes at different concentrations the (X2, Y2) and (X1, Y1) values should be taken from the corresponding sections

The Xo and Yo values are Initial Concentration and Rs/Ro ratio on a section of the curve (lines between marked points), these values are the starting points of each section (each line between marked points has different slopes)

Y is the Rs/Ro Ratio for the current concentration of the gas

The Arduino code can be found in the below link

To find Ro (Resistance of Sensor in clean air), just run the code in clean air for few minutes (for Accurate values, run it for 24 hours) and note down the resistance in the serial monitor.