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

Python RTD not giving correct readings #17

Open
Alexander-Mundy opened this issue Aug 4, 2024 · 1 comment
Open

Python RTD not giving correct readings #17

Alexander-Mundy opened this issue Aug 4, 2024 · 1 comment

Comments

@Alexander-Mundy
Copy link

Alexander-Mundy commented Aug 4, 2024

Using the example python code, installing the 0 ohm resistors, and removing the COM/AVSS jumper as instructed results in incorrect resistance readings.
I thought at first that I might have done something wrong while soldering, however I tried a different board and got the same results.
I metered all soldered connections on both boards. Both boards consistently give readings that are too high but not a straight multiplier or subtraction. Using resistors checked for true resistance the readings are off by:
True resistance = Reported resistance by HAT * 0.83565 - 60.25
I verified by inserting into the code in main.py between lines 82 and 83:
RES = RES * 0.83565 - 60.25
I then put a beaker of ice water on a heated magnetic stirrer from 0.5C to 98.8C (boiling at my elevation and barometric pressure)
The reported adjusted temperature agreed with the RTD of the stirrer probe within 0.25C.

@Alexander-Mundy
Copy link
Author

Alexander-Mundy commented Aug 14, 2024

So I figured out what is wrong with the code.
In ADS1263.py line 264 the Mode 1 Register is set to 0x84 which puts it in FIR filter mode, sets the Sensor Bias Magnitude to 50uA, connects Sensor bias to ADC1 mux out, and Sensor Bias Polarity to pull up mode.
The 50uA Sensor Bias unbalances the 250uA IDACMAG IDAC1 & IDAC2 settings at line 504 that biases the RTD sensor and Rref resistor.
Adding the following line in "def ADS1263_RTD_Test(self):" results in the correct RTD resistance and temperature:
self.ADS1263_WriteReg(ADS1263_REG['REG_MODE1']. 0x80)
This puts it in FIR filter mode, sets the Sensor Bias Magnitude to none instead of 50uA, connects Sensor bias to ADC1 mux out, and Sensor Bias Polarity to pull up mode.
One could change line 264 to 0x80 instead of 0x84, but that would leave the MUX inputs for reading ADC values floating when doing ADC readings.

I am very surprised that no one has brought this coding error up because the RTD readings are so far off with the example code.

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

1 participant