From the left in Figure 9-1 are the thermocouple, the TMP36, an epoxy-coated thermistor, a glass-coated thermistor, a second smaller glass-encased thermistor, and an EPCOS microbead, glass-coated thermistor. Although the three-terminal TO-92 IC temperature sensor is the largest of the common sensors, it is the least complex to integrate into experimental setups for use within the –55 to 125°C temperature range.
IC-based Sensors
Comparison of Solid-State Temperature Sensors
- |
LM35 is available from suppliers at $3 per piece, and the TMP36 is $2 (CDN).
In an experimental measurement of low quantities of heat exchange in which temperature differentials of less than a half or a quarter of a degree Celsius are generated, the investigator may use a thermistor or increase the sensitivity of a readily available IC-type temperature sensor with a microcontroller and an “analog front end” (AFE).
Very sensitive medical diagnostic equipment for measuring the electrical signals from nerves, hearts, and brains, along with physio-chemical instrumentation for potentiometric gas sensors and pH acid–base monitors, have used AFEs for many years. An AFE for use with much simpler, less expensive, microprocessor-based experimental measurement systems has been described in the February 2016 issue of Nuts and Volts magazine (NandVM) by Prof. E. Bogatin.1
Microcontrollers
A typical microcontroller is equipped with a 5V analog-to-digital converter (ADC) that in the case of an Arduino is a 10-bit converter able to resolve 5V/1024 or 4.883mV per analog-to-digital converter unit (ADU). If the sensor and ADC are powered by the less noisy 3.3V supply, then the conversion factor drops to 3.22mV/ADU. If the experiment at hand will only generate very small changes in temperature, the data sheets for the IC-based temperature sensors indicate that we will be dealing with low voltage-difference values. A distinct increase in system sensitivity could be realized if the small analog signal developed by the low-level operations were amplified to a value close to, but less than, the 5 or 3.3 volts maximum response available for the ADC in use. By using a pre-amplifier we can re-scale or move our low-level-voltage experimental signal that will activate only a small portion of the full ADC range to one that will activate a large portion of the converter’s total span. If it is known that an experiment will only generate at a maximum, 1¼V differentials, then a pre-amplifier with a gain of 4 would allow our readout signal to use close to the full 1024-bit resolution of the converter. In theory, the resolution of our 5V sensor readout has been increased from 4.884mV to 1.22mV per ADU. If the less noisy 3.3V supply on the Arduino is used as an AFE power source then the increase in resolution is the same for the proportionally lower operating voltage range at 0.805mV/ADU.
Amplification of DC signals is usually effected with operational amplifiers. In addition to amplifying a low-voltage signal, the configuration of the op-amp can be used to adjust the output impedance for the sensor. It has been noted in the NandVM reference that the Arduino’s Atmega328 IC manual indicates that the ADC input has a capacitance of 14 pF. Recalling the properties of capacitors, a capacitor requires a certain amount of time to charge up to its final voltage as determined by the circuit RC product. A current flowing through a resistor into a capacitor charges the capacitor until the voltage across the plates equals that of the charging signal. Once the capacitor on the ADC input has stabilized at the level generated by the sensor, the ADC can accurately convert the voltage into ADC units. It is recommended by the manufacturer of the Atmel 328 chip that the input resistor on the ADC input should be less than 10 kΩ so that the voltage on the capacitor of the input channel has stabilized before the conversion is begun.
Examination of the data sheets for the IC sensors indicates that the quiescent current for the devices is nominally 50 μA. If measured temperatures are such that the output voltage is in the range of 11/4 V then the output impedance is 1.25V/ 50 x 10-6 A or 25 kΩ, which is substantially higher than recommended for the Arduino CPU input pins.
Operational Amplifiers
Operational amplifiers (op-amp) are a host of integrated circuits based upon the idealized concept of the perfect, theoretical DC amplifier. An ideal op-amp has infinite open loop gain, infinite input impedance, zero output impedance, infinite bandwidth, and zero output voltage, with no voltage across the input terminals. The ideal op-amp has a pair of differential inputs termed the inverting and non-inverting inputs that invert or reproduce the voltage of the respective inputs at the device output.
Operational amplifiers are the descendants of analog computers once used to perform mathematical operations in many linear, non-linear, and frequency-dependent circuits. Integrated circuits such as the general-purpose μA709 introduced in 1965 and the μA741 first produced in 1968 and still in production today are reasonable approximations to the ideal DC amplifier concept.
In the application at hand, an analytical front end (AFE) is being assembled from a general-purpose operational amplifier and a special-purpose ASIC in which three general-purpose operational amplifiers have been fabricated onto a single chip in an arrangement known as an instrumentation amplifier.
Circuit A illustrates the essential configuration of an op-amp. The op-amp device has a substantial input impedance between the inverting and non-inverting input terminals. When connected to a signal source some current must flow through the input terminals, and this signal voltage must drive the current through some form of resistance that can be represented as the input impedance. As is illustrated in circuit A, the input impedance is in parallel with the signal source. At the output terminals of the device there is a theoretical resistor in series with the current flow from the amplifier. As more current is drawn from the amplifier, the voltage will drop in proportion to the internal output impedance of the device.
Circuit B depicts an op-amp circuit in which two amplifiers have been “cascaded” so that the output from amplifier A can serve as the input for amplifier B. The main point to be observed is that the output impedance of amplifier A and the input impedance of amplifier B form a voltage divider. To optimize the signal transfer from the output of amplifier A to the input of amplifier B, the output impedance of A should be substantially smaller than the input impedance of amplifier B.
Within the AFE, the op-amp has amplified the DC signal from the sensor. An amplified millivolt signal from the pre-amp is applied to the positive input of the in-amp, and the inverting input of the in-amp is provided with an adjustable positive DC voltage from the multi-turn potentiometer. With an equal positive DC voltage applied to both of the inputs of the in-amp, its output is zero. If the sensor responds to a small temperature change in its surrounding environment, the pre-amp amplifies the sensor output that in turn increases the voltage on the in-amp non-inverting input. The inverting input is at a fixed voltage as determined by the potentiometer setting. Only the difference between the inputs is the portion of the signal that is amplified by the in-amp. The non-inverting input has been adjusted to match the quiescent value from the pre-amp so that the in-amp will only respond with an amplified output when the output from the pre-amp increases.
The in-amp provides the final amplification of the AFE by responding only to the change in the pre-amp output.
After the AFE has been assembled on either a prototyping or printed circuit board, the system must be configured properly in order to function. An IC temperature sensor typically produces a 10mV/°C voltage that at room temperature is approximately 250mV. An op-amp amplification of 3 or 4 brings the voltage up to approximately 0.75V or 1V. (Adjustments must be made in the microprocessor voltage to temperature-transfer function or calculation software to accommodate the temperature sensor in use; TMP36 has an offset while the 35 devices do not.)
As outlined, an instrumentation amplifier is used in the AFE to remove the bulk of the DC signal present in the op-amp output. Instrumentation amplifiers only amplify the voltage difference between the inverting and non-inverting inputs. Examination of the circuit in Figure 9-3 shows the inverting input connected to the wiper of a potentiometer able to supply up to 3.3V of DC signal to the instrumentation op-amp. The in-amp has a gain of ten, so with a meter connected across the in-amp inputs the wiper is adjusted until the voltage difference is as close to zero as possible. At room temperature with the author’s circuit assembled on a prototyping breadboard, the minimum value obtainable was 10.3mV. When tested with a meter, the AFE output varied from 10mV to 3.7V with the application of finger heat to a TMP36.
Figure 9-4 is a graphic demonstration similar to that depicted in the NandVM reference given earlier in which the outputs from the three stages of the AFE to the application of finger heat on the sensor are qualitatively displayed. Building the AFE from two discrete ICs and resistors on an unshielded prototyping breadboard and using theoretical calculations to generate a temperature from the voltage seen at each test point in the AFE has produced the three different temperature measurements for the sensor output.
The true sensor temperature recording in blue displays the low resolution provided by the direct analog-to-digital conversion of the sensor data into a “stepped” digital format. The green trace is the temperature as calculated by the ADC microcontroller–augmented output of the op-amp AFE section, and the black trace is the apparent final-stage temperature as calculated from the in-amp output.
In Figure 9-5, the analog voltage signal from a TMP36 sensor has been processed by the author’s breadboard prototype analog front end throughout the 1°C temperature differential induced in an insulated dry well. All three stages of the AFE have been normalized by adjusting the microprocessor software voltage to temperature-transfer functions for each stage to output a value close to 20°C. It has been assumed and confirmed by the dry well’s mercury-in-glass thermometer that the raw TMP readout is in accordance with the manufacturer’s suggested theoretical calculation to generate a temperature value within the specifications detailed in Table 9-1. To normalize the pre-amp output, the temperature calculation based upon the observed voltage at the test point is divided by the op-amp gain before the temperature is calculated. As can be seen in Listing 9-1, an additional offset correction of approximately 50 was required to normalize the op-amp output to the desired 20°C value (all code listings provided at the end of the chapter). The op-amp gain resistors as seen in Figure 9-3 are 5% tolerance, 10 kΩ and 22 kΩ values, that provided a measured 3.12 gain factor. As noted, an instrumentation amplifier only measures the difference between the inverting and non-inverting inputs. If the in-amp inverting input voltage is adjusted to match the constant voltage output from the pre-amp then the in-amp has nothing to amplify. A 5% tolerance 10 kΩ gain resistor has been chosen for the in-amp final stage of the AFE. (An 11 kΩ 1% tolerance resistor is required to achieve a gain of 10 in the AD623 in-amp.) Examination of the code in Listing 9-1 will reveal that the in-amp output value has been normalized by dividing the observed voltage by approximately 30, the total gain of the AFE, and correcting the calculated temperature with an offset of approximately 20 to achieve the desired 20°C normalized recorder trace.
In Figure 9-5 the black trace of the Arduino ADC output consists of three voltage levels corresponding to two ADC “steps.” The thermometer appeared to transit from 193/4 to 203/4°C, and the graphical record suggests that the temperature differential may not have been a full degree. Each ADC step is 3.22mV, and a full degree temperature change should have produced three 3.22mV steps in the 10mV/°C response of the sensor. The op-amp output in blue and the in-amp output in green have been normalized and can be used with a scale expansion in the plotting program to gain significantly increased sensitivity if desired.
Conducting a second thermal-difference experiment to generate twice the expected trace deflection essentially confirms the observations seen in the primary measurement. Although the mercury-in-glass thermometer appeared to measure a one- and two-degree difference from the incremental timed application of electrical energy, both graphical temperature deflection records are lower than expected.
If the mercury-in-glass thermometer is taken as the primary standard, then in both of the tests the stepped response is one and two units less than expected.
TMP36 and LM35 both have sensitivities of 10mV/°C, and a single-degree temperature change should produce a 10mV/3.22mV/ADC unit or 3.1 ADC steps.
As can be seen in Figure 9-10, the terminal board has connections for the cable-shielding ground (silver wire on the left), the signal ground (black wire), the signal wire (white wire), and the 3.3V power to bias the sensor. The “Pot. Adjust” label identifies the potentiometer wiper-adjusting screw slot used to balance the inputs of the instrumentation amplifier in the output stage of the AFE. (The potentiometer is held/glued in place by a short bar passing through the forward mounting hole in the device.) (The front face–mounted terminal board can also be used to add high-value capacitors to filter out excessive voltage spikes in electronically noisy environments.)
Item 3 is the multi-turn potentiometer used to balance the inputs of item 6, the AD623 instrument amplifier. Caption 4 is between the mounting bolts of the terminal board with the system ground tab on the right. Item 5 is the dual op-amp LM358. Both of the integrated circuits are mounted in 8-pin DIP sockets to avoid possible heat damage to the chips during initial assembly and facilitate IC replacement if necessary.
Connections between the sensor, pre-amp and in-amp outputs, and the Arduino ADC are made using the input headers of the shield at caption 7. A dual-channel terminal board, item 8, connects the inverting input of the in-amp to the wiper of the potentiometer and provides 3.3V power to the sensor-biasing terminal “P” on the front panel.
One of the major practical applications of the AFE is to augment the sensitivity of a temperature measurement. Immersed in a liquid or fluid, changes in temperature often accompany chemical reactions or changes of physical state in the fluid medium. In many sciences, samples requiring analysis or testing are of very limited size having been recovered from biological systems or as residues or remnants of materials involved in failures and hence must be processed with the maximum sensitivity available. An AFE allows the investigator to work with IC sensors compatible with smaller masses and the reduced temperature differentials generated within these scarce samples.
Working on a smaller scale is possible with the plastic sensors illustrated in Figure 9-1, and increasing the sensitivity of the IC devices provides an easily implemented temperature monitor. Equipping a small 25 to 30 ml plastic container with a stirring apparatus and a temperature sensor can create a miniature calorimeter with which to follow thermometric changes in liquid systems.
Items 2 and 3 are wooden blocks drilled vertically to accept the ½ in. (12 mm) dowelling of the lab stand, item 8. The drilled mounting blocks are held in place with #10-32 machine screws (1/8 in. diameter, 32 threads per inch (tpi), 3 mm diameter, 32 threads per 2.45 cm). The machine screws are parallel to the lengthwise, horizontal center line of the blocks that run through 32 tpi nuts cemented to the flat ends of the mounting blocks to tighten against the lab-stand shaft. As can be seen in Figure 9-12, the machine-screw heads have been cemented to 11/2 in. (38 mm) diameter, 1/8 in. (3 mm) thick disks of plywood to allow finger adjustments of the block positions.
Item 1 is a 50 ml volume test vessel, while a 25 ml vessel and a 0.113 cm3 aluminum-bar powder measure are seen in the lower left-hand field of view between the reference rule and the top of the larger vessel. (The larger measure’s top depression was formed by drilling a 3/8 in. diameter cavity 3/8 in. deep into the ½ x ¼ in. (12 x 6 mm) aluminum-bar stock.)
Caption 1 identifies the right-angled 1/8 in. (3 mm) “crank” that engages the servo motor horn or bellcrank, which is 73/4 in. (19.5 cm) from the 1/8 in. hole perforated-disk base plate identified as item 2 in Figure 9-16. The pushrod was fabricated from 0.025 in. or 22 ga (0.64 mm) diameter piano wire. The pushrod was bent so the main long shaft of the rod was perpendicular to and concentric with the flat plane of the agitator disk and its supporting z-shaped bent-wire pattern identified as item 3 in Figure 9-16.
Plywood to steel machine screw, spring steel to PET plastic plate, and wood cementing were all accomplished with cyanoacrylate adhesives that have yet to show any signs of deterioration after months of service. Cyanoacrylate glue was also used as a sealant around the base of the LM and TMP IC temperature sensors. The three lead devices were soldered to the red power, black sensor ground, and white signal, shielded, triple-wire 24 ga twisted conductor cables. Prior to soldering, short lengths of heat-shrink tubing were fitted over the plastic insulation of the three cable conductors, and after lead soldering the heat-shrink tubing was positioned over the solder joint abutting the base of the IC and shrunk. The three insulated connections were then coated with liquid plastic insulation to further protect and stiffen the electrical connections. Prior to testing the sensor in a solution media, the joint at the base of the IC and the plastic coating on the cable end were coated with several applications of cyanoacrylate glue to ensure a watertight connection.
Two Arduinos were eventually used by the author when single programs written to both measure the temperature and stir the solution produced random errors in the temperature readings.
Recall that the USB software enumerates the hardware on the bus and loads the appropriate driver software such as the COM ports as required. To set up the calorimeter the first Arduino is launched then activated to either measure or stir, and when its operation has been validated the GUI is minimized. A second instance of the Arduino IDE is then launched loaded with the appropriate code and assigned to a second COM port for controlling the second operation.
Listing 9-1 is the microprocessor code for monitoring and normalizing the three stages of the AFE. Listing 9-2 is the Arduino code for controlling the vertical oscillations of the servo motor, while Listing 9-3 is the DAQFactory sequence for receiving and plotting multiple serial port–transmitted data.
Calorimeter Testing, Validation, and Applications
To generate any reliable thermometric data using an IC with augmented temperature sensitivity, all reagents and test equipment must be at the same initial temperature. If experiments are to be conducted at room temperature, the investigator must ensure that the room temperature is constant and that the apparatus and reagents have reached thermal equilibrium with the immediate environment.
In the following two figures the temperature decreases have been created by the dissolution of 0.113 cm3 (0.0069 in.3) of the nominal finely powdered salts in 50 ml quantities of water.
The trace at caption 1 represents the recorded temperature of the agitated water charge prior to the introduction of the sodium bicarbonate (NaHCO3) . The “spike“ between captions 1 and 2 was caused by the author striking the IC probe with the powder scoop while dispensing the first portion of the salt. The five portions of salt powder show a reasonable reproducibility, with 3 showing the greatest heat uptake and 5 the least. Portions 2, 3, and 4 were measured as soon as the recorder trace appeared to resume a constant temperature. Portions 4 and 5 were allowed to run for greater lengths of time to illustrate that these measurements were actually being made under conditions that only initially approximated adiabatic conditions. (Under adiabatic conditions heat is not exchanged with the system environment.) To definitively measure the heats of dissolution, accurate weights and purity of reactants together with increased vessel insulation would be required to achieve substantially better reproducibility from which to extract more definitive data with statistical significance.
Figure 9-19 displays a similar pattern of reasonably reproducible endothermic heat uptakes by the dissolution of the various portions of sodium chloride powder (NaCl). Caption 1 again identifies a constant temperature in the 50 ml charge of water in the test vessel. Caption 2 identifies the observed temperature decrease in the water as the agitated two-phase system is converted into a homogeneous, single-phased solution.
Preliminary testing of the temperature change to be expected with the dissolution of common table sugar (sucrose C12H22O11, a glucose fructose disaccharide) indicated that the 0.113 cm3 powder scoop did not dispense enough material, even using several sequential portions, to produce a strong reproducible signal. To offset the expected low heat of solution a level teaspoon measure (4.93 ml) was used to increase the system response. An alternate method for increasing the signal response for these types of experiments is to decrease the mass of the water solvent to 25 ml.
Vinegar and baking soda are two foodstuff materials that can be used with the apparatus displayed in Figures 9-12 to 9-17 to generate a graphical recording of an emulated titration reaction.
Vinegar is a 5% v/v solution of acetic acid (CH3COOH) in water, and food-grade baking soda is a relatively pure powder of sodium bicarbonate (NaHCO3). Figure 9-21 was generated by monitoring the solution temperature of a 50 ml portion of vinegar as 0.113 cm3 portions of sodium bicarbonate were added to the agitated solution. Powder additions for the first few increments should be dispensed carefully as carbon dioxide is generated in accordance with the following;
CH3COOH + NaHCO3 → CH3COONa + H2O + CO2↑
The portion of the recording identified by caption 1 in Figure 9-21 is the downward temperature drift of the system. In general it can be seen that as the number of additions of powdered baking soda increases the solution cooling effect decreases. As the system temperature cools, the heat inflow after the addition of the powder causes the baseline to drift sharply upward. After the addition of 13 powder portions, the solution temperature stabilizes at approximately 15.8°C.
To convert the incremental powder addition of Figure 9-21 into a thermometric titration to determine the actual strength of the acetic acid in the vinegar, the solution temperature would be monitored as a function of the milliliters of standardized sodium bicarbonate solution added to the vinegar aliquot taken for testing. The end point for the titration would be located at the point where the temperature trace ceases to decrease and becomes a constant value. For further details, the researcher can consult the substantial literature that exists on the methods of thermometric titrations.
Code Listings
Arduino Code for Temperature Monitoring and Serial Port Data Transmission
Arduino Code for Serial Port, Single-Character Control of Stirring/Agitation Servo Motor
DAQFactory Sequence for Plotting of Multiple Data Streams from the Serial Port
Summary
An AFE can be built from readily available, inexpensive op-amps to overcome the digital limitations to experimental measurement sensitivity imposed by microprocessor ADCs.
Using a printed circuit board and a protective metal case, an AFE can increase temperature resolution to be used with aqueous thermal analysis projects.
In Chapter 10, a technique to decrease the noise in a stream of sensor data is introduced and demonstrated.