© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2021
R. J. SmytheAdvanced Arduino Techniques in Sciencehttps://doi.org/10.1007/978-1-4842-6784-4_9

9. Analytical Front Ends

Richard J. Smythe1  
(1)
Wainfleet, ON, Canada
 
In previous work dealing with the measurement of heat and temperature, the physical, performance, and monetary costs of the various readily available, inexpensive temperature sensors were reviewed and are pictured in Figure 9-1. Included in the photo is the original large, black, plastic square LM35 device, which is direct-reading, calibrated, and temperature-sensitive. Newer integrated circuit (IC) devices, including the TMP35, 36, and 37, are all available in the three-lead T3 (TO-92) packages, which are large and bulky in comparison to the microbead glass thermistors and thermocouples also depicted in Figure 9-1.
../images/503606_1_En_9_Chapter/503606_1_En_9_Fig1_HTML.jpg
Figure 9-1

Relative temperature-sensor sizes

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

The IC-based sensors are inexpensive; have a linear, calibrated, temperature voltage output over their specified range; are relatively sensitive; and are conveniently read with simple computer code. The LM35/TMP36 IC–type temperature sensors do not require a cold junction. Table 9-1 is a comparative tabulation of many of the thermal and electronic properties of the application-specific integrated circuit (ASIC) sensors.
Table 9-1

Comparison of Solid-State Temperature Sensors

-../images/503606_1_En_9_Chapter/503606_1_En_9_Figa_HTML.jpg

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.

In Figure 9-2 three op-amp circuit configurations are displayed as A, B, and C that help to illustrate the functions that make up an analog front end.
../images/503606_1_En_9_Chapter/503606_1_En_9_Fig2_HTML.jpg
Figure 9-2

Op-amp circuits used in a temperature sensor analog front end

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.

Circuit C is a block diagram of a three op-amp configuration termed an instrument amplifier (in-amp). Instrument amplifiers are available as a single-unit IC as dual inline packages (DIP) and as surface-mount technology (SMT)–format ASIC. In-amps are very high input impedance, dedicated, dual-differential input amplifier devices that buffer the voltage source with a pair of op-amp followers on the input circuitry. The gain of the device is controlled by a single externally mounted resistor that can vary the gain from unity into values in the thousands. (See “gain resistor” in Figure 9-2, circuit C, and consult the data sheet for the device in use.) Because in-amps are differential input devices, the output may or may not be isolated from the system ground. In the circuit of Figure 9-3, based upon reference 1, the analytical front end in-amp is referenced to the system ground and the separate reference output terminal of the AD623 must also be connected to the system ground.
../images/503606_1_En_9_Chapter/503606_1_En_9_Fig3_HTML.jpg
Figure 9-3

The circuit for a high-sensitivity temperature measurement analog front end

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.

As can be seen in Figure 9-4, when assembled, adjusted, and programmed with the theoretical voltage-to-temperature conversions, the three test points of the author’s reproduced AFE generate different values in response to finger heat on the sensor.
../images/503606_1_En_9_Chapter/503606_1_En_9_Fig4_HTML.jpg
Figure 9-4

Recorded temperature outputs for the stages of the analog front end

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 order to quantitatively demonstrate the operation of an AFE built for experimental determinations such as the higher-resolution monitoring of small temperature changes, a defined quantity of electrical heat energy sufficient to generate a 1°C change in a dry-well temperature was used to produce the traces depicted in Figure 9-5. (See Chapter 3, “High Heat and Temperature,” Figure 3-3, “A laminated aluminum plate dry well”).
../images/503606_1_En_9_Chapter/503606_1_En_9_Fig5_HTML.jpg
Figure 9-5

A 1°C temperature differential normalized outputs for the elements of the analog front end

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.

A second temperature-increase experiment was conducted at twice the heating time (i.e., five minutes) to produce a set of recordings that can be compared with the initial observations made in Figure 9-5. Figure 9-6 illustrates the normalized temperature values seen at the outputs of the AFE components.
../images/503606_1_En_9_Chapter/503606_1_En_9_Fig6_HTML.jpg
Figure 9-6

A 2°C temperature differential normalized outputs for the elements of the analog front end

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.

A low voltage at the output of the sensor could be caused by excessive current draw by the preamp, and a voltage follower between the sensor and pre-amp may lessen the voltage drop. An experimental modification to the AFE circuitry in Figure 9-3 was made by wiring in a voltage follower with the unused op-amp in the LM358, as seen in Figure 9-7.
../images/503606_1_En_9_Chapter/503606_1_En_9_Fig7_HTML.jpg
Figure 9-7

The voltage follower–modified AFE circuit

Figure 9-8 indicates an improvement in the circuit response that could be attributed to the insertion of the voltage follower into the pre-amp input.
../images/503606_1_En_9_Chapter/503606_1_En_9_Fig8_HTML.jpg
Figure 9-8

A 2°C temperature differential with voltage follower

A second prototype, high-sensitivity, analytical front end temperature-measurement circuit was assembled on an Adafruit Industries prototyping shield for the Arduino microcontrollers (P/N 2077 $15 USD for kit). A blank shield for assembling prototype circuits is depicted in Figure 1-2 of Chapter 1, “Arduino and Raspberry Pi.” An Arduino shield platform was chosen in order for a compact device to result that could be fitted inside a grounded metal case with a small benchtop footprint. Figure 9-9 is a block diagram–schematic that was built around two 8-pin DIP sockets to hold the dual op-amp and in-amp ICs. A terminal board with wiring access holes to the interior of the enclosure was mounted on the front plate of the metal case in which rectangular cutouts for the Arduino USB, auxiliary power plug, and set-screw of the in-amp inverting input-voltage adjustment potentiometer were cut.
../images/503606_1_En_9_Chapter/503606_1_En_9_Fig9_HTML.jpg
Figure 9-9

AFE PCB or perfboard circuit configuration

Figure 9-10 depicts the front face of the second prototype AFE during a low-temperature water ice testing validation.
../images/503606_1_En_9_Chapter/503606_1_En_9_Fig10_HTML.jpg
Figure 9-10

AFE low-temperature water ice validation

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.)

In Figure 9-11 the base of the metal case was covered with a thin layer of scrap polyethylene plastic perforated with four holes to hold the mounting bolts in position while the stand-offs, seen to the left and right of caption 1, were placed over the bolts to fix the blue Arduino board, item 1, in place and allow the green shield, item 2, to be press fitted into the main board.
../images/503606_1_En_9_Chapter/503606_1_En_9_Fig11_HTML.jpg
Figure 9-11

Arduino with AFE shield-mounted circuitry

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.

Figure 9-12 depicts a simple solution calorimeter or heat-monitoring system. Item 1 is an Arduino temperature monitor, fitted with an AFE to augment the sensitivity of the wooden dowel–mounted probe tipped with a TMP36 temperature sensor, captioned as item 6. To ensure homogeneity in the fluid medium under study, a stirring blade or agitator, item 7, for the miniature calorimeter has been assembled from a second Arduino at caption 2 and a small servo motor, item 4. Brushless DC and stepper motors have been used in previous work but for a low-mass heat monitor such as this calorimeter system, a small servo motor was chosen to power an agitating system. Very small and inexpensive servo motors such as the Tower Pro Micro Servo 9G units are available online and from hobby shops ($5 CDN). The lightweight, powerful gear-reduction miniature servo motors are sold with screw-mounted four-, two-, and single-arm “horns” or “bellcranks.” By mounting the motor on its side so the horn/bellcrank moves in a vertical oscillation of 7/16 in., or 11 mm, a variable agitation action can be realized. Agitator speeds can be adjusted by altering the delay(n) millisecond values in the testNuChar() functions of Listing 9-2. A 15 ms delay produces approximately 1 stroke in 2 seconds, a 10 ms delay creates approximately a stroke per second, while a 5 ms delay oscillates at a little less than two strokes every second.
../images/503606_1_En_9_Chapter/503606_1_En_9_Fig12_HTML.jpg
Figure 9-12

A simple solution-agitated calorimeter

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.

Figure 9-13 provides a close-up view of the servo motor mounting, horn/bellcrank push-rod configuration, and adjustable temperature sensor-probe mounting. Item 1 in Figure 9-13 identifies a group of plastic film shims that are used to maintain a vertical alignment of the temperature probe and pushrod with respect to the lab stand. Caption 2 marks the clamp positioning the ¼ in. (6 mm) dowel to which the TMP36 IC sensor wiring has been clamped with small cable ties. Captions 3 and 4 mark the servo motor and the horn pushrod assembly that drive the agitator disk in the calorimeter vessel.
../images/503606_1_En_9_Chapter/503606_1_En_9_Fig13_HTML.jpg
Figure 9-13

The adjustable mountings of the servo motor and independent temperature sensor probe

Figure 9-14 provides a detailed view of the Arduino used to control and power the vertical agitator servo motor. The alignment shims are labeled as item 1, item 2 is the backside of the servo motor, and item 3 is the mounting platform for the servo control microprocessor. Also visible in the figure are the details of the servo motor mounting and the mechanism for the independent adjusting of the temperature-sensing probe.
../images/503606_1_En_9_Chapter/503606_1_En_9_Fig14_HTML.jpg
Figure 9-14

Servo motor Arduino controller

In Figure 9-15, a typical preparation for a calorimeter experiment is presented. A typical 50 ml vessel is indicated by caption 1, and a 25 ml container is seen at the lower-left corner of the lab-stand base. Item 2 is the agitator platform, shown in greater detail in Figures 9-16 and 9-17. To prepare for an experiment, the spacer block, item 4, is inserted beneath the vessel of choice, and the heights of the temperature sensor and oscillating plate are adjusted. The sensor must be completely immersed in the solution under test. The oscillating plate must not contact the bottom of the vessel nor the temperature sensor during its vertical travel.
../images/503606_1_En_9_Chapter/503606_1_En_9_Fig15_HTML.jpg
Figure 9-15

A typical preparation for a calorimeter experiment

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.)

A gentle fluid agitation device was created by cementing a perforated clear PET (polyethylene terephthalate) plastic disk to a wire “zigzag” platform bent into a piano wire. The angled bends form a flat base or surface on the push rod so the plane of the 1¼ in. (30 mm) disk was at right angles to the vertical oscillations of the servo motor. The details of the agitator plate are depicted in Figures 9-16 and 9-17.
../images/503606_1_En_9_Chapter/503606_1_En_9_Fig16_HTML.jpg
Figure 9-16

A bottom view of the agitator plate

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.

Figure 9-17 depicts the bottom end of the long pushrod shaft as item 1. The configuration of the supporting wire prior to passing through a hole located on an edge of the perforated-disk agitation plate, item 2, is shown.
../images/503606_1_En_9_Chapter/503606_1_En_9_Fig17_HTML.jpg
Figure 9-17

Agitator plate side view

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.

Stirring a fluid can add energy to the liquid system and create heat; thus, any stirring action must be gentle and controlled in order to not add measurable energy to the liquid. As can be seen in the following qualitative and semi-quantitative demonstrations, the strip-chart recording method of data collection for this type of measurement provides several advantages over the collection of time-stamped numerical value lists. A level stable baseline is easily recognized by the human eye and allows the investigator to conduct multiple sequential experiments, as depicted in Figures 9-18 to 9-21.
../images/503606_1_En_9_Chapter/503606_1_En_9_Fig18_HTML.jpg
Figure 9-18

Sodium bicarbonate heat of hydration

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.

In Figures 9-18 and 9-19 the signals from all three test points from the AFE are recorded, while in Figures 9-20 and 9-21 only the final stage output is displayed.
../images/503606_1_En_9_Chapter/503606_1_En_9_Fig19_HTML.jpg
Figure 9-19

Reproducibility of heat of hydration sodium chloride

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.

In Figure 9-20 the left-hand temperature scale has been adjusted so the signal recordings for the IC and the preamp stages of the AFE are off-scale and do not clutter the final stage display. One of the advantages of the strip-chart recorder displays in experimental work can be seen in the constant “drift” from 17:15 at 21.25°C to 17:53 at 20.70°C. In spite of the drift, the heat-of-solution measurement can still be made at 17:31. The important information is contained in the temperature decrease recorded at 17:31 from 21.00°C to 20.85°C at 17:35. The initial heat uptake by the dissolution of the larger portion of solute generates an initial temperature decrease that causes the solution to behave initially as an adiabatic system. However, as the temperature drops by 0.15°C to an apparently constant value, the reproducible, virtually linear overall system heat loss to the environment is reestablished at 17:36.
../images/503606_1_En_9_Chapter/503606_1_En_9_Fig20_HTML.jpg
Figure 9-20

Heat of hydration sucrose

As noted in the previous text, the greatly augmented IC temperature sensitivity provided by a microcontroller AFE is especially useful for the chemical analysis methodology of titrations. Titration methods in which standardized solutions are used to determine the concentration of solution under test use many different visual or electrochemical methods to determine the titration reaction end or equivalence point. Many titration reactions can be followed by monitoring the solution temperature as the standardized solution is added to the solution under test. A simple, semi-quantitative emulation of a titration using innocuous, readily available reagents is presented in Figure 9-21.
../images/503606_1_En_9_Chapter/503606_1_En_9_Fig21_HTML.jpg
Figure 9-21

Heat of reaction acetic acid and sodium bicarbonate

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

// Low noise 3.3 Volt TMP36 – LM35 Temperature Sensing
// 3.3 Vlts used to bias sensor and re-define ADC range to 3.3 volts.
// Adjusted ADC units seen on A0, A1 and A2 monitoring TMP36/LM35, pre-amp and in-amp
// outputs of the AFE used to calc. sensor temp. offset constants and gains
// arbitrarily adjusted to calculate relatively the same temp values for each AFE stage.
// LM35 is 10mV/deg C and uses no offsets
//
int sensePin = A0;           // the sensor output monitor
int preampPin = A1;          // preamp output
int afePin = A2;             // AFE output
int sensorInput;             // variable for sensor input
int preampOutput;            // preamp output variable
int afeOutput;               // AFE output variable
double temp;                 // variable for temperature in degrees C.
float patemp;             // gain corrected preamp temperature
float afetemp;               // AFE relative temperature
double sumTobeAvrgd = 0;     // averaging sum
double avrgTemp;             // averaged temperature value
int cntrIndx = 0;            // counter index or number of points to average
int numPtstoAvrg = 100;      // define number of points to average
 //
void setup() {
  // setup code runs once:
  Serial.begin(9600);        // start serial port at 9600 baud
  //
  analogReference(EXTERNAL); // declare external reference for inputs
}  // end of set-up
//
void loop() {
  // main code runs repeatedly:
  // loop to average the data
 for(cntrIndx = 0; cntrIndx < numPtstoAvrg; cntrIndx ++)
 {
  sensorInput = analogRead(A0);           // read ADC of sensor
  //Serial.println(sensorInput);          // diagnostic variable printout
  sumTobeAvrgd = sumTobeAvrgd + sensorInput;      // sum
 } // end of sensor averaging loop
 //Serial.println(sumTobeAvrgd);                  // diagnostic variable printout
 sensorInput = sumTobeAvrgd / numPtstoAvrg;       // calculate average
 //Serial.println(sensorInput);
 sumTobeAvrgd = 0;                                // clear sum
 //
 // avrgTemp = (((float)sensorInput/(float)1023) * 3.30) * 100 - 50.5;   // TMP36
 avrgTemp = (((float)sensorInput/(float)1024) * 3.30) * 100;            // LM35
 //
 preampOutput = analogRead(A1);           // read preamp output
 //Serial.println(preampOutput);                  // diagnostic
 //patemp = (((float)preampOutput / (float)1023 * 3.30 / 3.12) * 100) - 53.3;                       // normalize TMP36 preamp output to temp
 patemp = (((float)preampOutput / (float)1024 * 3.30 / 3.12) * 100);                // normalize LM35 preamp output to temp
 //
 //Serial.println(patemp, 4);        // diagnostic to ensure cast to floats in place
//
afeOutput = analogRead(A2);          // ADC value on A2 from AFE
afetemp = (((float)afeOutput / (float)1023 * 3.30 / 31.2) * 100) + 20.3;   // normalize in-amp output to temp as reqd
//
 Serial.print(avrgTemp);
 Serial.print(",");
 Serial.print(patemp);
 Serial.print(",");
 Serial.println(afetemp, 4);
 } // EoP
Listing 9-1

Arduino Code for Temperature Monitoring and Serial Port Data Transmission

// Servo Motor Control from Serial Monitor with single-character inputs.
// Do not forget to turn OFF the line endings during character transmission
// or the CR and NL will produce 2 extraneous empty character inputs.
// Uppercase S sent from the serial port starts the servo. Any other
// character sent from the serial port stops the servo. For long stop periods
// if servo "buzzing" disconnect power.
// oscillator freq: Delay(15) 1 stroke/2 sec, Delay(10) 1 stroke/sec,
// Delay(5) 2 strokes/sec.
//
#include <Servo.h>         // the servo motor library
Servo myservo;             // create a servo motor instance
int pos = 0;               // the arm position variable in degrees of rotation
char receivedChar;         // the string character variable
boolean newData = false;   // the logic flag variable controlling input read repetition
void setup() {
    Serial.begin(9600);    // start the serial port
    myservo.attach(9);     // set the digital pin to control the servo
    myservo.write(0);      // set arm to 0 degrees
}
void loop() {
    recvOneChar();         // function to receive 1 character
    showNewData();         // diagnostic function to display the character
    testNuChar();          // function to test character and act upon test result
}                          // End of program
void recvOneChar() {                  // function body to receive one character
    if (Serial.available() > 0) {     // test for character in buffer
        receivedChar = Serial.read(); // set character into variable
        newData = true;               // loop() repetetion prevention flag
       }  // E of if
}         // E of fnction
void showNewData() {              // function to display data character received
    if (newData == true) {        // if statement to limit reading to a single byte
        Serial.print("Control character invoked - ");   // character display for error diagnostic
        Serial.println(receivedChar);              // display
        newData = false;                // flag set to stop repetetion in loop()
     }    // E of if
}         // E of function
void testNuChar() {                // function to perform token associated actions
  if (receivedChar == 'S') {        // start servo oscillations
    for (pos = 0; pos <= 60; pos += 1) {    // goes from 0 degrees to 60 degrees in steps of 1 degree
    myservo.write(pos);                     // tell servo to go to position in variable 'pos'
    delay(10);                              // delay time before return stroke 15 to 5ms
  }
  for (pos = 60; pos >= 0; pos -= 1) {      // goes from 60 degrees to 0 degrees
    myservo.write(pos);                     // tell servo to go to position in variable 'pos'
    delay(10);                              // delay time before return stroke 15 to 5ms
  }                                    // E of Return for loop
 }                                         // E of function if
}                                          // E of function
Listing 9-2

Arduino Code for Serial Port, Single-Character Control of Stirring/Agitation Servo Motor

  // Parse Multiple Values from Serial Port in the order in which they are sent.
// Sequence auto polls Com3 for streamed comma-delimited Arduino data.
// the order in which the data stream is to be parsed for the 1st, 2nd etc data points.
// Ordering the data plotting ensures the same variable is always assigned to the same trace.
// ensure the null protocol has been selected in the protocol window
// and that the correct data is streaming into the DAQFactory serial
// port. Data on the SP must be a carriage return/newline-separated stream of n comma-delimited values.
// Create n channels to hold the data for plotting ardyValu_1, ardyValu_2 etc.
// To parse out the data use a loop to find the cr/nl delimiters convert to numbers and Parse(datin,position #, ",").
// into data1, data2 etc values and then use channel.addValue(datan) to assign numerical values to the channels.
//
// clear the buffer
device.Com3.Purge()           // clear old data lines
device.Com3.ReadUntil(13)     // clear any partial line reads
//
while(1)
   try
      //parse first data point for plotting
      private string datain = device.Com3.ReadUntil(13)
      //?datain
          private data1 = StrToDouble(Parse(datain,0,","))
          ardyValu_1.AddValue(data1)
          private data2 = StrToDouble(Parse(datain,1,","))
          ardyValu_2.addValue(data2)
          private data3 = StrToDouble(Parse(datain,2,","))
          ardyValu_3.addValue(data3)
   catch()
    delay(0.5)
   endcatch
endwhile
Listing 9-3

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.90.242.249