I did as described above, I swapped out the Rical resistors for know values and converted some of the temperatures to UR values.
I need to get an 80 Ohm resistor to make it go up to 1000°C accurately.
The sensor will always regulate towards 780°C, but the below conceptual code can be used to estimate the temperature. If the sensor is exposed to temperatures over 780°C it will drift faster in my experience.
Code: Select all
/*
Example code to estimate sensor temperature of the Bosch LSU 4.9
Copyright (C) 2020 Bylund Automotive AB.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Contact information of author:
http://www.bylund-automotive.com/
info@bylund-automotive.com
*/
//Sensor Temperature Conversion Lookup Table. (ADC 100-870).
const PROGMEM int Temp_Conversion[771] {
909, 907, 905, 903, 900, 898, 896, 894, 892, 890, 888, 886, 884, 882, 880, 878, 876, 874, 872, 870, 868, 866, 864, 862, 861, 859, 857, 855,
853, 851, 849, 848, 846, 844, 842, 841, 839, 837, 835, 834, 832, 830, 829, 827, 825, 824, 822, 820, 819, 817, 815, 814, 812, 811, 809, 808,
806, 804, 803, 801, 800, 798, 797, 796, 794, 793, 791, 790, 788, 787, 786, 784, 783, 781, 780, 779, 777, 776, 775, 773, 772, 771, 769, 768,
767, 766, 764, 763, 762, 761, 759, 758, 757, 756, 755, 754, 752, 751, 750, 749, 748, 747, 746, 745, 743, 742, 741, 740, 739, 738, 737, 736,
735, 734, 733, 732, 731, 730, 729, 728, 727, 726, 725, 724, 723, 722, 721, 721, 720, 719, 718, 717, 716, 715, 714, 714, 713, 712, 711, 710,
710, 709, 708, 707, 706, 706, 705, 704, 703, 703, 702, 701, 700, 700, 699, 698, 698, 697, 696, 695, 695, 694, 693, 693, 692, 692, 691, 690,
690, 689, 688, 688, 687, 687, 686, 685, 685, 684, 684, 683, 683, 682, 682, 681, 681, 680, 679, 679, 678, 678, 677, 677, 676, 676, 676, 675,
675, 674, 674, 673, 673, 672, 672, 672, 671, 671, 670, 670, 669, 669, 669, 668, 668, 668, 667, 667, 666, 666, 666, 665, 665, 665, 664, 664,
664, 663, 663, 663, 662, 662, 662, 661, 661, 661, 661, 660, 660, 660, 659, 659, 659, 659, 658, 658, 658, 658, 657, 657, 657, 657, 656, 656,
656, 656, 655, 655, 655, 655, 655, 654, 654, 654, 654, 654, 653, 653, 653, 653, 653, 652, 652, 652, 652, 652, 652, 651, 651, 651, 651, 651,
651, 650, 650, 650, 650, 650, 650, 650, 649, 649, 649, 649, 649, 649, 649, 649, 648, 648, 648, 648, 648, 648, 648, 648, 647, 647, 647, 647,
647, 647, 647, 647, 647, 647, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 644,
644, 644, 644, 644, 644, 644, 644, 644, 644, 644, 643, 643, 643, 643, 643, 643, 643, 643, 643, 643, 642, 642, 642, 642, 642, 642, 642, 642,
642, 642, 641, 641, 641, 641, 641, 641, 641, 641, 641, 641, 640, 640, 640, 640, 640, 640, 640, 640, 639, 639, 639, 639, 639, 639, 639, 638,
638, 638, 638, 638, 638, 638, 637, 637, 637, 637, 637, 637, 636, 636, 636, 636, 636, 636, 635, 635, 635, 635, 635, 634, 634, 634, 634, 633,
633, 633, 633, 633, 632, 632, 632, 632, 631, 631, 631, 631, 630, 630, 630, 629, 629, 629, 629, 628, 628, 628, 627, 627, 627, 626, 626, 626,
625, 625, 625, 624, 624, 624, 623, 623, 623, 622, 622, 621, 621, 621, 620, 620, 619, 619, 619, 618, 618, 617, 617, 616, 616, 615, 615, 614,
614, 613, 613, 612, 612, 611, 611, 610, 610, 609, 609, 608, 608, 607, 606, 606, 605, 605, 604, 603, 603, 602, 602, 601, 600, 600, 599, 598,
598, 597, 596, 596, 595, 594, 593, 593, 592, 591, 591, 590, 589, 588, 587, 587, 586, 585, 584, 583, 583, 582, 581, 580, 579, 578, 577, 577,
576, 575, 574, 573, 572, 571, 570, 569, 568, 567, 566, 565, 564, 563, 562, 561, 560, 559, 558, 557, 556, 555, 554, 553, 552, 550, 549, 548,
547, 546, 545, 543, 542, 541, 540, 539, 537, 536, 535, 534, 532, 531, 530, 528, 527, 526, 525, 523, 522, 520, 519, 518, 516, 515, 513, 512,
511, 509, 508, 506, 505, 503, 502, 500, 499, 497, 495, 494, 492, 491, 489, 488, 486, 484, 483, 481, 479, 478, 476, 474, 472, 471, 469, 467,
465, 464, 462, 460, 458, 456, 455, 453, 451, 449, 447, 445, 443, 441, 439, 437, 435, 433, 431, 429, 427, 425, 423, 421, 419, 417, 415, 413,
411, 408, 406, 404, 402, 400, 397, 395, 393, 391, 388, 386, 384, 382, 379, 377, 374, 372, 370, 367, 365, 362, 360, 358, 355, 353, 350, 348,
345, 342, 340, 337, 335, 332, 329, 327, 324, 321, 319, 316, 313, 311, 308, 305, 302, 300, 297, 294, 291, 288, 285, 282, 279, 277, 274, 271,
268, 265, 262, 259, 256, 253, 249, 246, 243, 240, 237, 234, 231, 228, 224, 221, 218, 215, 211, 208, 205, 201, 198, 195, 191, 188, 185, 181,
178, 174, 171, 167, 164, 160, 157, 153, 149, 146, 142, 139, 135, 131, 128, 124, 120, 116, 113, 109, 105, 101, 97, 93, 90, 86, 82, 78, 74, 70,
66, 62, 58, 54, 50, 46, 42, 37, 33, 29, 25, 21, 17
};
//Lookup Sensor Temperature.
int Lookup_Temperature(int Input_ADC) {
//Declare and set default return value.
int SENSOR_TEMPERATURE = 0;
//Validate ADC range for lookup table.
if (Input_ADC > 870) Input_ADC = 870;
if (Input_ADC < 100) Input_ADC = 100;
SENSOR_TEMPERATURE = pgm_read_word(Temp_Conversion + (Input_ADC - 100));
//Return value.
return SENSOR_TEMPERATURE;
}
Note that this is to be considered experimental.