Posts Tagged ‘Temperature’

As a follow-up to my 2018 Smart Temperature and Humidity Gauge here is a new and improved wireless version. A smartphone screen replaces the previous LCD display, allowing the data to be read remotely from the device location. The four displayed parameters are the same, but the previous Absolute Humidity formula with its -30°C to +35°C range has been replaced with a new formula (Mander 2020) with an extended temperature range.

The WiFi-enabled microcontroller can be programmed to operate in Station mode, Access Point mode or both modes simultaneously so you can use the device at home, at work, on the beach, wherever you want to know the values of the parameters which determine your comfort.

The original Smart Gauge prototype with attached LCD display

The wireless function also enables you to read temperatures inside a closed compartment such as a fridge. By following the readings on your smartphone (I set mine to refresh every 20 secs) you can see what the upper and lower thermostat settings are. For example the air in the 4°C compartment of our fridge cycles between 2.9°C and 7.5°C. I was surprised by this to begin with, but then realized that things stored in fridges generally have significantly larger heat capacities than air so their temperatures will fluctuate over narrower ranges.

A sensor mounted on jumper leads is ideal for testing condenser coil ventilation on a fridge, with the sensor placed directly in the airflow of the lower inlet and upper outlet.

– – – –


The CarnotCycleAIR Smart Gauge is built around an Arduino IDE compatible Sparkfun ESP8266 Thing Dev microcontroller featuring an integrated FTDI USB-to-Serial chip for easy programming. A 2-pin JST connector has been soldered to the footprint alongside the micro-USB port and the board is powered by a rechargeable 3.7V lithium polymer flat pouch battery which fits neatly underneath the standard 400 tie-point breadboard. The system is designed to work with DHT sensors such as the DHT22 with a temperature range of -40°C to +80°C and relative humidity range of 0-100%, or the DHT11 with a temperature range of 0°C to +50°C and relative humidity range of 20-90%. These are available mounted on 3-pin breakout boards which feature built-in pull-up resistors. Both sensors are designed to function on the 3.3V supplied by the board, enabling the signal output to be connected directly to one of the board’s I/O pins without the need for a logic level converter [the ESP8266’s I/O pins do not easily tolerate voltages higher than 3.3V. Using 5V will blow it up].

Note: Comparing temperature readings in ambient conditions with an accurate glass thermometer has shown that when the sensors are plugged directly into the breadboard they record a temperature approx. 1°C higher than the true temperature, which in turn affects the accuracy of the computed absolute humidity and dewpoint. The cause appears to be Joule heating in the breadboard circuitry. Using jumper leads to distance the sensor from the board solves the problem.

The DHT22 sensor works happily down to –40°C, as does the new absolute humidity formula.

When used in Station mode the range is determined largely by the router. In Access Point mode where the device and smartphone communicate directly with each other, the default PCB trace antenna was found to work really well with an obstacle-free range of at least 35 meters (115 feet).

A Sparkfun LiPo Charger Basic, an incredibly tiny device just 3 cm long with a JST connector at one end and a micro-USB connector at the other, was used to recharge the battery. Charging time was about 4 hours.

The Sparkfun LiPo Charger Basic

– – – –


The circuitry for CarnotCycleAIR Smart Gauge couldn’t be simpler.

The ESP8266 (with header pins) is placed along the center of the breadboard and 3.3V is supplied to the power bus from the left header (3V3, GND). The DHT sensor is powered from this bus and the signal is routed to a suitable pin. I used pin 12 on the right header. That’s all there is to it.

– – – –


CarnotCycleAIR Smart Gauge is a further development of an ESP8266 project – “ESP8266 NodeMCU Access Point (AP) for Web Server” – published online by Random Nerd Tutorials which displays temperature and relative humidity on a smartphone with the ESP8266 set up as an Access Point. Code for both the Station-only version and Station and Access Point version using Arduino IDE can be copied from these mouse-over links:

Station-mode Temperature Humidity App for Smartphones

Dual-mode Temperature Humidity App for Smartphones

– – – –

© P Mander December 2021

The absolute humidity formula posted in 2012 on this blog has a range of -30°C to 35°C. To expand this range I have developed a new formula to compute absolute humidity from relative humidity and temperature based on a simple but little known polynomial expression (Richards, 1971) for the saturation vapor pressure of water, valid to ±0.1% over the temperature range -50°C to 140°C.

Formula for calculating absolute humidity

In the formula below, temperature (T) is expressed in degrees Celsius, relative humidity (rh) is expressed in %, and e is the Euler number 2.71828 [raised to the power of the contents of the square brackets]:

Absolute Humidity = 1013.25 × e^[13.3185t – 1.9760t^2 – 0.6445t^3 – 0.1299t^4] × rh × 18.01528
(grams/m^3)                                                   100 × 0.083145 × (273.15 + T)

where the parameter t = 1 – 373.15/(273.15 + T)

The above formula simplifies to

Absolute Humidity = 1013.25 × e^[13.3185t – 1.9760t^2 – 0.6445t^3 – 0.1299t^4] × rh × 2.1667
(grams/m^3)                                                                   273.15 + T

To cite this formula please quote: P Mander (2020),

– – – –

Study notes

Strategy for computing absolute humidity, defined as water vapor density in grams/m3, from temperature (T) and relative humidity (rh):

1. Water vapor is a gas whose behavior in air approximates that of an ideal gas due to its very low partial pressure.

2. We can apply the ideal gas equation PV = nRT. The gas constant R and the variables T and V are known in this case (T is measured, V = 1 m3), but we need to calculate P before we can solve for n.

3. To obtain a value for P, we can use the polynomial expression of Richards (ref) which generates saturation vapor pressure Psat (hectopascals) as a function of temperature T (Celsius) in terms of a parameter t

Psat = 1013.25 × e^[13.3185t – 1.9760t2 – 0.6445t3 – 0.1299t4]
where t = 1 – 373.15/(273.15 + T)

4. Psat is the vapor pressure when the relative humidity is 100%. To compute the pressure P for any value of relative humidity expressed in %, the expression for Psat is multiplied by the factor rh/100:

P = 1013.25 × e^[13.3185t – 1.9760t2 – 0.6445t3 – 0.1299t4] × rh/100

5. We now know P, V, R, T and can solve for n, which is the amount of water vapor in moles. This value is then multiplied by the molecular weight of water to give the answer in grams.

Absolute humidity (grams/m3) = Psat  ×  rh  ×  mol wt
                                                          100 × R × (273.15 + T)

Saturation vapor pressure Psat is expressed in hectopascals hPa
Relative humidity rh is expressed in %
Molecular weight of water mol wt = 18.01528 g mol-1
Gas constant R = 0.083145 m3 hPa K-1 mol-1
Temperature T is expressed in degrees Celsius

6. Summary:
The formula for absolute humidity is derived from the ideal gas equation. It gives a statement of n solely in terms of the variables temperature (T) and relative humidity (rh). Pressure is computed as a function of both these variables; the volume is specified (1 m3) and the gas constant R is known.

– – – –

Formula jpgs

decimal separator = .

decimal separator = ,

– – – –

P Mander, July 2020

This prototype displays temperature, relative humidity, dew point temperature and absolute humidity

UPDATE: See the new wireless version < here >

As shown in previous posts on the CarnotCycle blog, it is possible to compute dew point temperature and absolute humidity (defined as water vapor density in g/m^3) from ambient temperature and relative humidity. This adds value to the output of RH&T sensors like the DHT22 pictured above, and extends the range of useful parameters that can be displayed or toggled on temperature-humidity gauges employing these sensors.

Meteorological opinion* suggests that dew point temperature is a more dependable parameter than relative humidity for assessing climate comfort especially during summer, while absolute humidity quantifies water vapor in terms of mass per unit volume. In effect this added parameter turns an ordinary temperature-humidity gauge into a gas analyzer. (more…)


The Arrhenius equation explains why chemical reactions generally go much faster when you heat them up. The equation was actually first given by the Dutch physical chemist JH van ‘t Hoff in 1884, but it was the Swedish physical chemist Svante Arrhenius (pictured above) who in 1889 interpreted the equation in terms of activation energy, thereby opening up an important new dimension to the study of reaction rates.

– – – –

Temperature and reaction rate

The systematic study of chemical kinetics can be said to have begun in 1850 with Ludwig Wilhelmy’s pioneering work on the kinetics of sucrose inversion. Right from the start, it was realized that reaction rates showed an appreciable dependence on temperature, but it took four decades before real progress was made towards quantitative understanding of the phenomenon.

In 1889, Arrhenius penned a classic paper in which he considered eight sets of published data on the effect of temperature on reaction rates. In each case he showed that the rate constant could be represented as an explicit function of the absolute temperature:

where both A and C are constants for the particular reaction taking place at temperature T. In his paper, Arrhenius listed the eight sets of published data together with the equations put forward by their respective authors to express the temperature dependence of the rate constant. In one case, the equation – stated in logarithmic form – was identical to that proposed by Arrhenius

where T is the absolute temperature and a and b are constants. This equation was published five years before Arrhenius’ paper in a book entitled Études de Dynamique Chimique. The author was J. H. van ‘t Hoff.

– – – –

Dynamic equilibrium

In the Études of 1884, van ‘t Hoff compiled a contemporary encyclopædia of chemical kinetics. It is an extraordinary work, containing all that was previously known as well as a great deal that was entirely new. At the start of the section on chemical equilibrium he states (without proof) the thermodynamic equation, sometimes called the van ‘t Hoff isochore, which quantifies the displacement of equilibrium with temperature. In modern notation it reads:

where Kc is the equilibrium constant expressed in terms of concentrations, ΔH is the heat of reaction and T is the absolute temperature. In a footnote to this famous and thermodynamically exact equation, van ‘t Hoff builds a bridge from thermodynamics to kinetics by advancing the idea that a chemical reaction can take place in both directions, and that the thermodynamic equilibrium constant Kc is in fact the quotient of the kinetic velocity constants for the forward (k1) and reverse (k-1) reactions

Substituting this quotient in the original equation leads immediately to

van ‘t Hoff then argues that the rate constants will be influenced by two different energy terms E1 and E-1, and splits the above into two equations

where the two energies are such that E1 – E-1 = ΔH

In the Études, van ‘t Hoff recognized that ΔH might or might not be temperature independent, and considered both possibilities. In the former case, he could integrate the equation to give the solution

From a starting point in thermodynamics, van ‘t Hoff engineered this kinetic equation through a characteristically self-assured thought process. And it was this equation that the equally self-assured Svante Arrhenius seized upon for his own purposes, expanding its application to explain the results of other researchers, and enriching it with his own idea for how the equation should be interpreted.

– – – –

Activation energy

It is a well-known result of the kinetic theory of gases that the average kinetic energy per mole of gas (EK) is given by

Since the only variable on the RHS is the absolute temperature T, we can conclude that doubling the temperature will double the average kinetic energy of the molecules. This set Arrhenius thinking, because the eight sets of published data in his 1889 paper showed that the effect of temperature on the rates of chemical processes was generally much too large to be explained on the basis of how temperature affects the average kinetic energy of the molecules.

The clue to solving this mystery was provided by James Clerk Maxwell, who in 1860 had worked out the distribution of molecular velocities from the laws of probability. Maxwell’s distribution law enables the fraction of molecules possessing a kinetic energy exceeding some arbitrary value E to be calculated.

It is convenient to consider the distribution of molecular velocities in two dimensions instead of three, since the distribution law so obtained gives very similar results and is much simpler to apply. At absolute temperature T, the proportion of molecules for which the kinetic energy exceeds E is given by

where n is the number of molecules with kinetic energy greater than E, and N is the total number of molecules. This is exactly the exponential expression which occurs in the velocity constant equation derived by van ‘t Hoff from thermodynamic principles, which Arrhenius showed could be fitted to temperature dependence data from several published sources.

Compared with the average kinetic energy calculation, this exponential expression yields very different results. At 1000K, the fraction of molecules having a greater energy than, say, 80 KJ is 0.0000662, while at 2000K the fraction is 0.00814. So the temperature change which doubles the number of molecules with the average energy will increase the number of molecules with E > 80 KJ by a factor of more than a hundred.

Here was the clue Arrhenius was seeking to explain why increased temperature had such a marked effect on reaction rate. He reasoned it was because molecules needed sufficiently more energy than the average – the activation energy E – to undergo reaction, and that the fraction of these molecules in the reaction mix was an exponential function of temperature.

– – – –

The meaning of A

But back to the Arrhenius equation

A clue to the proper meaning of A is to note that e^(–E/RT) is dimensionless. The units of A are therefore the same as the units of k. But what are the units of k?

The answer depends on whether one’s interest area is kinetics or thermodynamics. In kinetics, the concentration of chemical species present at equilibrium is generally expressed as molar concentration, giving rise to a range of possibilities for the units of the velocity constant k.

In thermodynamics however, the dimensions of k are uniform. This is because the chemical potential of reactants and products in any arbitrarily chosen state is expressed in terms of activity a, which is defined as a ratio in relation to a standard state and is therefore dimensionless.

When the arbitrarily chosen conditions represent those for equilibrium, the equilibrium constant K is expressed in terms of reactant (aA + bB + …) and product (mM + nN + …) activities

where the subscript e indicates that the activities are those for the system at equilibrium.

As students we often substitute molar concentrations for activities, since in many situations the activity of a chemical species is approximately proportional to its concentration. But if an equation is arrived at from consideration of the thermodynamic equilibrium constant K – as the Arrhenius equation was – it is important to remember that the associated concentration terms are strictly dimensionless and so the reaction rate, and therefore the velocity constant k, and therefore A, has the units of frequency (t^-1).

OK, so back again to the Arrhenius equation

We have determined the dimensions of A; now let us turn our attention to the role of the dimensionless exponential factor. The values this term may take range between 0 and 1, and specifically when E = 0, e^(–E/RT) = 1. This allows us to assign a physical meaning to A since when E = 0, A = k. We can think of A as the velocity constant when the activation energy is zero – in other words when each collision between reactant molecules results in a reaction taking place.

Since there are zillions of molecular collisions taking place every second just at room temperature, any reaction in these circumstances would be uber-explosive. So the exponential term can be seen as a modifier of A whose value reflects the range of reaction velocity from extremely slow at one end of the scale (high E/low T) to extremely fast at the other (low E/high T).

– – – –

P Mander September 2016

Relative humidity (RH) and temperature (T) data from an RH&T sensor like the DHT22 can be used to compute not only absolute humidity AH but also dew point temperature TD

There has been a fair amount of interest in my formula which computes absolute humidity (AH) from measured relative humidity (RH) and temperature (T) since it adds value to the output of RH&T sensors. To further extend this value, I have developed another formula which computes dew point temperature TD from measured RH and T.

Formula for computing dew point temperature TD

In this formula (P Mander 2017) the measured temperature T and the computed dew point temperature TD are expressed in degrees Celsius, and the measured relative humidity RH is expressed in %

gif format (decimal separator = .)

gif format (decimal separator = ,)

jpg format (decimal separator = .)

jpg format (decimal separator = ,)

– – – –

Strategy for computing TD from RH and T

1. The dew point temperature TD is defined in the following relation where RH is expressed in %

2. To obtain values for Psat, we can use the Bolton formula[REF, eq.10] which generates saturation vapor pressure Psat (hectopascals) as a function of temperature T (Celsius)

These formulas are stated to be accurate to within 0.1% over the temperature range –30°C to +35°C

3. Substituting in the first equation yields

Taking natural logarithms


Separating TD terms on one side yields

– – – –

P Mander August 2017