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
Sensors
  • Technologies
  • More
Sensors
Sensor Forum having a problem with LM35 temperature sensor
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Sensors to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 39 replies
  • Subscribers 336 subscribers
  • Views 1713 views
  • Users 0 members are here
  • sensors
  • arduino ide
  • temperature sensor
  • arduino
  • analog
Related

having a problem with LM35 temperature sensor

samiboutgoulla
samiboutgoulla 2 months ago

Hello, I just started a project with LM35 (temperature sensors) with Arduino, after mounting it on my breadboard I noticed that the values ​​in the serial monitor are inconsistent and vary in a strange way, for example I get 21°, 20°, 22° 24° successively which is impossible I get the same result with 5 different sensors,  even whern i use a heat source the temperature the values vary also in a strange way and I don't know where the problem is can someone help me please? image imageimage

  • Sign in to reply
  • Cancel

Top Replies

  • michaelkellett
    michaelkellett 2 months ago in reply to samiboutgoulla +3
    It looks as if you have no resistor from the output to a negative bias voltage - this means that you will get poor results as the temperature drops towards zero but you can ignore that for now. The sensor…
  • kmikemoo
    kmikemoo 2 months ago +3
    samiboutgoulla You can try one of the circuits below. They are taken from the LM35 datasheet. The capacitance of your breadboard may be impacting your readings. Still... shabaz's video is very compelling…
  • michaelkellett
    michaelkellett 2 months ago in reply to JWx +1
    Good idea but I think he has an external noise problem - let's wait and see ! MK
Parents
  • JWx
    0 JWx 2 months ago

    it seems that for LM35 1 st. C translates to 10mV of output voltage. Considering that (for Atmega) one bit of ADC result at Vref = 5V is about 5mV, typical ADC conversion accuracy is about 1 st.C (2 LSB), with max error of about 2 st. C.

    Maybe switching to internal voltage reference of 1V would bring better accuracy? and adding some Vcc filtering in case when observed variability is caused by Vcc (used as reference) noise? 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • samiboutgoulla
    0 samiboutgoulla 2 months ago in reply to JWx

    how can i do that ?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • JWx
    0 JWx 2 months ago in reply to samiboutgoulla

    docs.arduino.cc/.../

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • JWx
    0 JWx 2 months ago in reply to JWx

    and change 5.0 to the value of the reference in code...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • JWx
    0 JWx 2 months ago in reply to JWx

    and change 5.0 to the value of the reference in code...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • samiboutgoulla
    0 samiboutgoulla 2 months ago in reply to JWx

    can you please do it for me idk how to do it

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • JWx
    0 JWx 2 months ago in reply to JWx

    put 

    analogReference(INTERNAL);

    in setup, then change sensorValue * 5.0 to something like sensorValue * 1.1

    (reference voltage is about 1.1V (min 1V, max 1.2V) - could be measured for better accuracy)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • michaelkellett
    0 michaelkellett 2 months ago in reply to JWx

    Good idea but I think he has an external noise problem  - let's wait and see !

    Slight smile

    MK

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • JWx
    0 JWx 2 months ago in reply to michaelkellett

    yes - with reference of Vcc it is very likely

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • samiboutgoulla
    0 samiboutgoulla 2 months ago in reply to JWx

    i did that but i'm having the same problem imageimage

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • JWx
    0 JWx 2 months ago in reply to samiboutgoulla

    so it seem to be  a noise problem - you can add filtering as mentioned by michaelkellett  and/or average the value read (read several times in sequence and calculate an average of them)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • samiboutgoulla
    0 samiboutgoulla 2 months ago in reply to JWx

    can i use i voltemetre to calculate the real tension from 5v pin and then adjust the calibre in the code ?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • JWx
    0 JWx 2 months ago in reply to samiboutgoulla

    I think that the problem now is more variability than the precise voltage - in other case there would be constant offset from the real temperature not a ever-changing reads. 

    Other things to check would be putting a capacitor between power rails (on the breadboard)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • samiboutgoulla
    0 samiboutgoulla 2 months ago in reply to JWx

    i noticed a thing temperature start decreasing instead on increasing when approching a source of heat

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • samiboutgoulla
    0 samiboutgoulla 2 months ago in reply to JWx

    another thing i approched a lighter to lm35 the tempreature start decreasing , i repeated it many times and the temperature is decreasing for sure 

    • 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