calibration of sensors

5
1 Calibration Of Sensors Using Arduino S.Choudhury, S.Kisku, S.Majhi, S.Moharana, A.Raj, S.Sharma , V.Kumar, S.Das Abstract—In this paper we present an efficient calibration technique for low cost sensors based on Arduino codes to reduce the marginal and any arbitrary errors in sensors due to environmental effects and designing defects. Calibration is process of finding a relationship between two unknown (when the measurable quantities are not given a particular value for the amount considered or found comparing with a standard for the quantity) quantities. The different sensors were combined and set up on a single Arduino board to improve accuracy and sensor output. The project consisted of three important sensors- Temperature, Accelerometer and Ultrasonic sensor. Temperature Sensor features a temperature complex with a calibrated digital signal output. Accelerometer is used as a baseline to discern orientation with respect to a given frame of reference. Ultrasonic sensor uses a technique similar to that of SONAR to determine distance of an object from a transmitted signal. The ultrasonic sensor was calibrated using multi-point curve fitting technique after the necessary observations were taken from an experiment using Arduino codes for the sensor. Open source kalman filter code was used for calibration of accelerometer, multiple point curve fitting algorithm was used for calibration of temperature sensor and one-point calibration technique was used for calibra- tion of ultrasonic sensor. (Abstract) Keywordscalibration,ultrasonic,accelerometer,kalman,curve,fitting. I. INTRODUCTION Calibration is a set of operations that under certain con- ditions establish relations between values indicated by a measuring instrument or system, or values represented by a materialised measure or reference material, and values realised by measurement standards. There are a lot of good sensors available and many are ’good enough’ out of the box for many non-critical applications. But in order to achieve the best possible accuracy, a sensor should be calibrated in the system where it will be used. This is because: 1) No sensor is perfect since sample to sample manufactur- ing variations means that even two sensors from the same man- ufacturer production run may yield slightly different readings ,Differences in sensor design mean two different sensors may respond differently in similar conditions. This is especially true of ‘indirect’ sensors that calculate a measurement based on one or more actual measurements of some different, but related parameters,Sensors subject to heat, cold, shock, humidity etc. during storage, shipment and/or assembly may show some variations in response and some sensor technologies ’age’ and their response naturally changes over time - requiring periodic re-calibration 2) The Sensor is only one component in the measurement system,and the reading vary with different variables like in an analog sensors, the ADC is part of the measurement system and subject to variability as well,Temperature measurements are subject to thermal gradients between the sensor and the measurement point,Light and color sensors can be affected by spectral distribution, ambient light, specular reflections and other optical phenomena and inertial sensors are sensitive to alignment with the system being measured. The two most important characteristics of a good sensors are precision-the ability to produce the same output for the same input and resolution-the ability to to reliably detect small changes in the measured parameter. In this paper we wil carry out the calibration of three sensors namely accelerometer-MPU-6050,ultrasonic-HC- SRO4,temperature sensor-LM-35. II. BLOCK DIAGRAM Fig. 1. Block diagram III. CIRCUIT DIAGRAM Fig. 2. Circuit Diagram

Upload: subhrajit-moharana

Post on 13-Jul-2016

22 views

Category:

Documents


8 download

DESCRIPTION

A Measuring Device for temperature,humidity and distance from any object

TRANSCRIPT

Page 1: Calibration of Sensors

1

Calibration Of Sensors Using ArduinoS.Choudhury, S.Kisku, S.Majhi, S.Moharana, A.Raj, S.Sharma , V.Kumar, S.Das

Abstract—In this paper we present an efficient calibrationtechnique for low cost sensors based on Arduino codes toreduce the marginal and any arbitrary errors in sensors dueto environmental effects and designing defects. Calibration isprocess of finding a relationship between two unknown (whenthe measurable quantities are not given a particular value forthe amount considered or found comparing with a standard forthe quantity) quantities. The different sensors were combinedand set up on a single Arduino board to improve accuracy andsensor output. The project consisted of three important sensors-Temperature, Accelerometer and Ultrasonic sensor. TemperatureSensor features a temperature complex with a calibrated digitalsignal output. Accelerometer is used as a baseline to discernorientation with respect to a given frame of reference. Ultrasonicsensor uses a technique similar to that of SONAR to determinedistance of an object from a transmitted signal. The ultrasonicsensor was calibrated using multi-point curve fitting techniqueafter the necessary observations were taken from an experimentusing Arduino codes for the sensor. Open source kalman filtercode was used for calibration of accelerometer, multiple pointcurve fitting algorithm was used for calibration of temperaturesensor and one-point calibration technique was used for calibra-tion of ultrasonic sensor. (Abstract)

Keywords—calibration,ultrasonic,accelerometer,kalman,curve,fitting.

I. INTRODUCTION

Calibration is a set of operations that under certain con-ditions establish relations between values indicated by ameasuring instrument or system, or values represented by amaterialised measure or reference material, and values realisedby measurement standards.

There are a lot of good sensors available and many are ’goodenough’ out of the box for many non-critical applications.But in order to achieve the best possible accuracy, a sensorshould be calibrated in the system where it will be used. Thisis because:

1) No sensor is perfect since sample to sample manufactur-ing variations means that even two sensors from the same man-ufacturer production run may yield slightly different readings,Differences in sensor design mean two different sensors mayrespond differently in similar conditions. This is especially trueof ‘indirect’ sensors that calculate a measurement based on oneor more actual measurements of some different, but relatedparameters,Sensors subject to heat, cold, shock, humidity etc.during storage, shipment and/or assembly may show somevariations in response and some sensor technologies ’age’ andtheir response naturally changes over time - requiring periodicre-calibration

2) The Sensor is only one component in the measurementsystem,and the reading vary with different variables like in ananalog sensors, the ADC is part of the measurement system

and subject to variability as well,Temperature measurementsare subject to thermal gradients between the sensor and themeasurement point,Light and color sensors can be affectedby spectral distribution, ambient light, specular reflections andother optical phenomena and inertial sensors are sensitive toalignment with the system being measured.

The two most important characteristics of a good sensorsare precision-the ability to produce the same output for thesame input and resolution-the ability to to reliably detect smallchanges in the measured parameter.

In this paper we wil carry out the calibration ofthree sensors namely accelerometer-MPU-6050,ultrasonic-HC-SRO4,temperature sensor-LM-35.

II. BLOCK DIAGRAM

Fig. 1. Block diagram

III. CIRCUIT DIAGRAM

Fig. 2. Circuit Diagram

Page 2: Calibration of Sensors

JOURNAL OF CALIBATION OF SENSORS USING ARDUINO, November 2015 2

IV. BASIC CONCEPTS OF CALIBRATIONThe first thing to decide is what the calibration reference

would be like.1.Standard ReferencesIf it is important to get accurate readings in some standard

units, a Standard Reference is needed to calibrate using it asa reference. This can be:

A calibrated sensor - If a sensor or instrument that isknown to be accurate, it can be used to make referencereadings for comparison. Most laboratories have instrumentsthat have been calibrated against NIST standards. These willhave documentation including the specific reference againstwhich they were calibrated, as well as any correction factorsthat need to be applied to the output.

A standard physical reference - Reasonably accurate physi-cal standards can be used as standard references for some typesof sensors like rulers,rangefinders,boiling water,ice water,valueof g.

2.The Characteristic CurveEach sensor will have a ‘characteristic curve’ that defines

the sensor’s response to an input. The calibration process mapsthe sensor’s response to an ideal linear response. How to bestaccomplish that depends on the nature of the characteristiccurve.

V. CALIBRATION PROCEDUREwe will be analysing three calibration techniques one each

for the three sensors used1.Kalman Filter“KALMAN FILTER” is the one of best techniques for

calibration. The calibration of accelerometer MPU6050 is doneby KALMAN filtering algorithm. The raw readings of inputvariable i.e the orientation of the sensor and the output ofthe sensor give the basic variables to be used in the nextcalibration technique i.e the KALMAN process which reducesthe non-linearity of sensor. This is the basic aim of the productto show proper values of different parameters that are to bemeasured.[1]

Initially the bias is zero hence; the error covariance matrixis taken as a null matrix. The covariance noise in observanceis calculated from the observed readings of the sensor withoutthe filter and the observer and the process noise varianceis assumed to be zero. The variable B is also set to zeroas no controlling input is present to change the upcomingreadings. The variable H is set to 1 as the output readingis observed. Now as per KALMAN process defined in theflow chart the error covariance matrix and the Kalman gainis continuously updated with time the sensor starts to givecontinuous readings with an interval which is defined in thecode. The new readings of the sensor after Kalman filteringare almost equal to the real time readings. [5][6][8][9]

FLOWCHART

Department of Electronics and Communication,NIT Rourkela

Page 3: Calibration of Sensors

JOURNAL OF CALIBATION OF SENSORS USING ARDUINO, November 2015 3

Fig. 3. kalman filter flowchart

2.One Point CalibrationOne-point calibration is the simplest type of calibration.

If the sensor output is already scaled to useful measurementunits, a one-point calibration can be used to correct the sensoroffset errors when only one measurement point is needed orthe sensor is known to be linear and has the correct slopeover a desired measurement range.This process can be usedfor calibration of Ultrasonic sensor HC-SR04.[2]-[4]

Fig. 4. Applicability conditions of One point calibration

FLOWCHART

Fig. 5. One point calibration flowchart

3.Multi-Point Curve FittingSensors that are not linear over the measurement range

require some curve-fitting to achieve accurate measurementsover the measurement range. A common case requiringcurve-fitting is thermocouples at extremely hot or cold tem-peratures. While nearly linear over a fairly wide range,they do deviate significantly at extreme temperatures. Thegraphs below show the characteristic curves of high, in-termediate and low temperature sensors. This process canbe used for calibration of Temperature Sensor LM-35.[7]

Fig. 6. Applicability conditions of Multi point curve fitting

Fig. 7. Multi point calibration flowchart

Department of Electronics and Communication,NIT Rourkela

Page 4: Calibration of Sensors

JOURNAL OF CALIBATION OF SENSORS USING ARDUINO, November 2015 4

VI. EXPERIMENTAL RESULTS

The three algorithms were implemented using ARDUINOcodes for calibration of Accelerometer MPU6050,ultrasonicsensor HC-SR04,temperature sensor LM-35. The performanceof the sensors has been clearlyimproved as can be clearly seenfrom the following graphs

Fig. 8. accelerometer calibration plot

It can be clearly noted that the kalman filter provides stabilityto the accelerometer and in case of sudden position or coordi-nate changes,the accelerometer provides accurate readings.

Fig.9. HC-SR04 characteristics plot

As the distance of the target increases the readings of theultrasonic sensor tends to drift from the actual values.Thisdrifting of values can be neutralised using an offset whichis introduced using the one point calibration method.Thecalibrated readings are accurate and sufficiently close to theactual readings through out the measurement range .

Fig. 10. LM-35 characteristics plot

LM-35 temperature sensor shoes non-linear characteris-tics,hence one point calibration cannot be used for calibrationand hence multi point curve fitting has been used,after calcula-tion of regression coefficient for each data entry the calibratedsensor output is the product of non-calibrated output and theregression coefiicient at that data entry.The calibrated valueprovide a better estimate of the actual value than that of thenon-calibrated value.

Fig. 11. Final product

Department of Electronics and Communication,NIT Rourkela

Page 5: Calibration of Sensors

JOURNAL OF CALIBATION OF SENSORS USING ARDUINO, November 2015 5

Fig. 12. Product in Working state

VII. CONCLUSION

Three calibration techniques based on the use of a Arduinomicrocontroller has been presented.Use of each of the abovecalibration techniques has been presented by calibrating ac-celerometers,ultrasonic sensors,temperature sensors.Significantimprovement was noticed in the sensor readings after calibra-tion and the sensors are now ready for any further use.

ACKNOWLEDGMENT

WE would like to thank the Department of Electronics andCommunication, NIT Rourkela as a whole for providing usevery possible help and for providing insights and guidanceon complete topic. We are also thankful to Department ofMechanical Engineer for allowing us to use the Themallaboratary for experimentation. We are also greatly thankfulthat the curriculum has included this lab which helped us geta practical insight and develop innovative ideas.

REFERENCES

[1] [1] Tadej Beravs, Janez Podobnik, and Marko Munih, Member, IEEE“Three-Axial Accelerometer Calibration Using Kalman Filter CovarianceMatrix for Online Estimation of Optimal Sensor Orientation” IEEETRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT,VOL. 61, NO. 9, SEPTEMBER 2012

[2] [2] J. Wang, Y. Liu, and W. Fan, “Design and calibration of a smart iner-tialmeasurement unit for autonomous helicopters using MEMS sensors,”in Proc. IEEE Int. Conf. Mechatron. Autom., 2006, pp. 956–961.

[3] [3] R. Zhu and Z. Zhou, “Calibration of three-dimensional integratedsensors for improved system accuracy,” Sens. Actuators A: Phys., vol.127, no. 2, pp. 340–344, Mar. 2006.

[4] [4] A. Kim and M. Golnaraghi, “Initial calibration of an inertial mea-surement unit using an optical position tracking system,” in Proc. IEEEPLANS, 2004, pp. 96–101.

[5] [5] E. Renk, M. Rizzo, W. Collins, F. Lee, and D. Bernstein, “Calibratinga triaxial accelerometer-magnetometer-using robotic actuation for sensorreorientation during data collection,” IEEE Control Syst. Mag., vol. 25,no. 6, pp. 86–95,

[6] [6] P. Batista, C. Silvestre, P. Oliveira, and B. Cardeira, “Accelerometercalibration and dynamic bias and gravity estimation: Analysis, design,and experimental evaluation,” IEEE Trans. Control Syst. Technol., vol.19, no. 5, pp. 1128–1137, Sep. 2011.

[7] [7] H. Kuga, R. da Fonseca Lopes, and W. Einwoegerer, “Experimentalstatic calibration of an IMU (inertial measurement unit) based onMEMS,” in Proc. XIX COBEM, Brası́lia, DF, Brazil, 2007.

[8] [8] J. Ambadan and Y. Tang, “Sigma-point Kalman filter data assimilationmethods for strongly nonlinear systems,” J. Atmos. Sci., vol. 66, no. 2,pp. 261–285, Feb. 2009.

[9] [9] S. Won and F. Golnaraghi, “A triaxial accelerometer calibrationmethod using a mathematical model,” IEEE Trans. Instrum. Meas., vol.59, no. 8,pp. 2144–2153, Aug. 2010.

Department of Electronics and Communication,NIT Rourkela