Here is a simulation of the air and coolant temperature sensors using SPICE and KiCAD. All of the heavy lifting for this was done by @cushjbc working out how to use the Steinhart-Hart equations and determining the coefficients for each sensors.

First we need to create a component. For this I use the KiCAD built-in thermistor component and added two additional connections – temperature and ground.

Pins 1 and 2 connect to the thermistor. Pin 3 is TEMP_C and pint 4 is GND.

Place the following into a file called AirTemp.lib:

* D-Jetronic Air Temperature Sensor Model
* Steinhart-Hart Coefficients and formulae by Brad Cushman
* See: http://www.ecircuitcenter.com/Circuits/therm_model1/therm_model1.htm
* Version 1.0 March 2022

.SUBCKT airtemp 1 2 tempc gnd A=0.001806885 B=0.000261256 C=0.000000615

.FUNC tempk() = { (V(tempc,gnd)+273.15) }
.FUNC alpha() = { ((A-(1/tempk()))/C) }
.FUNC beta() = { (SQRT( PWR(B/(3*C),3) + ((alpha() * alpha())/4))) }
.FUNC resistance() = { (EXP(PWR(beta()-(alpha()/2),1/3) - PWR(beta()+(alpha()/2),1/3))) }

ETHERM 1 3 VALUE = { I(VSENSE) * resistance() }
VSENSE 3 2 DC 0

.ENDS

Place the following into a file called CoolantTemp.lib:

* D-Jetronic Coolant Temperature Sensor Model
* Steinhart-Hart Coefficients and formulae by Brad Cushman
* See: http://www.ecircuitcenter.com/Circuits/therm_model1/therm_model1.htm
* Version 1.0 March 2022

.SUBCKT coolanttemp 1 2 tempc gnd A=0.001301733 B=0.000258731 C=0.000000173

.FUNC tempk() = { (V(tempc,gnd)+273.15) }
.FUNC alpha() = { ((A-(1/tempk()))/C) }
.FUNC beta() = { (SQRT( PWR(B/(3*C),3) + ((alpha() * alpha())/4))) }
.FUNC resistance() = { (EXP(PWR(beta()-(alpha()/2),1/3) - PWR(beta()+(alpha()/2),1/3))) }

ETHERM 1 3 VALUE = { I(VSENSE) * resistance() }
VSENSE 3 2 DC 0

.ENDS

Here is my test circuit:

What I want is to be able to vary the temperature over time. SPICE does not know anything about temperature (except for the circuit temperature) so we use voltage to represent temperature. This test circuit ramps the air temperature up from -10C to 40C and ramps the coolant temperature up from -10C to 93C.

Place the pointer on each temperature sensor component, press ‘e’ to edit and click on Edit Spice Model. Go to the Model tab and Choose AirTemp.lib or CoolantTemp.lib and click on OK then OK.

Here is a chart that uses voltage to represent the change in resistance over time of the two temperature sensors. 2.5V equates to 20C temperature for both.

It’s hard to tell but there is a very slight bend to the green line for the air temperature sensor.

Comments are closed

Verified by MonsterInsights