Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code is wrong #8

Open
saltydog693 opened this issue Mar 30, 2020 · 3 comments
Open

Code is wrong #8

saltydog693 opened this issue Mar 30, 2020 · 3 comments

Comments

@saltydog693
Copy link

When you heat up the thermistor you will see the temperature dropping in the serial monitor? It should be the other way around. Checking the library source code (thermistor.cpp) on the calculations we found a mistake in the calculation of the resistance.

100 // convert the value to resistance
101 average = ADC_RESOLUTION / average - 1;
102 average = serialResistance * average;

We had to correct line 102 as below (times should be divided!).

100 // convert the value to resistance
101 average = ADC_RESOLUTION / average - 1;
102 average = serialResistance / average;

Now the code works as it should be.

@dberenguer
Copy link
Contributor

dberenguer commented Mar 31, 2020 via email

@tablatronix
Copy link

Perhaps a good feature would be to add and inverting flag

@LDighera
Copy link

This is useful information.
With a Seeedunio XIAO, pin voltage is limited to 3.3V max, so using 5V on the divider circuit to increase resolution, and connecting the thermistor to GND prevents exceeding maximum rating when thermistor resistance value decreases.

Many thanks for the support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants