Fix formular to work on NEG side instead of POS for NTC sensor for aurdino C++
Budget: $10 – $30 USD
I am using a git library for NTC sensor however the board I have has it on the neg side instead of the pos side. so if some one can fix this code to work the other way. Let me know if u want the git link.
double Thermistor::adcToK(double adc) const {
double resistance = -1.0 * (_analogReference * _seriesResistor * adc) / (_analogReference * adc - _vcc * _adcMax);
double steinhart = (1.0 / (_temperatureNominal - ABS_ZERO)) + (1.0 / _bCoef) * log(resistance / _thermistorNominal);
double kelvin = 1.0 / steinhart;
return kelvin;
}
double Thermistor::adcToK(double adc) const {
double resistance = -1.0 * (_analogReference * _seriesResistor * adc) / (_analogReference * adc - _vcc * _adcMax);
double steinhart = (1.0 / (_temperatureNominal - ABS_ZERO)) + (1.0 / _bCoef) * log(resistance / _thermistorNominal);
double kelvin = 1.0 / steinhart;
return kelvin;
}