Memo: AC excitation

All passive sensors discussed so far rely on DC excitation. DC has its charm in simplicity, low cost and fluid integration into existing digital technologies. However, when it comes to analog technologies, AC excitation remains a cornerstone of high-performance circuits employing inductive or capacitive elements.

For the most parts, the working principles of passive sensors are the same in either cases; their encoding might differ but the theory of operation should be the same. As such, AC sensors can use the same conditioning circuitry as their DC counterparts, plus some extra to deal with the additional information from frequency domain.

AC excitation characteristic


High tolerance to common resistive effects like corrosion and wear.

Immunity to electrical noise as information can be stored in frequency domain.

Immunity to thermoelectric effects.

Can use high-performance transformer, capacitive and inductive circuits.

Low power losses to self-heating as only the real part of the AC is responsible for heat dissipation.


Vulnerable to phase shifting and race conditions.

Problems with ground leakage / stray capacitance.

Complex interface with existing digital technologies, requiring rectification and rescaling to match the legacy DC signal.

AC bridges

Applying AC excitation to Wheatstone bridge circuits changes the quantity being measured from resistance to impedance. Impedance is a complex quantity containing resistance, inductance and capacitance as well. It wouldn’t hurt to revise the conversion of these DC values to AC complex values as follow:

\ Z_{R}=R

\ Z_{L}=j\omega L

\ Z_{C}={\frac {1}{j\omega C}}

In a nutshell, the operation of AC Wheatstone is similar to DC Wheatstone; an unknown quantity is weighed against known, adjustable quantities. The condition for a balanced bridge in AC domain is:

In other words, both the resistance and the phase factors must match on either arms for the bridge to be balanced. For measuring inductance and capacitance, a few bridge circuits can be used. The simplest and most straightforward bridge is the symmetrical bridge as seen below:

This is nothing more than a direct comparison between unknown capacitance and a standard when the bridge is balanced.

This symmetrical bridge does the trick illustrating the basic idea of impedance bridges but it is hardly appropriate in practice. In the real world, capacitors and inductors possess internal resistance and this must be properly addressed.

Wien bridge takes into account of the capacitor’s internal resistance, which is in series with the capacitive component, and counters it with a parallel resistor-capacitor pair as seen below:

Wien bridge: measuring real capacitance

The bridge is balanced when both conditions below are satisfied:

\omega ^{2}={1 \over R_{x}R_{2}C_{x}C_{2}}

{C_{x} \over C_{2}}={R_{4} \over R_{3}}-{R_{2} \over R_{x}}\,.

As Wien bridge’s frequency (or that of the AC source) can be calculated from

\omega ={{2\pi } \over T}={2\pi f},

it is possible to use Wien bridge for measuring frequency of an unknown signal source.

Another thing about the real world is that, it is incredibly difficult to manufacture variable inductors. However, variable capacitors are readily available and fortunately there exists a bridge called Maxwell bridge that permits measurement of inductance using variable capacitors.

Maxwell bridge: measuring inductance with capacitance

The full condition for balance is as follow:

{\begin{aligned}R_{3}&={\frac  {R_{1}\cdot R_{4}}{R_{2}}}\\L_{3}&=R_{1}\cdot R_{4}\cdot C_{2}\end{aligned}}

Maxwell bridge’s balance condition is independent of source frequency. This permits some tolerance to mixed frequency AC voltage source. On top of that, Maxwell bridge uses only one inductor and avoids mutual inductance issue which plagues symmetrical bridge using two inductors. Not that two capacitors don’t cause any mutual capacitance; they do, but shielding against electric field is much easier than against magnetic field so capacitors are preferred.

Phase shifter
rc phase shift network
RC phase shifter network


Phase shifter is an important element of AC conditioning circuit. It allows (manual) phase matching of the input and output signal. Capacitive and inductive elements shift the phase by 90 and -90 degree respectively and they are the foundation of phase shifters.

Due to mutual inductance phenomenon as mentioned in Maxwell bridge’s discussion, RL phase shifters are possible though rarely employed in practice. For RC phase shifters, the phase angle is dependent on the value of R and C, and is calculated as follow:

rc phase shift equation

Using phase shifters naturally introduces additional resistance, which in turn causes the signal to drift (off-set). This off-set should be compensated and hence phase shifters should be used before off-set compensation in the conditioning circuitry.

One important note is that, RC phase shifter is also a passive high pass filter and it will suppress low frequency signals; including the signal itself if it is low enough. This is one of the reasons why Phase-locked loop (PLL), albeit complicated in construction, is preferred in conditioning circuits over simple RC phase shifters for phase matching.

Lock-in amplifier

Using AC excitation, it is possible to encode information in both amplitude and frequency alteration. Because AC bridges are natural AM modulators, they produce an amplitude-modulated output signal of the carrier signal–the AC excitation–and the input signal–the impedance change due to physical changes. It is, therefore, imperative to demodulate the input signal from the output at a later stage for usage in a (possibly digital) control system.

Animation of audio, AM and FM modulated carriers.
The signal is encoded in the shape (AM) or the frequency alteration of the carrier wave (FM)

One device that performs this demodulation (the term phase-sensitive detection is the same thing) is a lock-in amplifier. Essentially, a lock-in amplifier takes a modulated signal and a reference, carrier signal and attempt to extract the amplitude “shape” of the modulated signal at the reference’s frequency, reconstructing the sensor’s signal as a result. This is the description of its operation in time domain though it is a mere corollary of its frequency domain’s operation.

In frequency domain, the lock-in amplifier acts as a very narrow band-pass filter which locks in on a specific frequency (based on the reference) and suppresses all other frequencies. The output is a DC signal comprising of the signal’s amplitude at reference frequency and its phase shift from the reference.

{\displaystyle U_{\text{out}}={\frac {1}{2}}V_{\text{sig}}\cos \theta ,}

This DC output can be used as a representation of the phase shift and as control signal in self-tuning circuits as seen in a previous memo. If reconstructing the sensor’s signal is of interest, this phase shift component can be rectified via a phase shifter beforehand so that the output is a linear representation of only the sensor’s signal (its amplitude, specifically). In other words:

Uout = 1/2 Vsig

when \theta  = 0

Image result for lock-in amplifier block
Basic lock-in amplifier block diagram

The phase shifter can be an RC phase shifter as described in the previous section or, more commonly, a PLL circuit, which actively keeps the reference signal in-phase with the input signal without further intervention. The reference signal can be taken directly from AC excitation source (at the engineer’s discretion) or from an internal oscillator.

More advanced “dual-phase demodulation” lock-in amplifiers use a fixed 90 degree phase shifter to generate two components X and Y for mathematical calculation of both the phase shift and amplitude quantities of the signal separately.

a) Basic lock-in amplifier circuit producing an interpolation of amplitude R and phase shift theta b) Dual-phase modulation circuit producing amplitude R and phase shift theta independently

The in-phase component X from input signal and unchanged reference signal:

{\displaystyle X=V_{\text{sig}}\cos \theta }

The quadrature component Y from input signal and phase shifted reference signal:

{\displaystyle Y=V_{\text{sig}}\sin \theta }

The magnitude of the signal at reference frequency:

{\displaystyle R={\sqrt {X^{2}+Y^{2}}}=V_{\text{sig}}.}

And the phase shift of the signal from the reference signal:

{\displaystyle \theta =\arctan \left({\frac {Y}{X}}\right).}

Read more



Memo: Strain gauge bridge circuits

As mentioned in the previous memo, strain gauges are vulnerable to temperature effects such as thermoresistive, thermoelectric and self-heating. Some special alloys like Constantan are designed to be self-compensating while others aren’t. Those that aren’t will require special conditioning circuits utilizing one or more complimentary strain gauges in bridge topology. Three most common bridge circuits for strain gauges are quarter bridge, half bridge and full bridge.

All these bridge circuits take advantage of the fact that Wheatstone bridge is a differential device and temperature-dependent errors occur uniformly on all sensors in thermal contact with the specimen. This allows common-mode error compensation by positioning one or more identical gauges on the adjacent arm(s) to the active gauge.

Half bridge and full bridge circuits also provide increased sensitivity via measuring the negative strains incurred on the specimen due to Newton’s third law of motion (action and reaction) and Poisson’s effect. This negative strains are measured by the extra gauges and then manipulated to add to the positive strain being measured by the active gauge.

Quarter bridge strain gauge circuit

A quarter bridge circuit is simply a Wheatsone bridge hooked up to a stressed strain gauge. The basic quarter bridge naturally does not have any temperature compensation mechanics but this can be rectified with an identical, unstressed (adjacent) strain gauge in thermal contact with the active strain gauge. The unstressed, dummy gauge is kept in thermal contact with the active gauge but not bound to the specimen; hence Poisson-induced strains will have negligible effect on the dummy gauge.

Recalling the previous memo, strain gauges are not designed to measure lateral force (horizontal strain). The adjacent strain gauge will not pick up on the strain measured by the active gauge
Unstressed strain gauge is wired to the adjacent arm to the active strain gauge. Resistance changes caused by temperature will affect both gauges and hence will be canceled out.

One problem with quarter bridge circuit is that, even though there are now two strain gauges, only one of them is responding to mechanical strain.

Half bridge strain gauge circuit

Half bridge circuit also uses two strain gauges, however, the second strain gauge is bound to the specimen so that it may respond to mechanical strain. The first half bridge configuration has exactly the same positioning and circuitry as quarter bridge configuration. However, when the active gauge is stretched, the second gauge is compressed due to Poisson-induced strain and this improves sensitivity by a small amount while providing the same temperature compensation effect.

Half bridge configuration I: the layout looks identical to quarter bridge’s layout but the second gauge R3 is bound and responsive to Poisson-induced strains
Same circuit as the quarter bridge but there are two active gauges responding to opposite strains

For bending strain measurement, a different, more sensitive configuration is often preferred. The second half bridge configuration changes the position of the second gauge so that it may measure the negative strain caused by Newton’s third law of motion (source from the fixture–or wall connected–point of the specimen). As this reactionary strain is much more prominent than Poisson-induced strain and it has the same magnitude as the positive strain, the half bridge circuit using this second configuration has twice the sensitivity of comparable quarter bridge.

Half bridge configuration II: the second gauge is positioned where the reactionary negative strain will occur, in this case, on the other side of the load cell. The reaction force’s source is the wall fixture.
Half bridge configuration II in action: gauge #1 measuring positive strain and gauge #2 measuring negative strain

The second half bridge configuration is unaffected by strains from Poisson’s effect and can only measure bending strain (up/down). When axial strain is applied here, both gauges will be stretched/compressed in the same manner and hence will cancel each other out, yielding zero output.

Both half bridge circuit configurations are temperature-compensated and have increased sensitivity. However, their outputs are only approximated and not linear to the actual strain. As explained by’s textbook:

“Linearity, or proportionality, of these bridge circuits is best when the amount of resistance change due to applied force is very small compared to the nominal resistance of the gauge(s). With a full-bridge, however, the output voltage is directly proportional to applied force, with no approximation (provided that the change in resistance caused by the applied force is equal for all four strain gauges!)”

Full bridge strain gauge circuit

Full bridge circuit provides a directly proportional output to the actual strain by replacing all passive resistance with active gauges. Four gauges are bound to the specimen similar to half bridge circuit in sets of two. National Instruments’ white paper describes three full bridge configurations arise from sides and alignments combinations of the sensors’ placements on the specimen.

The mapping of gauges in Wheatstone bridge circuit to physical placements on the specimen vary from configuration to configuration and this is potentially a source of confusion. In general, they can be organized by the strain they measure. Take a look at the two diagrams below:

R2 and R4 will be measuring negative strains while R1 and R3 will be measuring positive strains.

The first full bridge configuration doubles down on the half bridge configuration II; two positive gauges on top and two negative gauges under. This doubles the sensitivity and provides true linearity on top of temperature compensation but can only measure bending strain.

Full bridge configuration I: Bending strain only, with reactionary tensile strain

The second and third full bridge configurations double down on half bridge configuration I; one set of adjacent positive and negative gauge on each side. Both configurations measure the positive strains and the Poisson-induced negative strains. They have lower sensitivity than full bridge configuration I and higher sensitivity than half bridge, as well as true linearity and temperature compensation of all full bridge circuits.

The alignments of the gauges are based on the kind of strain being measured.

For bending strain, the alignments of positive and negative gauges are swapped when crossing the neutral axis.

For axial strain, the alignments remain the same on both sides.


Full bridge configuration II: Bending strain only, with Poisson-induced strain. Positive strain gauges R2 and R4 on opposite sides and in different alignment
Full bridge configuration III: Axial strain only, with Poisson-induced strain. Positive strain gauges R2 and R4 on opposite sides but in the same alignment

The only drawback of full bridge circuit is the number of strain gauges and wires required. For all their benefits, full bridge sensors are significantly more expensive than half bridge and quarter bridge sensors while uncompensated quarter bridge (using only one gauge) is the cheapest.

Bonus: Strain gauge torque sensor (rotary encoder)

Find below some self-explanatory illustrations for a strain gauge-based torque sensor.

When twisted in the opposite direction, the material stretches along the orange shear line and compresses along the black shear line.
Strain gauge torsionmeter
Same shear line: R1-R3, R2-R4. Changing the direction of rotation causes the polarity of the output voltage to reverse

Signal conditioning for load and torque sensors:

Excitation to power the Wheatstone bridge circuitry

Remote sensing to compensate for errors in excitation voltage from long lead wires

Amplification to increase measurement resolution and improve signal-to-noise ratio

Filtering to remove external, high-frequency noise

Offset nulling to balance the bridge to output 0 V when no strain is applied

Shunt calibration to verify the output of the bridge to a known, expected value

If DC excitation of Wheatstone bridge is bipolar (as it should), the direction of rotation is determined by the sign of the output.

If AC excitation is provided instead, the direction of rotation can be encoded in the peak-to-peak amplitude of the output; for example, 10VAC output range can have stationary output rated at 5VAC, fastest clockwise output at 10VAC and fastest counter-clockwise output at 0VAC. In this encoding, DC output can be obtained from AC output after passing the signal through a rectifier and Schmitt trigger circuit.

Read more,n21:17557/fmid/6673/


Memo: Resistive displacement sensors

Displacement sensors (aka position transducers) convert spatial information; linear distance, rotary position and deformation; into electrical quantities. One family of such sensors are called “encoders” ergo, devices that encode position into signal. Based on their coordinate system, encoders can be roughly classified into linear encoder (Cartesian coordinate) or rotary encoder (Polar coordinate) classes.

The most basic displacement sensors are resistive. They are measured and conditioned in the same way as resistive thermometers (with a Wheatstone bridge, instrumentation amplifier, low-pass filter, phase compensation, three-wire sensing and Kelvin’s sensing, etc.) but they have additional circuits to cope with temperature-induced errors.


The simplest encoders are contact-based, and among them the most straightforward is potentiometer. Potentiometer is a voltage divider device used for converting spatial information to resistance, and in turn voltage. It’s a passive sensor requiring a  power supply to work. Its construction according to Wikipedia is as follow:

“Potentiometers consist of a resistive element, a sliding contact (wiper) that moves along the element, making good electrical contact with one part of it, electrical terminals at each end of the element, a mechanism that moves the wiper from one end to the other, and a housing containing the element and wiper.”

The wiper can be a rotating shaft or a linear slider. Depending on the construction, a potentiometer can be a rotary or linear encoder.

Rotary potentiometers
Linear potentiometers (faders)

The relationship between position and resistance is, known as “taper”, is controlled by the manufacturer. There are two common tapers: linear and logarithmic. As the name suggested, linear taper potentiometers have a linear position-resistance relationship with the center position is usually 1/2 total R value. These find applications as encoders while logarithmic taper potentiometers are commonly used for audio amplifiers as human hearing is logarithmic.

Potentiometer can be used as it is, with the supply going into two outer terminals and the signal coming out of the middle terminal; or it can be used as a variable resistor (aka rheostat) in Wheatstone bridge implementation (though this configuration is rarely used as applications using potentiometer tend to value simplicity more than precision), using only one outer terminal and the middle terminal.

Potentiometer as a voltage divider

Assuming the potentiometer above is linear taper, the relation of position x of the wiper to the resistance is:

R2 = R * x

R1 = R * (1-x)

And the unloaded relation (RL >> R) of input and output voltage is given by

VL = R2/(R1 + R2) * VS

As such that it is simplified into:

VL = R*x/R * VS

VL = x * VS

For output of a loaded circuit with impedance RL, the formula is:

VL = x * VS / (1 + (x – x^2) * R/RL)

In reality, a voltage buffer is often used as conditioning circuit for potentiometer, in which cases the simpler, unloaded formula will be used.

Potentiometers, like most contact-based encoders, are slow, have small measurement surface, short measuring distance, varying degrees of accuracy (multi-turn potentiometers can be very accurate, single-turn ones…not so much) and low resistance to dust, oil and water. In addition, they are affected by friction, which can reduce the sensor’s lifespan among other annoyances (noise, heat, abrasion).

Trimmers are potentiometers that are rated for fewer adjustments over their lifetime. They are meant to be set once on installation by the technician and never to be seen or used by the user.

Strain gauge

Strain, ergo the displacement between particles in the body relative to a reference length (or deformation), can be measured by strain gauge. Strain gauge relies on piezoresistive effect and geometric deformation for its sensing. In a homogeneous metal, the resistance is given by its geometry and material as follow:
R=\rho {\frac  {\ell }{A}}\,


is the conductor’s length [m]

A is the cross-sectional area of the current flow [m²]

p is the specific resistance or resistivity of the material

The change in strain gauge’s resistance can then be expressed as:

dR/R = dp/p + dL/L – dA/A

When the strain gauge is tensed or compressed, piezoresistive effect changes the resistivity p of the material, causing the resistance to rise.

As in the case of thermoresistive effect, piezoresistive effect applies, in varying degrees, to both metals and semiconductors. The term “strain gauge effect” refers to unwanted piezoresistive behavior in non-strain gauge devices like thermometers; such devices are often designed in such a way that minimizes geometric changes during operation.

Likewise, strain gauges are designed to minimize thermoresistive effect and self-heating (Joule heating). The thin zigzag pattern improves heat dissipation (compared to a single thick trace) and the material (i.e. constantan alloy) is chosen such that the temperature effects on the resistance of the strain gauge itself cancel out the resistance change due to the thermal expansion. Ones made of such materials are called self-temperature-compensated strain gauges.

Those that are not self-compensating will need to be compensated during conditioning stage. Several strategies for temperature compensation are available and will be discussed in the next memo.

In constantan, a popular self-temperature-compensating material, piezoresistive effect contributes up to 20% of the resistance change. The rest of the resistance change is on account of geometric deformation, ergo, the change of the conductor’s length and cross-sectional area.

This geometric deformation follows a number of mechanical physics properties, namely: Poisson effect.

“Poisson effect is the phenomenon in which a material tends to expand in directions perpendicular to the direction of compression. Conversely, if the material is stretched rather than compressed, it usually tends to contract in the directions transverse to the direction of stretching”

The Poisson’s ratio v measures the magnitude of Poisson effect.

εT = ε * v


ε is the strain

εT is the trasverse strain, the strain caused by Poisson effect in perpendicular direction due to the original strain.

v is the Poisson’s ratio (normally in the range of 0 to 0.5)


The contribution of geometric deformation into Gauge factor, the ratio of relative change in electrical resistance R to mechanical strain ε, is given by:

{\displaystyle GF=1+2\nu }

and the full gauge factor with both geometric deformation and piezoresistive effect is:

{\displaystyle GF={\frac {\frac {\Delta R}{R}}{\varepsilon }}={\frac {\frac {\Delta \rho }{\rho }}{\varepsilon }}+1+2\nu }

where p is the resistivity.

For the exam, the key part of the above formula is:

GF = dR/(R * ε)

GF and R will be given by the datasheet. dR can be measured. With these values, the strain ε can be derived from the formula above. Inversely, dR can be calculated given the strain ε, R and GF. In these sort of problems, the strain ε might be given indirectly as displacement dL from the formula below:

ε = dL/L

Bonus: Load cell

When strain gauge is used to measure force instead of strain, the construct is called a load cell. A load cell usually consists of four strain gauges in a Wheatstone bridge configuration.

Load cell

The change in force is linearly proportional to the change in strain in accordance to Hooke’s law and Young’s modulus. The formula for this physical property is given as follow:

{\displaystyle E\equiv {\frac {\sigma (\varepsilon )}{\varepsilon }}={\frac {F/A}{\Delta L/L_{0}}}={\frac {FL_{0}}{A\Delta L}}}


E is Young’s modulus (material dependent) [Pa] or [N/m2] or [kg·m−1·s−2]

{\displaystyle \sigma (\varepsilon )} is the tensile stress

ε is the strain

At this point, it is also important to know the difference between stress and strain. Here’s a quick run down from an answer by Erik Carton at

Stress and strain do not have the same units at all. Stress is a force (N) per unit of area (m^2), hence it has the unit (N/m^2) = Pascal (Pa).

Strain is the elongation of a (stressed) material divided by the original length, hence m/m, which is unit-less and can be expressed in percentage (%).

The Young’s modulus provides the ratio between stress and strain (in the elastic regime): Pa/(m/m) = Pa  and therefore has the same unit as stress (or pressure).

So from stress, it is possible to determine the force given the area upon which the force was exerted. In practice, though, the force-to-voltage ratio is rarely modeled mathematically due to numerous complications (starting with the method to precisely measure the area upon which the force was exerted). The ratio is usually given by the datasheet or discovered via experimentation as a black box system.

One important note when using load cells: Hooke’s law is only valid when within the material’s elastic limit (reversible deformation). Beyond that limit and the response will no longer linear.

Bonus: Another way to calculate strain gauge’s resistance

For very small values, Poisson’s ratio can be approximated directly from length L and width (or normal of length) L’ as follow:

{\displaystyle \nu \approx -{\frac {\Delta L'}{\Delta L}}.}

Using this, the change in resistance (the second formula in strain gauge section) can be simplified in term of Poisson’s ratio:

dR/R = (1 + 2v) dL/L + dp/p

This is one way to calculate strain gauge’s resistance from Poisson’s ratio and resistivity change but as resistivity change is hardly detectable, the formula above exists mainly in theoretical realm and is included here for the sake of completeness.

Read more

Short story: Halloween special

They ventured into the crypt: five militias, two knights, two priests, and one dog; torches in hands, provisions on backs, and a primal fright at heart. Leading the pack, the younger of the knights, Sir Rathamul brandished a sword and a spiked lantern shield. The oil lantern, a part of his shield’s gauntlet, emanated a dim orange light the radius of two meter–about two third the reach of his sword–accompanied by a sweet incense whose cost per pouch far surpassed the blue fur cap on his shoulders, and whose sole purpose was to veer away the stench of bat droppings.

Father Germini claimed the incense warded evil spirits and kept one sane by the grace of God; how much of this was a priest’s belief and how much was an apothecary’s consideration for the laymen, Sir Rathamul knew not. The priest knew his craft; that was certain. In this party, he was the only person who could speak Gondrash—the language of the dragons—and his healing arts could bring a man back from the brink of death. His young age was of no relevance to his wisdom, or so Sister Forse, who on the same day resorted to young age as an excuse for her inability to read, spoke about the man in white cassock, clutching a golden pectoral cross in his hands.

When it came to wisdom and age, however, no one in his homeland or that marble city of Azeth to the west could match Sir Winfried of Ursland in the south. The city of Ironheart had always produced the finest knights in the kingdom and Winfried was this generation’s most skilled red-helm guard. With his blessed tower shield, which was being strapped to his back for ease of travel, he could deflect arrows back to their shooters from fifty meter away.

In the end, only Sister Forse and three fifteen-year-old and two sixteen-year-old militias were childish enough to argue who, Germini or Winfried, was the wisest of them all. The children had grown attached to her since the day the chieftain commanded them to assist Sir Rathamul on his first quest as a blue-shield crusader. That was a mere fortnight ago, and yet their homeland—his homeland—the fishing village of Merlock, already seemed a distant memory.

Sister Forse, in a standard Azethan church’s black habit, would turn twelve this year. She was at the age where she could be courted by and married to nobles if not for her clergy duties. Sir Winfried opposed her coming with them; he saw her as a dead weight, a fine companion at the dining table but a dead weight in battle nevertheless. The one-meter-and-eight giant watched her slender back from the end of their human column, keeping a short half meter distance from the militia before him so that his torch would not drip oil on the boy’s leather helm. At times, he would nag her and her boys to keep quiet else they would wake the dead.

One last member of the party was Sister Forse’s dog: Dust. It was a large brown dog; large enough to carry Sister Forse on its back when she was younger, Father Germini said, but he could no longer. His mistress had outgrown him to the point he could be picked up in her arms and cuddled. This, Sir Rathamul later learned, was no exaggeration. Her work in Azethan church’s eatery apparently gave her the strength to pick up sacks of potatoes with one hand and the dexterity to outrun a chicken.

Inscribed along the crypt’s walls were oval glyphs indecipherable by either Father Germini or Sir Winfried. These black, obsidian glyphs gave off an apprehensive sensation when gazed upon and strange warmth when touched—in contrast to the cold haze permeating from the blizzard outside through the rocks and into this ancient sanctuary. Everyone was as tense as a harp’s string when Sir Winfried ordered one of the boys to inspect the glyphs. Reluctantly, the militia obliged and poked his spear at the wall, breathing a sigh of relief when nothing happened.

They split up into two groups. The first group consisted of Father Germini, Sir Rathamul and three militias traveled eastward along the wall. The second group; Sister Forse, Sir Winfried, two militias and the dog; went in the opposite direction, following the western wall. The knights with their shields and swords guarded their own respective group from frontal attacks, the militias with bronze spears shortened for indoor fighting covered the flanks, and the priests with torches remained protected at the center of the formation. The goal was to circle the crypt, estimate its layout and gather fuel for a camp fire.

Every step he made, Sir Rathamul counted it in his mind. Every hundred steps he made, he counted it aloud for Father Germini and the boys. Meanwhile, the priests and the militias kept their eyes peeled for dry branches, hay, linen or anything of interest in the premise, or anything that lurked in the shadows. As the step count reached a staggering thousand, Father Germini grew anxious. Even the Common’s Hall—the parliament building in Azeth city—was not as vast as a thousand steps in diameter, he said, and something was out of the ordinary, he concluded.

Sir Rathamul had also noticed the peculiarity of their situation. His senses told him they had been walking downhill for a while; but he knew not how steep the slope had been without a natural reference such as the sky, whereby the hypnotic, swirly patterns on the ceiling did nothing to help as they induced the same apprehension as the glyphs on the walls, then seemed to be coiling like a giant, living, stone serpent in his eyes. His feet, however, told a different story. The unarmored priest and light armored militias might not have felt this, but Sir Rathamul, cladded in steel from head to toe, had an acute awareness of this so terrible a weariness for a leisure stride downhill.

This surreal discrepancy struck him as dreadful for they could have walked themselves to exhaustion and been swallowed up by the eternal darkness, had they taken the trustworthiness of their senses for granted. Having understood the situation—that the crypt might be so vast, they would not be able to circle it with their depleting oil reserve and waning stamina—Father Germini urged them to withdraw if they ever hoped to see the sun again. He commanded Sir Rathamul to burn a bit of the expensive incense they were saving for the whole party after they rendezvoused.

The way the priest gave the commands got on the young knight’s nerves and the knight became infuriated. Sir Winfried was the party’s leader and Sir Rathamul was the second in command, this made the knight the group’s bona fide leader when the party split. Young as he might be, Sir Rathamul was still four years older than the priest and in his village, age and wisdom came in hand.

The knight was being unreasonable; Father Germini contested. But surmised he had authority, what suppose his plan was? Was it not the same? The priest challenged. To this point, Sir Rathamul had no retort and as soon as the incense was lit and they began marching to the crypt’s entrance, he felt petty and angry at himself for crying attention to someone younger than he was. Perhaps having seen through the knight’s frustration, Father Germini offered the first apology, saying, he had been a big brother to Sister Forse for so long that he had forgotten his place in the larger group. Afterward, words of confession poured out of his mouth so easily that Sir Rathamul had a vision: that this priest had brought out a church from the cross on his chest and placed them all within its sanctuary.

When they backtracked to the entrance, it took them only eight hundred steps and the uphill climb felt much worse than the other way—and yet his mind was exhilarated, thrilled by the normalcy, so filled with euphoria that the toll on his body eluded him until they reached the exit and finally got to settle down on the dusty floor. They welcomed the sound, the sensation, and the vision of a sensible and cruel world like an old friend they had not seen for many years. The roar of winds, the chill of snows, and the orange glow of lantern reflected off the dull rock face beyond the crypt’s entrance had become so beloved in their eyes. They had no sense of time in that strange place, but given the blizzard had yet to subside, it could not have been more than a few hours.

They sensed an imposing desire to flee the shelter and run into the raging storm. Indeed had they not been so weary to the point of collapse, the militias would have done so, and there would have been nothing Sir Rathamul or Father Germini could do to stop them. At the border of the blizzard and the crypt, they were assaulted by both the cold and the darkness. While the blizzard soon subsided, the chill lingered and the snow kept pelting down till dawn of the next day. But, dawn was seen by none of them for at midnight they heard a series of loud barks in the crypt.

Father Germini was the first to notice and he cried the dog’s name and brought a torch to the dark entrance. The soft galloping of a dog answered, drawing closer to their camp until the dog jumped out from the void like a javelin. All of them froze at the terrible sight in front of them: the dog with blank white eyes growled and bared his canine teeth at them, his mouth foaming crimson saliva, dark stains splattered his brown fur, and a nauseating stench distinctive of blood radiated from the creature. Sir Rathamul drew his weapons and the militias followed suit. Hearing the sound of sheathing metal, the dog flinched and darted back into the crypt. Father Germini, with only a torch in hand chased after the dog; all shouting from the knights and the militias went into deaf ear.

Sir Rathamul and his fellow warriors, who could not bear the guilt of abandoning their comrades, held their breaths, gathered their courage and once again plunged into the crypt. This time, they were much less prepared than before; much of their provisions were left by the camp fire and they only had on them the bare minimum oilskin for half an hour of fire. As they ran, the knight shed his plate armor pieces by pieces, with each piece making a resounding clang when it hit the stone floor, until there were only greaves and gauntlets on him. When he did so, he felt his body wrapped in both a physical and mental chill. Without the iron clad he would have nothing but the lantern shield and the short sword to fend off the mortal dangers implied by the sorry state of the dog. However, his mind rejoiced as his legs became nimbler and he could sprint faster than ever.

They covered a great distance before they caught up with Father Germini. The priest lost sight of the dog and was desperately shouting its name. They were at the center of the vast chamber, darkness stretching in all directions for as far as the eyes could see and the torchlight could reach. Sir Rathamul feared the worst had come to pass to Sir Winfried’s party, and should it have been the case, he feared there would be no going back from this adventure for he was nothing but a mere shadow of the great red-helm knight. He would rather fight bandits and wolves than fumbling in the dark, looking for a danger he could not perceive. Even swamp giants stank less than this crypt, said one of the militias, they would be better off in the blizzard than here, the other two militias added in unison.

This was the foolish priest’s fault, Sir Rathamul accused, he just had to run after the dog and drag them all into this situation; now without food and water, they would starve faster, if whatever was lurking in the shadow did not get them first. Father Germini said nothing. He let them vent their frustrations on him until they exhausted, then sighed and knelt down on the floor. Holding the golden cross in his hand, he prayed God for their deliverance and requested them to join him in prayer, which they eventually did. They all closed their eyes and chanted prayers after Father Germini. After a while, they could recite different prayers from memory and this, for a time, brought their souls closer to God, closer to salvation.

As it came to pass, he told them the method to find the exit. They would travel in zigzag pattern until they caught a breeze, which could only come from the outside world, and following the wind would lead them to safety. Sir Rathamul found the knowledge assuring, he removed the gauntlet of his sword hand—then felt like a shackle—and licked one side of his index finger, raising it up high to sense the cold embrace of the mountain wind and began to lead the party to and fro. It took no time for them to encounter a welcoming headwind, which they followed in the previous formation, having regained a sense of unity, and all the while reciting biblical passages after Father Germini. The sweet incense, the priest explained, was often used in cleansing rituals at the church and when combined with prayers from three clergymen formed the essences of God and called upon his divine power to vanquish the evil one. They did not have much of the incense left in reserve but he surmised it should last long enough till the exit.

At length, Sir Rathamul noticed the fragrant smoke from the incense was flowing against the wind, toward the direction they were traveling instead of trailing behind them. When he spoke his discovery to Father Germini, the priest dismissed it with a hint of ire in his tone, saying this was a miracle, proof that God was leading them to deliverance, and that they must be as silent as a lamb and have faith in the Lord’s guidance. Thus, Sir Rathamul, having been proven to be the foolish one for the second time, kept his doubts to himself and spoke his own foolishness no more. But the fragrant led them not unto their deliverance but into temptation, and into the hand of the evil one, as creeping into the foremost corner of their vision at this very moment was the remnant of Sir Winfried’s party, which they thought to have left behind in the void and ought to remain there for eternity.

There laid the corpses of two boys on the floor: one headless and the other had one arm impaled by a bronze spear, and a fatal stabbing wound at his side. The blood of their bodies had ceased to flow, the limbs were stiff, cold and blue, and when the party approached, the men caught glimpse of a few rats feasting on the boys’ flesh. A distance away, they found Sir Winfried in a frightening state; the man was groveling, hands holding his bleeding eyes, his scarlet helm thrown away, his large rectangular tower shield and his sword, covered in blood, laid flat on the ground nearby. Upon hearing Sir Rathamul and his aides coming, Sir Winfried picked up his weapons and charged at them, cursing witches and shouting repentance.

Father Germini, who had been squeamish and shaking, and the militias, who had cried their hearts out to the loss of their spear brothers, shouted at Sir Winfried to stop but it was in vain. Their leader saw them as witches, as heretics to be vanquished and his ears were shut as his mind was clouded. Get up and run! Screamed Sir Rathamul as he picked up a spear on the ground and flung it at the red-helm knight’s exposed head. This halted Sir Winfried for a moment, he was forced to bring up his tower shield to defend, angling the shield at an angle to deflect the projectile upward and bashing the spear back at Sir Rathamul when it fell back down. This was Sir Winfried of Ursland’s famous counter skill and it was only because Sir Rathamul had anticipated this coming that he was able to parry it.

Sir Rathamul knew he would not last against such a mighty foe on equal footings, let alone at a disadvantage; he had no armor on him while Sir Winfried was almost in full iron clad. But he had to buy time for the others to get away. He lunged his sword to intercept Sir Winfried’s charge and raised his shield to protect his chest. His strike landed squarely on the steel cuirass and did nothing to Sir Winfried, who knew his advantage so well that he did not bother dodging or deflecting the attack, while his arm received a blow from the tower shield so tremendous that his joints crackled and his forearm twisted as though dislocated. Sir Rathamul staggered and fell on his back to dodge the horizontal slash at his abdomen, shoving a circular opening on his shield, from which the lantern light shone through and with which he could blind his opponent, into Sir Winfried’s face. In light and the intense fragrant took Sir Winfried’s off guard long enough for Sir Rathamul to escape. As he was without armor, he was nimbler than Sir Winfried and was able to put some distance between them with ease, eventually catching up with the priest’s group before the oil in his lantern ran out.

They found an extra hour of oil from the corpses of the militias and a torch on the ground; the torch that was supposed to be in the hand of Sister Forse. She was nowhere to be seen but given the torch, the militias, the dog and Sir Winfried, they came to a hard conclusion that she must have been killed and eaten by creatures of the dark. Father Germini did not take the news well, he was quiet and falling behind, at times, stopping and staring into the darkness as though hoping to catch a fleeting glimpse of the twelve-year-old nun. Perhaps, it had been for the best that they did not find her half-eaten body else the man might have lost the will to live.

Sir Rathamul asked the militias if they were okay, one of them had been sniffling for a while and the other two dragged their feet in silence, grim looks on their faces. They were okay, they said, as men at arms, they knew what they had signed up for and they were thankful they were still alive. But Sister Forse, she did not deserve this, the sobbing boy uttered, Sir Winfried was right: they should have left her in Azeth. At his words, the other two started weeping as well, swearing to get stronger, stronger than Sir Winfried, stronger than the darkness that begat this tragedy and swearing to avenge their losses this day.

These too were what Sir Rathamul would have wished for, had he not faced the wild blank eyes of Sister Forse’s dog, rummaged the pale and rotten corpses of young boys for provisions, and then stared down the killer end of Sir Winfried’s bloody sword, but he had and the young knight could not imagine escaping from the shadow of such primal, paralyzing and overwhelming fear for the rest of his mortal days. Thus, he wished for a life less strange, less otherworldly than this one; perhaps he should quit his adventuring ambition and settle down as a city guard in Azeth.

At last, the little incense they had ran dry and the smell of sweats mixed in the smog of burning oil were all that left for them. Up on the ceiling, the faint purple patterns continued swirling about; it was strange, when he thought about how they could see these phantasms when it was so dark, they could not see their own hands without a lantern; and then there was the wind, and the glyphs, and the witches. He realized his consciousness was fading and salvation drifting away. It felt almost as if…

God had forsaken them, Sir Rathamul spoke aloud.

This was God’s trial, Father Germini said—his voice seemed hollow and devoid of emotions—and only the most devoted of souls shall receive his divine guidance. He asked them to pause, get on their knees, put down their weapons, and pray the most sincere prayers to God, may his almighty show their sinful hearts mercy. That, they did. However, unlike before, when Sir Rathamul closed his eyes this time, he could not see the sanctuary of a church, nor could he feel his soul overflowed with hopes. He felt powerless, wretched and hopeless. He said he would fight and prevail against any enemy he could perceive and there he was, running away from Sir Winfried like a coward he was. He said he would lead them to safety as the rightful leader and there they were, fumbling in the dark, praying to a heavenly power for deliverance. His face grimaced, twisted in agony, as he struggled to cite the Lord’s prayers amid a torrent of self-pity and regrets.

Then, abruptly, a spear punched through Sir Rathamul’s chest, his eyes flung wide open and, behold, Father Germini’s bloodshot eyes were staring down at him from the other end of the bronze spear. It was so sudden that the knight could not utter a word as blood gushed forth from his chest like a fountain, and he slumped to the ground, making a dull thud. All three militias heard the sound and opened their eyes. It took them precious seconds to realize what was happening and when they did, the priest had already knocked their weapons into the darkness. Without their weapons, the militias were helpless children before this spear-wielding man, who then also armed himself with the fallen knight’s lantern shield.

God wills!

Father Germini cried and slew two of them: his spear skewed one boy’s throat and bashed the other’s head, splitting it in two. The two boys who moved their fingers toward their weapons were mercilessly put down on the spot, in manners so brutal that the last boy who was too stunned to react had no choice but to grovel on the ground, his face so low he could taste the blood of his brothers on his lips, and pledged allegiance to the priest in the name of his ancestors to save his own skin. This, in Merlock’s tradition, was the highest oath he could make.

At the boy’s pleading, Father Germini halted, lowered his weapon and slowly looked at the scene he had caused. His breaths were heavy, his movements rigid and his limbs were drained of strength. As his eyes drifted from the groveling boy, still too horrified to face reality, he saw it: the bloody spear in his hand, red droplets splattered on his white cassock and ponds of viscos liquid crept toward him, converging into a single mass centered at his feet, formed by the blood of three humans, the boy’s tears and his dreadful sin. The bloody spear hit the ground with a cold, metallic clang, which made the boy shriveled and started begging the priest not to kill him again.

But, Father Germini had stumbled backward, barely remained on his feet, both hands grabbed hold of his own head. Forgive me, Lord! Forgive me, Lord! Forgive me, Lord! So the priest moaned as the boy continued begging for his life. The lantern shield flickered, became dimmer and dimmer until finally it went out, and darkness swallowed them both. Then, the boy felt something sharp, oozy and furry wrapped around his arm and something else sweaty, soft and powerful wrapped around the other arm. These invisible creatures tugged at him, pulling him away from the priest and his brothers. He let out a high-pitched shriek which was muffled almost instantaneously. Nothing else could be heard but the sound of the boy’s feet being dragged away.

Soon, the unseen forces of the void turned their vicious jaws at the priest. Father Germini picked up an eerie sensation of things shuffling around him. He swung his lantern shield in the dark, crouching down and using his sense of touch to search for Sir Rathamul’s corpse, in the process he stumbled upon an oozy, mushy substance on one of the boys’ heads. His hand jerked away from it, his imagination spun wild and he became panicked for he did not recognize what this unknown substance was. Gulping down his saliva, he pressed on and his hand came into contact with a human’s hand so warm that almost felt like it could still be moving. Each artifact he touched fueled his paranoia further; by the time he found the oilskin on the knight’s body and refueled the lantern shield, he was so paranoid that he was convinced Sir Rathamul and the militias were alive and stabbed their dead bodies repeatedly with the spike of the lantern shield.

The fifteen year-old boy, the last survivor of the spear brothers, stiffened in fear by his plight and found it hard to breath. These unknown things had dragged him so far away from the priest that when the lantern light was lit, it appeared to him as a tiny orange dot at the distance. He knew neither what these creatures wanted nor what fate awaited him in the void. He could not cry, he was scared, too scared, in fact, that he could not remember his own name when a familiar voice asked him. His mind blanked out and when he came to be once more, he was already at the crypt’s entrance, next to a smoldering camp fire, next to Sister Forse, who was pouring a waterskin on her dog and washing his fur clean of blood. When asked, she told him that the dog—Dust—could navigate in the dark with his keen noses and ears, and while he had become both blinded and deaf after receiving a shield bash from Sir Winfried, as long as she was there, she could be his eyes, ears and mind.

Her escape in itself was as absurd as the boy’s own. These two children and a dog knocked on the doors of every church, every garrison in the kingdom, hoping someone would believe their story and help them free Father Germini and Sir Winfried from the clutch of that accursed crypt, recover the remains of the fallen ones, and vanquish the evil forces that lurked within. When at long last, the queen of Ironheart agreed to spare them a band of elite knights, who had been close friends of Sir Winfried, and they traveled to the snowy mountain north east of Silver Gallop harbor in order to challenge the accursed crypt once more, the landscape had changed so much that they had to question if their memories were real or dream. After two weeks scouring every crook and cranny of the mountain in search of the crypt without any luck, the party went back to Ironheart, disappointed and doubtful.

While years later the boy had given up the spear and became an apprentice of a blacksmith in Ironheart, he heard Sister Forse had never given up her quest. Last they spoke in Ironheart, she was chasing after the legend of the witches Sir Winfried mentioned in his fit of rage to the forest west of the city, and later her name, too, vanished into obscurity…

Memo: Signal conditioning

This memo will use resistive sensors to demonstrate some signal conditioning techniques.

Resistive sensors are sensors that map a physical quantity such as temperature, light and stress into a corresponding resistance value on their characteristic curves. This resistance represents the physical quantity being measured and it itself needs to be conditioned and measured in the form of electrical signal (voltage / current).

The conversion from resistance into potential differences (voltage) is done, for the most part, via Wheatstone bridge or voltage divider circuit. But the output signal is rarely useful as it is. The signal strength is expected to be in the range of milivolts (if not microvolts) and, at such small values, the signal can become distorted or attenuated during transmission. Below is a number of problems that need to be addressed by the conditioning circuitry.

Signal strength

Electrical noise


DC offset

Phase shift

Impedance bridging

The first thing the conditioning circuit needs to do is to maximize the small signal coming out of Wheatstone bridge. This is achieved by impedance bridging:

An alternative to impedance matching is impedance bridging, in which the load impedance is chosen to be much larger than the source impedance and maximizing voltage transfer, rather than power, is the goal.

In an op-amp circuit, impedance bridging is done by the use of a voltage buffer (unit gain follower). As mentioned in a previous memo, the buffer has incredibly high input impedance and very low output impedance. Therefore, the buffer will draw very little current from the sensor and make sure the sensor will not suffer any voltage drop. It isolates the sensor from the rest of the circuit and prevents disturbances that would otherwise interfere with the sensor’s operation.

Power Source with High Input Impedance
This circuit above now draws very little current from the power source above. Because the op amp has such high impedance, it draws very little current. And because an op amp that has no feedback resistors gives the same output, the circuit outputs the same signal that is fed in.
Signal strength amplification

Next, the small signal needs to be amplified. For normal voltage divider circuits, a non-inverting amplifier will be sufficient.

Non-inverting amplifier

But for Wheatstone bridge circuits, as the signal is the difference between the potentials measured at two midpoints of the bridge, a differential amplifier circuit–which provides both differential and amplifying operations–is used instead. This means the inputs of the differential amplifier should be connected to the two midpoints of a Wheatstone bridge without any inversion in-between.

wheatstone bridge differential amplifier
Wheatstone bridge with a differential amplifier

The differential amplifier and the voltage buffers from the previous step forms an instrumentation amplifier circuit. These are available as IC chips and they provide additional offset compensation capability, which will be discussed in later sections).

Electrical noise filter

Whether it is a few centimeters or a few hundreds of meters, the transmission lines will introduce electrical noises to the signal. Per Johnson-Nyquist noise voltage function, the high impedance of instrumentation amplifier will cause a lot of noises. Worse, the amplification makes not only the signal but also the noise stronger. This is why a filter is commonly found after instrumentation amplifier in conditioning circuits.

The filter of choice is band-pass filter.

But, because estimating the signal band can be problematic, a low-pass filter is a decent alternative; especially considering electrical noises tend to have high frequencies. An active low-pass filter is preferred, second order active low-pass filter if possible.

When all else failed, a passive low-pass filter (R-C circuit) will also do just fine for many applications.

Active low-pass filter = Passive low-pass filter + amplifier

The choice between active and passive filter comes down to cost, board space and whether the benefits provided by the op-amp amplifier (impedance bridging and/or amplification) are desired or not at this point in the conditioning circuitry.

Phase compensation

Taking things one step further, the output signal will inevitably experience some degree of phase shift caused by all the op-amps and filters in the conditioning circuit. A phase-locked loop is used here to synchronize the output frequency to the input frequency and provide frequency scaling if necessary.

There exist PLL circuits that can incorporate the conditioning circuit’s low-pass filter in its construction. But, as stated in PLL memo, it is still easier to buy an IC for this sort of things than to construct one from scratch.

DC offset adjustment

Certain circuit elements and sensor misconfigurations can cause DC offset (aka DC bias) to the output signal. When DC offset happens, the output is shifted by a constant DC value. For example, a pressure sensor at rest can output a non-zero value even without any pressure being applied to it. This offset value needs to be adjustable if one wishes to make full use of the sensor’s output range.

Introducing an adjustable DC power source in the opposite direction to the signal (aka current injection) is the most straightforward way to set the offset. As explained by Russell McMahon from with references to Maxim Application note 803 – EPOT Applications: Offset Adjustment in Op-Amp Circuits:

To compensate for an offset voltage by injecting a current you can apply an adjustable voltage from a potentiometer via a high-value resistor to an appropriate circuit node. To adjust a “ground” voltage that a resistor connects to, you can connect it to a potentiometer which is able to vary either side of ground.

enter image description here

If instrumentation amplifier is used in the conditioning circuit, the ground reference (non-inverting terminal) of the differential op amp can be supplied with an adjustable DC power source:

Figure 4
Adjustment can be accomplished by injecting a small current into the feedback node through resistor RA from a simple voltage source such as a low-cost DAC or a filtered PWM signal from an embedded microcontroller.

With A1 from the circuit above is the instrumentation amplifier whose topology is illustrated below for references:

Figure 2
Instrumentation amplifier topology
Bonus: Lead and contact compensation

A common RTD out there, the PT100 (the serial number indicates the device has a platinum [Pt] sensing wire, which is designed to have a resistance of 100 Ohm at 0ºC) has the following characteristic, according to DIN 43760 standard:

Temperature coefficient of platinum wire is α = .00385.

For a 100 ohm wire, this corresponds to + 0.385 ohms/ºC at 0ºC

This very fine-grain resolution means a minute error of 10 Ohm can result in circa 26ºC error in measurement. Unfortunately, as the measurement leads of all the multimeters and the sensing leads of all sensors have some amount of lead impedance, this impedance will cause measurement errors. On top of that, electrical contacts will have additional resistances due to the oxidization layer on the surfaces of the contacts. This is called contact resistance and this too needs to be compensated during measurement.

To reduce contact resistance and eliminate lead resistance, the resistive sensor in a Wheatstone bridge can be configured in three-wire configuration as follow:

Three-wire resistance thermometer
Three-wire configuration Wheatstone bridge

In this configuration, the two leads of the sensor will be on adjoining arms. There is a lead resistance in each arm of the bridge, so that the resistance is cancelled out if the two lead resistances are accurately the same.

When measuring the resistance directly (without Wheatstone bridge or voltage divider), a similar but different strategy is employed.

Measuring resistance involves passing a small, known current through the resistor and measuring the voltage with a voltmeter. Multimeters, when switched to resistance measuring mode, will supply this current through the leads (this fact can be easily confirmed with a second multimeter measuring the voltage coming out of the leads of the first multimeter in resistance measuring mode). As there is a current passing through them, the lead resistance will introduce reading errors.

Four-wire sensing (aka Kelvin sensing) configuration eliminates this current from the measuring leads, thus eliminating lead resistance from consideration, via the usage of an external DC source. The multimeter is then set to voltmeter mode and the resistance can be calculated using Ohm’s law.

Kelvin sensing configuration



Read more

Memo: Thermoelectric effects

Active sensors require no power source and they produce output signals directly from the measured physical quantity. Active temperature measurement utilizes direct conversion of temperature difference to electric voltage, a physical process known as thermoelectric effects.

Thermoelectric effects is a common name for three separate effects:

Seebeck effect, which is the conversion of thermal to electrical energy in thermocouples

Peltier effect, which is the reverse of Seebeck effect; the conversion of electrical to thermal energy in thermocouples

And Thomson effect, which is the thermal-electrical conversion in homogeneous conductors (alloys and pure metals).

In some textbooks, Seebeck and Peltier effects can be grouped together as Peltier-Seebeck effect. Under this grouping, thermoelectric effect has two entities (Peltier-Seebeck and Thomson effect) both of which are thermodynamically reversible.


The third most common type of thermometer in industrial use is thermocouples. Unlike RTDs and thermistors (which make use of a material’s electrical resistivity and conductivity’s dependence on temperature), thermocouples are active sensors and thus they make use of thermoelectric effects to directly convert thermal energy into electrical signal.

Electrical signal is generated from the temperature difference via Seebeck effect. The voltage output is proportional to the temperature difference between the hot and cold side

Thermocouples are constructed from two dissimilar electrical conductors (can be alloys or semiconductors) forming electrical junctions at different temperatures. The most common thermocouple consists of isolated chromel-alumel wire pair whose Seebeck coefficient (will be explained in the next section, keep it in mind for now) is S = 41uV/K at room temperature, a secondary thermometer for measuring reference temperature (if necessary) and amplification circuits for the output.

Type K thermocouple: the reference is room temperature, the green plug goes into a voltmeter, and the other end goes to the unknown temperature

Of the three popular thermometers discussed so far, thermocouples have the greatest temperature range (up to 2300°C), fastest response time and are immune to self-heating and strain gauge effects.

They tend to cost more than thermistors and less than RTDs; except for some thermocouples that use RTDs to measure reference junction, they will cost more than the RTDs themselves.

Further selling points of thermocouples over its two competitors are its small package size, which can be less than 1.6mm and zero power consumption, being an active sensor and all. They still require conditioning in the form of signal amplifier as their output signal tend to be in microvolt range (though it is unlike the other two thermometers don’t need amplification on top of Wheatstone bridge anyways so the point is moot).

Nevertheless, thermocouples suffer from poor precision and instability; possibly even worse than thermistors in comparable temperatures.

Finally, thermocouples are not absolute temperature sensors, they are relative temperature sensors, ergo, they measure the temperature difference between an unknown temperature and a known temperature. As such, they rely on trusting the reference temperature to stay relatively constant (as in the case of Type K thermocouple) or on another thermometer to acquire the reference. Because of this necessity, errors from acquiring the reference measurement will need to be compensated properly; further worsening the precision of thermocouples and complicating the circuit construction.

Therefore, thermocouples are often used in the context of extensions for other sensors, as in, increasing the temperature range of these sensors and protecting other them from extreme environment. The output voltage is normally taken from the cold side for safety reasons but this is not without exceptions (see hot reference junction strategy)

For the exam, the transfer function of thermocouples is given in the section below.

Seebeck effect

When there exists a temperature difference between two sides of a thermocouple, an electrical voltage is generated across its two junctions. This is one of the three thermoelectric effects called Seebeck effect and it is the core mechanism behind thermocouples. The value of the output voltage to the temperature difference is given by:

{\displaystyle -V=S\Delta T}


S is the Seebeck coefficient, typically in the range of 10-100 uV/K.

\Delta T is the temperature difference between hot and cold sides in Kelvin.

Celsius degrees can also be used here since for temperature intervals 1°C = 1 K.

The Seebeck coefficient given above is relative between two specific conductors. As the absolute Seebeck coefficient is temperature dependent (on top of being material dependent), fixing the absolute coefficient in a system of fluctuating temperature is quite daunting. The relative Seebeck coefficient makes an assumption that the fluctuation in absolute coefficients in both conductors (of a thermocouple) will change at the same rate, thus keeping the relative coefficient temperature independent.

In any cases, this wild leap of faith approximation means devices operating on Seebeck effect (such as thermocouples) have their poor precision and instability rooted at the very foundation; and little can be done to rectify the problem.

Take note that the voltage gradient is perpendicular to the temperature gradient, the voltage and current direction is neither the same nor the opposite direction as the heat flow (they are not even on the same plane!) as illustrated below:

A thermoelectric circuit composed of materials of different Seebeck coefficients (p-doped and n-doped semiconductors), configured as a thermoelectric generator.

However, the direction of the electric current within the load is dictated by two factors: the direction of the heat flow and the relative Seebeck coefficient of the thermocouple.

For example, given the same thermocouple configuration as above, if the hot side and cold side are swapped, the current direction in the load will be reversed. Similarly, if n-doped semiconductor and p-doped semiconductor are swapped, the current will also be reversed. In this case, it achieved the same thing as viewing the thermocouple from the back.

Below is the positive-negative poles mapping for n-doped and p-doped semiconductors in a temperature gradient.

As the above diagram suggested, the polarization within these conductors may result in a bandgap–a non-conductive region at the center, preventing the poles of the same conductor from forming a complete circuit with itself.

Peltier effect

When a voltage is placed across a thermocouple’s two junctions, a temperature difference will appear between the sides of the thermocouple. This mechanism, the Peltier effect, is the thermodynamic reverse of Seebeck effect.

These two polar opposite processes ensure the first law of thermodynamics, the law of energy conservation, is adhered to. So when a thermocouple is heated on one side, the current created by Seebeck effect causes the temperature difference to get smaller and smaller through Peltier effect until the difference is no more.

The Peltier’s configuration is the same as the Seebeck’s one but this time, the cold and hot side swapped place.

Peltier effect sees primary applications in heat pumps and thermoelectric cooling devices, which are expensive and inefficient (due to Joule heating and temperature-dependent nature of Peltier coefficient–same problem as Seebeck coefficient) but extremely durable and small compared to the common vapor-compression refrigeration technology.

Bonus: Thomson effect

For the sake of completeness, let’s discuss a bit about Thomson effect.

To put it bluntly, Thomson effect is Peltier-Seebeck effect for homogeneous conductors. The effect is much less prominent than the other two and it is usually overshadowed by Joule heating and ordinary thermal conductivity.

The current direction of Thomson effect is also material dependent but with many arbitrary rules. To cite Duckworth, Henry E. Electricity and Magnetism (1960):

Thus, in iron, the Thomson emf would would give rise to a current in the iron from hot to cold regions. many metals, including bismuth, cobalt, nickel, and platinum, in addition to iron, exhibit this same property, which is referred to as the negative Thomson effect. Another group of metals, including antimony, cadmium, copper, and silver, display a positive Thomson effect; in these, the direction of the Thomson emf is such as to support a current within the metal from cold to hot regions. In one metal, lead, the Thomson effect is zero. In certain metals the effect reverses sign as the temperature is raised or as the crystal structure is altered.

Read more

Memo: Passive thermometers

Sensors are transducers, or devices that convert a physical quantity into an electrical quantity. There are two main types of sensors: passive and active sensors. Passive sensors require an external power source (aka, excitation signal) while active sensors don’t.

For example, a photoresistor (aka photoconductor, aka LDR) is a passive sensor, requiring an input current while a photodiode is an active sensor, producing a small current via photoelectric effect (like a mini solar panel).

In active sensors, the output signal is generated from the measured quantity and in passive sensors, the excitation signal is modulated by the sensor to produce an output signal.

Resistance temperature detector
Connection leads are almost always insulated (PVC, ceramic, etc.). The protective sheath covering the all-important RTD element (measuring point) is often made of alloy chemically inert to the process being monitored

Resistance temperature detector (RTD) measures temperature using a fine wire of materials that have an accurate (often linear) resistance-temperature relationship. The materials of choice are pure metal, typically platinum, nickle, or copper. RTDs have various constructions but as the RTD elements are fragile, they are often housed in protective casing. Some common RTD constructions are as follow:

Thin film element
Wire wound element
Coiled element

The pros and cons of each design, as well as more designs, can be found from Wikipedia link at the end of this memo.

RTDs are expensive, have low sensitivity, long response time and limited temperature range. At temperatures above 660 Centigrade, even platinum, which has the widest temperature range of RTD metals, will start to become contaminated by impurities from the metal sheath. Replacing metal sheath with glass construction prevents this, as seen in standard laboratory thermometers but this also makes the protective housing far too fragile for industrial uses. Compared to thermistors, platinum RTDs are less sensitive to small temperature changes and have a slower response time. However, thermistors have a smaller temperature range and worse stability.

Two additional issues with RTDs in high precision applications are self-heating effect (thermal error caused by external power source of passive thermometers) and strain gauge effect (resistance changes due to metal expansion and contraction). Nevertheless, RTDs have high accuracy, high repeatability, low drift and very linear response, and they are slowly replacing thermocouples in industrial applications below 600oC.

Just for the exam, a platinum RTD (PT100) has the following transfer function:

R(T) = Ro [1 + A (T – To) + B (T – To)^2]


T: measured temperature in oC

To: base temperature, 0oC

Ro: resistance at To, 100 Ohm

A: resistance-temperature coefficient for platinum, 3.9 * 10^-3 oC^-1

B: 2nd order resistance-temperature coefficient for platinum, -5.775 * 10^-7 oC^-2


According to Wikipedia,

Thermistors differ from resistance temperature detectors (RTDs) in that the material used in a thermistor is generally a ceramic or polymer, while RTDs use pure metals. The temperature response is also different; RTDs are useful over larger temperature ranges, while thermistors typically achieve a greater precision within a limited temperature range, typically −90 °C to 130 °C.

NTC bead.jpg
Negative temperature coefficient (NTC) thermistor, bead type, insulated wires

Thermistors have non-linear characteristic curves (exponential decay) and small temperature ranges. Due to the exponential curves, thermistors tend to have higher sensitivity and shorter response time in a limited temperature range than RTDs though they are also less stable and suffer worse from self-heating effect. They, however, are not affected by strain gauge effect.

Thermistors are simple in construction and can be quite cheap compared to RTDs; especially ones used expensive platinum element.

As thermistors have non-linear characteristic curves, their transfer functions are often modeled by Steinhart-Hard equation–a widely used third-order approximation.

{1 \over T}=a+b\,\ln(R)+c\,(\ln(R))^{3}


T: temperature in Kelvin.

a, b, c:  Steinhart–Hart parameters, specified for each device.

Steinhart–Hart coefficients are usually published by thermistor manufacturers. Where Steinhart–Hart coefficients are not available, they can be derived. Three accurate measures of resistance are made at precise temperatures, then the coefficients are derived by solving three simultaneous equations.

{\displaystyle {\begin{bmatrix}1&\ln \left(R_{1}\right)&\ln ^{3}\left(R_{1}\right)\\1&\ln \left(R_{2}\right)&\ln ^{3}\left(R_{2}\right)\\1&\ln \left(R_{3}\right)&\ln ^{3}\left(R_{3}\right)\end{bmatrix}}{\begin{bmatrix}A\\B\\C\end{bmatrix}}={\begin{bmatrix}{\frac {1}{T_{1}}}\\{\frac {1}{T_{2}}}\\{\frac {1}{T_{3}}}\end{bmatrix}}}

Resistive sensors conditioning with Wheatstone bridge

According to Wikipedia,

In electronics, signal conditioning means manipulating an analog signal in such a way that it meets the requirements of the next stage for further processing.

Signal conditioning and signal processing are two similar but different concepts. Signal conditioning pertains the physical properties of the signal while signal processing pertains the information of the signal.

In general, signal conditioning always happens before signal processing stage. The physical properties manipulation part is a strictly conditioning step while some early signal processing steps can be classified in either stages. Meanwhile, the decision making, or controlling part based on the conditioned input signal is a strictly processing stage.

Resistive sensors such as RTDs and thermistors map physical quantity (temperature) to resistance. While resistance is indeed an electrical quantity, it is not so useful as a measuring signal and it needs to be conditioned into voltage or current. The simplest circuit to measure a resistive sensor is a voltage divider.

A basic voltage divider using just two components rather than the four of the Wheatstone bridge might seem a simpler alternative, but it has many inherent drawbacks which the bridge does not. Image source: Author
Voltage divider

A voltage divider surely does it job for starters but it has many sources of hidden errors making it rather unsuitable for very precise measurement. In this case, a Wheatstone bridge is used.

Wheatstone bridge with arbitrary current assigned for KCL and KVL calculation.

Wheatstone bridge behaves like a scale. When the bridge is balanced, the voltage drop across the galvanometer (VG) is zero. This allows the unknown resistive sensor Rx to be measured as follow:

{\displaystyle {\begin{aligned}{\frac {R_{2}}{R_{1}}}&={\frac {R_{x}}{R_{3}}}\\[4pt]\Rightarrow R_{x}&={\frac {R_{2}}{R_{1}}}\cdot R_{3}\end{aligned}}}

The above equation can be proven with Kirchhoff’s current law (KCL) and voltage law (KVL) easily. A more practical relationship is the transfer function of the circuit as follow:

{\displaystyle V_{G}=\left({R_{2} \over {R_{1}+R_{2}}}-{R_{x} \over {R_{x}+R_{3}}}\right)V_{s}}

In which

R1 and R3 are normally set to equal.

R2 is a variable resistor that adjusts the sensitivity of the bridge.

Bonus: Semiconducting diode thermometer

Another popular passive (but not resistive) thermometer is the Semiconducting diode thermometer or Silicon bandgap temperature sensor. This device is a diode that allows some current flow proportional to absolute temperature.

The voltage difference between two p-n junctions (e.g. diodes), operated at different current densities, is proportional to absolute temperature (PTAT).

The PTAT device has a linear characteristic curve and can be cheaply included in a silicon integrated circuit. However, it has poor precision and very limited temperature range compared to other thermometers. As it can only be manufactured via sophisticated semiconductor technologies, viz. doping and such, it is not very relevant to engineering study at university level.

There exists a metallic counterpart of silicon bandgap thermometers that is a passive and resistive thermometer basing off Coulomb blockage phenomenon. See Coulomb_blockade#Coulomb_blockade_thermometer for more information.