I am developing an alogrithm for battery charging. I am using PIC16f685 processor and CCS C compiler for programming. The problem is I am using a NTC(Value 30K) to measure the ambient air temperature inside the battery box. The NTC is used in a voltage divider from 5VDC reference as 30K NTC parallel to 33K 1% SMD resistor in upper arm and 10K 1% SMD resistor in lower arm. The NTC resistor value changes from 108K@0deg to 30k@25deg to 9.79K@50deg to 1.8K@100deg. The equivalent parallel value with 33K changes accordingly and the voltage across 10K which sensed by adc port changes accordingly as 1.42V@0deg to 1.94V@25deg to 2.8V@50deg to 4.28V@100deg. Now I got a voltage wrt temperature and correspounding didgital values are read from adc result register. How can I write code for program to understand 1.94V correspounds to 25deg or a 2.09V correspounds to 30deg celusis. Please help.
I am a newbie in C programming. I thought of a Lookup table array but with the 10bit adc resolution the digital value changes from 290 to 877. How can I implement a lookup tablefor this. or there is any other easy method Pls advice. Also if I measure the ambient temperature inside the battery box and correct the high battery cut off according to that -5mV/Cell/deg c does the battery get properly charged.
I am a newbie in C programming. I thought of a Lookup table array but with the 10bit adc resolution the digital value changes from 290 to 877. How can I implement a lookup tablefor this. or there is any other easy method Pls advice. Also if I measure the ambient temperature inside the battery box and correct the high battery cut off according to that -5mV/Cell/deg c does the battery get properly charged.
Last edited: