I have to linger on this subject because it is important in how this is done. I have the curves from the manufacturer of this 47K Thermistor. As you can see, it is very non linear.
By adding a resistor we can manage the temperature measurement much better. Note that we now have a fairly linear curve from 0 to 127C.
In the attached Excel work sheet I calculate the current through the voltage divider using 5V as the reference. From the total current, we can calculate the voltage across the 32.4K resistor input to the ADC. Since we have a 12–bit ADC, we have 4096 counts range from 0 to 5V input. We now can create a two column 128 point lookup table in memory that correlates degrees C (0–127) in one column to ADC counts in the other.
One degree C resolution and relative accuracy is all we need to perform the MOSFET case temperature monitoring job. We could compute the temperature by solving a complex simultaneous equation but I elect to do it a fast and easy method of “binary divide and conquer”. It is possible to get the proper temperature by seven tests. The first test pointer is at the half way point in the lookup table of 64 degrees. “Is the lookup value higher or lower than the ADC count?” If higher, add 32 to the pointer. If lower subtract 32 from the pointer. Each test will reduce the power of 2 used to move the test pointer. Within 7 tests the pointer will be at the temperature reading. This algorithm can be done lightning fast in a iterative loop. The Excel spread sheet is attached:
I created a drawing for my test fixture that shows me where to attach the wires on the Starter Kit I/O Expansion Board. We are going to use the SPI channel 1. The drawing shows 332K resistors but I settled on 32.4K as the optimum value.
The little fixture (MCP3202 breadboard) will attach to J10. I hope to get that built tomorrow evening and wired, ready for writing a driver task. I have a logic analyzer and will post waveforms of the data acquisition. The software routine will be instructive on what goes on in a task. We will explore and hopefully enlighten those interested.
For more information: www.hfprojects.com
Signup for the HF SuperPacker Pro V3 by sending an email with your call sign and shipping address. No obligation for this interest list: email@example.com
73 K5OOR – Virgil HF Projects