rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
controllers
sensors
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
15
void
setDodgeSensor
(
ThermistorConf
*thermistorConf,
float
pullup) {
16
thermistorConf->
config
= {-40, 30, 120, 336660, 7550, 390, pullup};
17
}
18
19
void
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
33
void
setCommonNTCSensorParameters
(
ThermistorConf
*thermistorConf) {
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
51
void
setCommonNTCSensor
(
ThermistorConf
*thermistorConf,
float
pullup) {
52
setCommonNTCSensorParameters
(thermistorConf);
53
thermistorConf->
config
.
bias_resistor
= pullup;
54
}
55
56
void
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
}
pch.h
ThermistorConf
Definition
engine_configuration_generated_structures_alphax-2chan.h:530
ThermistorConf::config
thermistor_conf_s config
Definition
engine_configuration_generated_structures_alphax-2chan.h:534
thermistor_conf_s::resistance_2
float resistance_2
Definition
engine_configuration_generated_structures_alphax-2chan.h:481
thermistor_conf_s::resistance_3
float resistance_3
Definition
engine_configuration_generated_structures_alphax-2chan.h:486
thermistor_conf_s::tempC_1
float tempC_1
Definition
engine_configuration_generated_structures_alphax-2chan.h:461
thermistor_conf_s::tempC_3
float tempC_3
Definition
engine_configuration_generated_structures_alphax-2chan.h:471
thermistor_conf_s::tempC_2
float tempC_2
Definition
engine_configuration_generated_structures_alphax-2chan.h:466
thermistor_conf_s::resistance_1
float resistance_1
Definition
engine_configuration_generated_structures_alphax-2chan.h:476
thermistor_conf_s::bias_resistor
float bias_resistor
Definition
engine_configuration_generated_structures_alphax-2chan.h:492
setCommonNTCSensor
void setCommonNTCSensor(ThermistorConf *thermistorConf, float pullup)
Definition
thermistors.cpp:51
setAtSensor
void setAtSensor(ThermistorConf *thermistorConf, float tempLow, float rLow, float tempMid, float rMid, float tempHigh, float rHigh)
Definition
thermistors.cpp:19
setCommonNTCSensorParameters
void setCommonNTCSensorParameters(ThermistorConf *thermistorConf)
Definition
thermistors.cpp:33
setGmCltSensor
void setGmCltSensor(ThermistorConf *thermistorConf)
Definition
thermistors.cpp:56
setDodgeSensor
void setDodgeSensor(ThermistorConf *thermistorConf, float pullup)
Definition
thermistors.cpp:15
Generated on Fri Sep 26 2025 00:10:15 for rusEFI by
1.9.8