-
-
Notifications
You must be signed in to change notification settings - Fork 17
PDB STM
Context Here is a representation of the themistor setup
Problem
The ADC for the temperature sensor takes in voltage from a thermistor. We need to convert this to the temperature. However, different thermistors affect the voltage calculation in different ways relative to the units that are used. For example, during 2022-23's development cycle, the thermistor's temperature coefficient was given in terms of millivolts/degree Celsius. Meanwhile, the 2023-24 thermistor used had its temperature coefficient given in ohms/degree Celsius.
Solution
Actually, this might be a temperature sensor, not a thermistor Example: Insert 2022-2023 thermistor here
Since we know the relationship between volts and Celcius, we can just get the temperature directly from the ADC.
The general equation for converting ADC value (
So, we need to get the parameters of the ADC. The STM boards should have a 12 bit ADC. The thermistor is also powered by a 3.3V source. This means the math to convert the ADC value to voltage will be:
Once we have this, we can just calculate the difference between the ADC voltage and the voltage at a base temperature (
For the 2022-2023 development cycle, the base temperature was 0 degrees celcius, the voltage at that temperature was 0.4V, and the temperature coefficient was 0.0195V/degree Celcius. So, the equation becomes:
Context
Problem
Solution