element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Sensor Calibration Problem? Help needed
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 8 replies
  • Answers 2 answers
  • Subscribers 392 subscribers
  • Views 1036 views
  • Users 0 members are here
Related

Sensor Calibration Problem? Help needed

deepankarmaithani
deepankarmaithani over 10 years ago

I have a system which has a arduino, a xbee, a gas sensor ,a temperature sensor and a custom shield which do the power distribution a lippo battery is ued to powers everything. The temperature sensor gives value which is higher than the actual value by 10 to 12 degree.Also the gas sensor reading is higher . But when i power the xbee and arduino from the USB cable and power the rest of the things from the battery the temperature value is correct. I am unable to understand why is this happening.

  • Sign in to reply
  • Cancel

Top Replies

  • neilk
    neilk over 10 years ago in reply to deepankarmaithani +1 suggested
    deepankarmaithani Hi Deepank I don't know the answer to your precise problem, but I can try and shed some light on overall accuracy: If your MAXIMUM temperature is 60 celsius, then your MAXIMUM measured…
  • Robert Peter Oakes
    Robert Peter Oakes over 10 years ago in reply to neilk +1 suggested
    As far as the 5V reference for the UNO, yes it is using the 5V supply and therefore inherently unstable and prone to interference from other things including the CPU itself as it varies its load, coupled…
Parents
  • clem57
    0 clem57 over 10 years ago

    You did not say how you power the Arduino, but imagine this. The power has to dissipate either through a regulator to the processor or to other things as well. If you look at https://en.wikipedia.org/wiki/Voltage_regulator it will mention temperature coefficent which changes based on load. More load less heat near the regulator. Question is the sensor near the regulator? This may affect you. Also temperature sensor needs calibration. See Temperature Sensor Calibration Resources which can be affected by nearby things...

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • deepankarmaithani
    0 deepankarmaithani over 10 years ago in reply to clem57

    Ok let me elaborate more.. The board/shield i am taking about  has a buck converter configuration which drops the voltage of the battery from 11.2v to 9v. this 9v will be used for driving motors.(the issue of incorrect readings persists even when i am not driving the motor).This 9v is then dropped by LDO 1117 regulator. This 5v is supplied to two sensors one of them is a LM35 other i a MQ series gas sensor.  I have a lead that goes from the board to the barrel jack on arduino. the arduino Uno has a xbee shield over it. The sensors are too far from the regulator. After taking into account the 10mv/degree rise and  ADC conversion i got this and the values are fairly near to the actual temperature when the Arduino is powerd using USB which is connected to usb of my comuter. so the algo sould be right.

      temp = analogRead(tempPin);

      temp = temp * 0.48828125;

    Is there any other way to  calibrate LM35?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • neilk
    0 neilk over 10 years ago in reply to deepankarmaithani

    deepankarmaithani Hi Deepankar

     

    for clarification:

     

    What range of temperature are you measuring (hence what range of analog voltage are you working with)?

    How are you defining your analog reference for the ADC?

     

    Neil

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • deepankarmaithani
    0 deepankarmaithani over 10 years ago in reply to neilk

    Hi @Neil Kenyon

    i am measuring temperature of range +55 -+60 degree. I am using 5v as ADC reference voltage.  here is what i did. to find out the step size ,for a 10 bit ADC with 5v as refferenc. stepsize= 5/1024 =0.0048828 = 4.88mV

     

    from data sheet of LM35 we know for every 1 degree C rise  there is increase of  10mv in the output.

    temperature= (analogRead(A0)*4.88mV.)/10mv

    and it should finally be  temperature= analogRead(A0) *0.488



    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • michaelkellett
    0 michaelkellett over 10 years ago in reply to deepankarmaithani

    Can you post a schematic of your system and ideally a photograph as well. It sounds to me as if you may have a common path for some  supply current mixed up with your temperature signal - but without a detailed and accurate schematic it isn't possible to even guess at where it might be.

     

    MK

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • neilk
    0 neilk over 10 years ago in reply to deepankarmaithani

    deepankarmaithani Hi Deepank

     

    I don't know the answer to your precise problem, but I can try and shed some light on overall accuracy:

     

    If your MAXIMUM temperature is 60 celsius, then your MAXIMUM measured voltage is only 600mV

    With the default Analog  Reference Voltage of 5V, you are only using just over 10% of the ADC range.

     

    This link: http://www.arduino.cc/en/Reference/AnalogReference

     

    Explains how you can use the internal Analog Reference Voltage to increase the accuracy of your measurements. I have used the INTERNAL (ie: 1.1V) when working with a UNO - this increases accuracy by a factor of just under 5.

     

    However, note this:

    " After changing the analog reference, the first few readings from analogRead() may not be accurate."

     

    I was initially caught by that problem.

     

    Finally - and sticking my neck out here -  is it possible that the Vcc derived from USB power and the Vcc derived from the power jack have slightly different values - but still within spec.? If so, how might that impact on the default 5V ADC reference? Perhaps someone else in the community knows the answer.....

     

    Hope this helps

     

    Neil

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 10 years ago in reply to neilk

    As far as the 5V reference for the UNO, yes it is using the 5V supply and therefore inherently unstable and prone to interference from other things including the CPU itself as it varies its load, coupled with the fact that USB is rarely 5V and can be as low as 4 it should be relegated to experimenting only.

     

    Switching to the internal BandGap 1.1V reference will increase the resolution of your measurements but should not be confused with accuracy. Im not sure how accurate the BandGap reference is but that plus the base accuracy of the ADC and then the tolerances of the sensor all together will define your accuracy and linearity.

     

    In most cases ADCs don't need to be accurate, nor does the VRef. But they do need to be stable over temperature, time, load and supply changes. The rest can be compensated for in software.

     

    Neil is correct in suggesting the 1.1V Internal reference though as it will increase your resolution to ~1mV instead of ~5mV and as the band gap is more stable than the supply it will provide more consistent readings over time (It will mostly ignore the changes to running the CPU on 5V vs 4V for instance).

     

    If you want to increase the resolution even further then (As you dont need fast samples per second) you can try over sampling where you take say 16 measurements, add them all together and then shift the bits 2 bits to the right. This will increase your effective resolution to 12Bits instead of 10 (300uV instead of 1mV) resulting in a resolution of 0.03dec C per ADC count.

     

    you can read all about over sampling here:- http://www.atmel.com/images/doc8003.pdf

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Reply
  • Robert Peter Oakes
    0 Robert Peter Oakes over 10 years ago in reply to neilk

    As far as the 5V reference for the UNO, yes it is using the 5V supply and therefore inherently unstable and prone to interference from other things including the CPU itself as it varies its load, coupled with the fact that USB is rarely 5V and can be as low as 4 it should be relegated to experimenting only.

     

    Switching to the internal BandGap 1.1V reference will increase the resolution of your measurements but should not be confused with accuracy. Im not sure how accurate the BandGap reference is but that plus the base accuracy of the ADC and then the tolerances of the sensor all together will define your accuracy and linearity.

     

    In most cases ADCs don't need to be accurate, nor does the VRef. But they do need to be stable over temperature, time, load and supply changes. The rest can be compensated for in software.

     

    Neil is correct in suggesting the 1.1V Internal reference though as it will increase your resolution to ~1mV instead of ~5mV and as the band gap is more stable than the supply it will provide more consistent readings over time (It will mostly ignore the changes to running the CPU on 5V vs 4V for instance).

     

    If you want to increase the resolution even further then (As you dont need fast samples per second) you can try over sampling where you take say 16 measurements, add them all together and then shift the bits 2 bits to the right. This will increase your effective resolution to 12Bits instead of 10 (300uV instead of 1mV) resulting in a resolution of 0.03dec C per ADC count.

     

    you can read all about over sampling here:- http://www.atmel.com/images/doc8003.pdf

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Children
  • deepankarmaithani
    0 deepankarmaithani over 10 years ago in reply to Robert Peter Oakes

    Thanks everyone ,I will incorporate the suggestions tomorrow and will get back to you. I think this should solve my issue

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube