Skip to content

Feature/thermistor#69

Merged
finger563 merged 3 commits intomainfrom
feature/thermistor
Jun 8, 2023
Merged

Feature/thermistor#69
finger563 merged 3 commits intomainfrom
feature/thermistor

Conversation

@finger563
Copy link
Contributor

@finger563 finger563 commented Jun 8, 2023

Description

  • Added thermistor component with example for NTC
  • Updated and rebuilt docs
  • Updated CI

Motivation and Context

Thermistors (temperature sensitive resistors) are cheap, common, and useful tools for measuring the temperature of the circuit or its surroundings. Conversion from the measured voltage across the resistor to the actual temperature requires the implementation of the Steinhart-Hart equation to compute the temperature as a function of the log of the measured resistance proportional to the nominal resistance. This requires the use of a ln() function (for which we already have a fast_ln() implementation in the math component) as well as storing some information about the thermistor and the circuit it is in (such as the voltage divider configuration, supply voltage, nominal resistance, fixed resistance, and beta value). This component / class stores those information in a way that makes it much easier / cleaner to measure the temperature using a thermistor.

How has this been tested?

Running the new example on an TinyPico (ESP32) board. I don't have an NTC on hand, so the main part of the example that tests is the comparison to the manually entered table from the datasheet. To check our calculated temperature vs. the datasheet.

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

Note: I didn't have an NTC to connect to the ADC, so it's not able to read actual temperature in the screenshot below.
CleanShot 2023-06-08 at 09 26 27

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

finger563 added 3 commits June 8, 2023 09:27
* Added thermistor component with example for NTC
* Updated and rebuilt docs
* Added image to readme
@finger563 finger563 added enhancement New feature or request sensors thermistor labels Jun 8, 2023
@finger563 finger563 merged commit fd649ec into main Jun 8, 2023
@finger563 finger563 deleted the feature/thermistor branch June 8, 2023 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant