rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
thermistors.cpp
Go to the documentation of this file.
1/**
2 * @file thermistors.cpp
3 *
4 * @date Feb 17, 2013
5 * @author Andrey Belomutskiy, (c) 2012-2020
6 */
7
8/**
9 * http://en.wikipedia.org/wiki/Thermistor
10 * http://en.wikipedia.org/wiki/Steinhart%E2%80%93Hart_equation
11 */
12
13#include "pch.h"
14
15void setDodgeSensor(ThermistorConf *thermistorConf, float pullup) {
16 thermistorConf->config = {-40, 30, 120, 336660, 7550, 390, pullup};
17}
18
19void setAtSensor(ThermistorConf *thermistorConf,
20 float tempLow, float rLow,
21 float tempMid, float rMid,
22 float tempHigh, float rHigh) {
23 thermistorConf->config.tempC_1 = tempLow;
24 thermistorConf->config.resistance_1 = rLow;
25
26 thermistorConf->config.tempC_2 = tempMid;
27 thermistorConf->config.resistance_2 = rMid;
28
29 thermistorConf->config.tempC_3 = tempHigh;
30 thermistorConf->config.resistance_3 = rHigh;
31}
32
34 /**
35 * 18K Ohm @ -20C
36 * 2.1K Ohm @ 24C
37 * 294 Ohm @ 80C
38 * http://www.rexbo.eu/hella/coolant-temperature-sensor-6pt009107121?c=100334&at=3130
39 */
40 thermistorConf->config.tempC_1 = -20;
41 thermistorConf->config.tempC_2 = 23.8889;
42 thermistorConf->config.tempC_3 = 120;
43 thermistorConf->config.resistance_1 = 18000;
44 thermistorConf->config.resistance_2 = 2100;
45 thermistorConf->config.resistance_3 = 100;
46}
47
48
49// todo: better method name?
50// todo: poor API mixes SensorParameters with board bias resistor
51void setCommonNTCSensor(ThermistorConf *thermistorConf, float pullup) {
52 setCommonNTCSensorParameters(thermistorConf);
53 thermistorConf->config.bias_resistor = pullup;
54}
55
56void setGmCltSensor(ThermistorConf *thermistorConf) {
57 thermistorConf->config.tempC_1 = -40;
58 thermistorConf->config.tempC_2 = 40;
59 thermistorConf->config.tempC_3 = 130;
60 thermistorConf->config.resistance_1 = 100'000;
61 thermistorConf->config.resistance_2 = 1459;
62 thermistorConf->config.resistance_3 = 70;
63}
void setCommonNTCSensor(ThermistorConf *thermistorConf, float pullup)
void setAtSensor(ThermistorConf *thermistorConf, float tempLow, float rLow, float tempMid, float rMid, float tempHigh, float rHigh)
void setCommonNTCSensorParameters(ThermistorConf *thermistorConf)
void setGmCltSensor(ThermistorConf *thermistorConf)
void setDodgeSensor(ThermistorConf *thermistorConf, float pullup)