Simulate network using NTC thermistors,

Hello all,
I want to add a small modification to my remote temperature controller. Inside the box a network resistor using 3 1% resistors and one NTC thermistor.
Circuit is like this :


Before any modification I want to simulate the actual circuit and I don’t know how to introduce temperature variations into the simulation. By default at 20°C le voltage across the network is around 3.3V if I put finger on the NTC (temperature increase) then the voltage decrease under 2.7V.
Any ideas are welcome !
Thanks.

You will need a spice model for the thermistor.

A first approach would be to use a resistor model with tc1 and tc2 temperature coefficients. See chapter ‘3.3.3 Semiconductor Resistor Model R’ of the ngspice manual. Then you can do a dc sweep with temperature as the swept variable, like

.dc TEMP -15 75 5

If you want to delve more deeply into electrothermal simulation, please have a look at the tutorial http://ngspice.sourceforge.net/ngspice-electrothermal-tutorial.html .

1 Like

Hello and thanks @holger for the link, very interesting !

I have made an update to the tutorial, see http://ngspice.sourceforge.net/ngspice-electrothermal-tutorial.html#app2 .

If you attach a resistor as given below to your thermistor symbol (probably by putting the complete
2 tc1=1e-2 tc2=1e-4 dtemp={deltaT}
into the resistor value field, I did not check with Eeschema), you might get the required temperature dependency with a simple quadratic model. Of course tc1 and tc2 have to be determined according to your thermistor data sheet.

* resistor temperature dependency
.param deltaT = 20

V1 1 0 1
R1 1 0 2 tc1=1e-2 tc2=1e-4 dtemp={deltaT}

.op

.control
run
print i(V1)
.endc

.end
2 Likes

Thank you @Holger for details. I’m not sure (sorry) to understand everything.
I’m not comfortable with the simulation, but I’m trying to do my best. Thanks again.
My project, which is simple and to be able to mink one of my electric heating probes that drives a 2-zone clock.
Each zone captures the temperature with the circuit described above. I do not know the exact characteristics of the NTC but I guess it’s a standard component of trade.
My goal is to add, via a switch, a resistance to reduce or increase the capture value of 3 or 4 ° C so as not to change the setpoint on the clock.
I guess the parallel torque of the NTC and a resistance of 1Mo to 1% 1 / 4W and made to stabilize the temperature measurement.
On the other hand, I did not disassemble the clock, but I guess the network of resistance and NTC are droved in current? The resulting voltage measurement must be compared to the setpoint for on or off the heating radiors Electrical.
In my case, and as I have holes on the PCB I can not add another parallel resistance with the R1 resistance of 24.9k as imagined here:


But not sure is the best ?
what do you think ?
Thanks.

It’s a little confusing on what you’re trying to ask. Do you need help simulating your circuit or help reverse engineering your NTC or help designing your circuit? Looks like you found an exponential relationship for the NTC. Careful though, you might need extra parenthesis around the temp+273 to get the correct order of operations.

Another thing to be careful about is that the 1M gets interpreted by SPICE as 1milliohm. You need to put 1meg or use the checkbox in the Simulator settings window which auto-corrects it for you.

Hello @Ste and thank you for joining the discussion.
In fact I take this opportunity to practice use in the KiCad simulation tool a temperature sensor (which I believe is of exponential type).
I did not do the reverse engineering of the clock, I just want to see if by adding a resistor in the current probe I could (easily) increase the set temperature without reprogramming the main clock.
In the current schematic I took a type of commercial sensor that physically seems the one on the PCB.
Here you can see the possibility to add a potentiometer on the top :

It’s just to validate the simulation, in real life is the value of R4 that will fix the temperature offset.
I correct the parenthesis as well as the 1 Meg resistor value !!!
Thank you.

OK. So do you already have the required value for R4? or are you attempting to model this circuit in the simulator so you can play around with values until you get what you want in the simulator…and then install the value in the real clock to validate it works in real life and matches your simulation?

Yes, partly, I think P1 with 470K (linear for the potentiometer) plus a 510 K for R4 in parallel to R1 as here:

OK, then…what’s the problem? Are you having trouble getting the simulation to run? Do you get error messages?


Like I said before, your parenthesis don’t seem to match the yellow equation you have at the top of the screen. You have:
R=100K*exp(3977*(1/temp+273)-1/298))

but I believe you want:
R=100K*exp(3977*(1/(temp+273))-1/298))

They are not the same equations. I’m not sure what’s intended so I can’t say for sure which you want.

From an analysis of what the factors in the formula represent, it is evident that what he wants is the lower version with the additional brackets (temp+273).

R=100K*exp(3977*(1/(temp+273)-1/298))

Just a small remark:
The variable name for accessing the temperature in a behavioral model is not ‘temp’, but ‘temper’ (due to some compatibility issues). So you might write

R=100K*exp(3977*(1/(temper+273))-1/298))

1 Like

Hello and thank you all for your support.
I corrected and replace the pot with a fixed resistance R5. When starting the simulation, I do not see the NTC (TEMPER) variation, there is probably a parameter.
New schematic:


Simulation:

the Kicad files :
Thermal_R_Sim.kicad_pro (5.1 KB) Thermal_R_Sim.kicad_sch (27.8 KB)

Please check your files which seem to describe a different setup and circuit.

Hi all.
Back on the subject. To simplify the understanding of the variation of the NTC I simplified the schematic.


A source V1 representing what the clock provides is set to 3.3V @20°C. I took a trade varistance with a Beta constant of 3977 for a value of 100K @25°C.
So, R = Ro exp( Beta/T - Beta/To) with Ro=100K, To=25°C and T=Actual Temp
R = 100000 * exp((3977/17+273)-(3977/25+273))
R = 100000 * exp(0.37)
R = 100000 * 1.44773 = 144770 or 144K.
The progression would be 44K for a delta in temperature of 5°C.
The plot of the set does not give the expected result:

What is needed (wrong)?
How do we change the values of the axes to display a resistance according to a temperature?

Thank you

Hi @holger on chapter 1.3 of the ngspice-35-manual page 40, .TEMP is used instead of “temper” I’m confusing ?

It is not instead, but in addition to.

.temp 40
is used to set the overall temperature for all devices (to 40 C in this example). You may also use
.option temp=40
for the same purpose.
Temper however is used to access the current temperature (default 27 C, as set above, or set in a dc sweep) inside of an equation, e,g, for the B source or behavioral R, C, L, E, G like
Blintemp 1 0 V='2*Temper'
or
Rsquaretemp 2 0 R ='TEMPER*TEMPER + 2'

Hi and thanks @holger for this precisions.
I’ve tested this.
First I put this text on schematic : .option temp=45 this modify default temp from 27 to 45°C.
Test2
Then I add this text on schematic : .temp 40
Test1
This afect the simultion by overwriting the temp from 45 to 40°C.
At the end adding a text on schematic : .temp 15 28 1
Test3
The Temp is set to 15°C but no information about End and Step ?
Is there a way to display this variation somewhere ?

There is no temperature variations with the command .temp. It sets a single temperature only (the first in your list).

For sweeping the temperature, use
.dc TEMP 15 28 1