TMP36 | A library to read the TMP36 analog temperature sensor
kandi X-RAY | TMP36 Summary
kandi X-RAY | TMP36 Summary
TMP36 Interface Library Derek Chafin September 14, 2011 Public Domain Code. An arduino library to read the TMP36 analog temperature sensor from adafruit.com. The library takes the raw input from the sensor and outputs the temperature in Celsius and Farenheight.
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
You can use TMP36 like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the TMP36 component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
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