TMP36 | Arduino library for the TMP36 that converts the analog
kandi X-RAY | TMP36 Summary
kandi X-RAY | TMP36 Summary
The TMP36 library is a very simple Arduino library that converts the analog values from a TMP36 temperature sensor directly into Celsius and Fahrenheit so you don't have to.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of TMP36
TMP36 Key Features
TMP36 Examples and Code Snippets
Community Discussions
Trending Discussions on TMP36
QUESTION
The Arduino love-o-meter project (present in the starter kit) uses a float
to compute the temperature from the voltage read from the TMP36.
The Arduino Uno microcontroller (ATmega328P) doesn't have any FPU and the computation doesn't have good performance.
How can we improve this computation?
...ANSWER
Answered 2017-Aug-30 at 13:58The cause of bad performance is the usage of floating point values.
I will show how to get rid of it.
First we talk about precision:
- The TMP36 has a range of 500°C (from -50°C to +450°C).
- The analog read works on 10 bits from 0 to 1023 (1024 possible values).
So the precision is 500/1024. Roughly 0.5 °C.
So if we want to code the temperature on an int
, the less significant bit of this int
needs to code for 0.5°C instead of 1°C.
Example:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install TMP36
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page