Languages

CommunityCategory: XMODELModeling a BJT-based temperature sensor circuit

XMODEL

Modeling a BJT-based temperature sensor circuit

SA Support Team Staff 2023-04-30

Is it possible to model a BJT-based temperature sensor circuit in XMODEL? Specifically, I need to model a circuit that relies on the base-emitter voltage (VBE) of a BJT changing with temperature.

1 Answers
SA Support Team Staff 2023-04-30

XMODEL 2023.05 Release added 'npn' and 'pnp' primitives, which model NPN-type and PNP-type bipolar junction transistors (BJTs), respectively. And the characteristics of these primitives change with temperature. Namely, the thermal voltage (VT) and transport saturation current (IS) of these primitives change with the absolute temperature (T) as VT = kT/q and IS ∝ exp(-VG0/VT), where VG0 is 1.205V. You can set the temperature value in Celsius using the 'xreal_to_temp' or 'real_to_temp' primitives.

A model & testbench named 'tb_vbe_vs_temp' shown below illustrates how the base-emitter voltage (VBE) of a 'pnp' primitive changes with temperature when its collector current (IC) is fixed. 'Vbe1' is the VBE developed across a diode-connected PNP transistor when its IC is forced at 100uA and 'Vbe2' is the VBE when the PNP transistor has the multiplicity factor ('m') of 8. 'dVbe' is the difference between 'Vbe1' and 'Vbe2'. The temperature is gradually increased from -40 to 125°C using a 'pwl_gen' primitive driving a 'xreal_to_temp' primitive.

The simulated waveforms below show the changes in 'Vbe1', 'Vbe2' and 'dVbe' as a function of temperature. As the temperature gradually increases from -40 to 125°C, both 'Vbe1' and 'Vbe2' decreases. It is because in the BJT collector current equation IC=IS ·exp(VBE/VT), IS has the stronger dependence on temperature than VT does. On the other hand, 'dVbe', the difference between 'Vbe1' and 'Vbe2', increases with temperature, since ∆VBE = VT·log(IS2/IS1). In this example, the ratio IS2/IS1 is equal to the ratio between the multiplicity factors of the two 'pnp' primitives, which is set to 8. For more information on the temperature-dependent characteristics of BJTs, we recommend this article written by Prof. Behzad Razavi, titled “The Design of a Low-Voltage Bandgap Reference”.

The next model & testbench named 'tb_tempsensor' illustrates a circuit model that generates a voltage and a current proportional to the absolute temperature (PTAT). This circuit is also explained in the Prof. Razavi's article mentioned earlier. The amplifier-based feedback loop controls the currents flowing through the branches so that the two voltages 'Vbe1' and 'fb' become equal. At this condition, the current value I is set by the difference between 'Vbe1' and 'Vbe2' divided by the resistance R1, that is, I=∆VBE/R1. Therefore, the circuit produces the output current 'Iout' and output voltage 'Vout' that are proportional to the absolute temperature. Note that the 'vinit' primitive initializing the voltage on the node 'bias' is necessary to aid start-up. Also, the relative tolerance ('reltol') parameter of the BJTs is set to 0.01 to improve the simulation accuracy.

The simulated waveforms from this 'tb_tempsensor' testbench confirms that the circuit indeed produces 'Iout' and 'Vout' that are proportional to the absolute temperature. The BJTs and resistor are sized so that each branch current is set to 100uA at 25°C, and hence the simulated waveforms of 'Vbe1' and 'Vbe2' are similar to those with 'tb_vbe_vs_temp'. Both the output current 'Iout' and output voltage 'Vout' increase linearly as the temperature increases.

It is also possible to produce a voltage that is independent of temperature by combining VBE and ∆VBE. It is because VBE is complementary to the absolute temperature (CTAT) while ∆VBE is proportional to the absolute temperatue (PTAT). Among many circuit implementations that exist, the model & testbench named 'tb_refgen' shown below uses the implementation that adds the shunt resistance R2 to each of the nodes 'Vbe1' and 'fb'. Since the current flowing through each branch then becomes ∆VBE/R1 + VBE/R2, by sizing R2 properly, one can produce the output current 'Iout' and output voltage 'Vout' that stay constant against the temperature change. This circuit is commonly called a “bandgap reference generation circuit”.

The simulated waveforms from this 'tb_refgen' testbench confirms that the circuit indeed produces constant 'Iout' and 'Vout' despite the changes in temperature.

Attachment: tempsensor_20230430.tar.gz

XMODEL

바이폴라 트랜지스터(BJT) 기반의 온도센서 회로 모델링

SA Support Team Staff 2023-04-30

XMODEL에서 바이폴라 트랜지스터(BJT) 기반의 온도센서 회로를 모델링할 수 있나요? 구체적으로는, BJT의 베이스-에미터 전압(VBE)가 온도에 따라 바뀌는 특성을 이용한 회로를 모델링하고 싶습니다.

1 Answers
SA Support Team Staff 2023-04-30

XMODEL 2023.05 Release added 'npn' and 'pnp' primitives, which model NPN-type and PNP-type bipolar junction transistors (BJTs), respectively. And the characteristics of these primitives change with temperature. Namely, the thermal voltage (VT) and transport saturation current (IS) of these primitives change with the absolute temperature (T) as VT = kT/q and IS ∝ exp(-VG0/VT), where VG0 is 1.205V. You can set the temperature value in Celsius using the 'xreal_to_temp' or 'real_to_temp' primitives.

A model & testbench named 'tb_vbe_vs_temp' shown below illustrates how the base-emitter voltage (VBE) of a 'pnp' primitive changes with temperature when its collector current (IC) is fixed. 'Vbe1' is the VBE developed across a diode-connected PNP transistor when its IC is forced at 100uA and 'Vbe2' is the VBE when the PNP transistor has the multiplicity factor ('m') of 8. 'dVbe' is the difference between 'Vbe1' and 'Vbe2'. The temperature is gradually increased from -40 to 125°C using a 'pwl_gen' primitive driving a 'xreal_to_temp' primitive.

The simulated waveforms below show the changes in 'Vbe1', 'Vbe2' and 'dVbe' as a function of temperature. As the temperature gradually increases from -40 to 125°C, both 'Vbe1' and 'Vbe2' decreases. It is because in the BJT collector current equation IC=IS ·exp(VBE/VT), IS has the stronger dependence on temperature than VT does. On the other hand, 'dVbe', the difference between 'Vbe1' and 'Vbe2', increases with temperature, since ∆VBE = VT·log(IS2/IS1). In this example, the ratio IS2/IS1 is equal to the ratio between the multiplicity factors of the two 'pnp' primitives, which is set to 8. For more information on the temperature-dependent characteristics of BJTs, we recommend this article written by Prof. Behzad Razavi, titled “The Design of a Low-Voltage Bandgap Reference”.

The next model & testbench named 'tb_tempsensor' illustrates a circuit model that generates a voltage and a current proportional to the absolute temperature (PTAT). This circuit is also explained in the Prof. Razavi's article mentioned earlier. The amplifier-based feedback loop controls the currents flowing through the branches so that the two voltages 'Vbe1' and 'fb' become equal. At this condition, the current value I is set by the difference between 'Vbe1' and 'Vbe2' divided by the resistance R1, that is, I=∆VBE/R1. Therefore, the circuit produces the output current 'Iout' and output voltage 'Vout' that are proportional to the absolute temperature. Note that the 'vinit' primitive initializing the voltage on the node 'bias' is necessary to aid start-up. Also, the relative tolerance ('reltol') parameter of the BJTs is set to 0.01 to improve the simulation accuracy.

The simulated waveforms from this 'tb_tempsensor' testbench confirms that the circuit indeed produces 'Iout' and 'Vout' that are proportional to the absolute temperature. The BJTs and resistor are sized so that each branch current is set to 100uA at 25°C, and hence the simulated waveforms of 'Vbe1' and 'Vbe2' are similar to those with 'tb_vbe_vs_temp'. Both the output current 'Iout' and output voltage 'Vout' increase linearly as the temperature increases.

It is also possible to produce a voltage that is independent of temperature by combining VBE and ∆VBE. It is because VBE is complementary to the absolute temperature (CTAT) while ∆VBE is proportional to the absolute temperatue (PTAT). Among many circuit implementations that exist, the model & testbench named 'tb_refgen' shown below uses the implementation that adds the shunt resistance R2 to each of the nodes 'Vbe1' and 'fb'. Since the current flowing through each branch then becomes ∆VBE/R1 + VBE/R2, by sizing R2 properly, one can produce the output current 'Iout' and output voltage 'Vout' that stay constant against the temperature change. This circuit is commonly called a “bandgap reference generation circuit”.

The simulated waveforms from this 'tb_refgen' testbench confirms that the circuit indeed produces constant 'Iout' and 'Vout' despite the changes in temperature.

Attachment: tempsensor_20230430.tar.gz