11
1 PART A : MAKING THE DIGITAL THERMOMETER 1 October 24, 2016 Digital Thermometry Experiment designed by Peter Crew, Navot Arad and Dr Alston J. Misquitta There are three parts to this exercise, which takes two 3-hour laboratory sessions. In part A you make and calibrate a direct-reading digital thermometer usable over the range 0-100 C. In part B you automate the data acquisition using an Arduino. In part C you use this thermometer to investigate the rate at which various liquids cool. There are few instructions provided for part C instead you are given a copy of a published study of this topic, and asked to repeat the procedures and check the conclusions for yourself. You must write a short formal report on this exercise, using the published paper as a model. Details of this report will be provided in the lectures and on the module QM+ page. Because the calibration of the thermometer is very sensitive to any changes in its electrical circuit, you should do parts A, B and C on successive days, Monday/Tuesday or Thursday/Friday. Your circuit will be left undisturbed on the bench between the two sessions. Plan your experiment well as you will require at least 1h30m to record the data needed for part C. Making the thermometer requires you to use and understand some of the electrical circuits covered in experiment 1, which you must have completed before starting this 1 Part A : Making the digital thermometer 1.1 Introduction The temperature sensor is a semiconductor diode whose resistance varies with temperature. The diode is used as one arm of a Wheatstone bridge circuit, which will therefore only balance at one temperature. The off-balance voltage is measured with a digital multimeter (DMM) and adjusted with a potential divider to give a direct digital reading, in mV, of the temperature in degrees Celsius. There are three separate tasks: 1. measure the properties of the diode related to its temperature dependence; 2. set up and adjust the Wheatstone bridge circuit; 3. use a potential divider to adjust, calibrate and check the performance of your thermometer. You should allocate at most an hour to each of these tasks (including tabulating and plotting data), so as to complete part A in the first afternoon. 1.2 Diode characteristics Diodes are electrical devices which allow current to pass in only one direction, the forward direction. In the reverse direction they have a high resistance, and so can act as one-way switches. The symbol for a diode

Digital Thermometry - QMplusqmplus.qmul.ac.uk/pluginfile.php/337311/mod_label/intro/scm-coffee-cooling.pdf1.3.3 Step 3 Take the diode out of the ice bath and see whether the DMM voltage

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Digital Thermometry - QMplusqmplus.qmul.ac.uk/pluginfile.php/337311/mod_label/intro/scm-coffee-cooling.pdf1.3.3 Step 3 Take the diode out of the ice bath and see whether the DMM voltage

1 PART A : MAKING THE DIGITAL THERMOMETER 1

October 24, 2016

Digital Thermometry

Experiment designed by Peter Crew, Navot Arad and Dr Alston J. Misquitta

There are three parts to this exercise, which takes two 3-hour laboratory sessions.

• In part A you make and calibrate a direct-reading digital thermometer usable over the range 0-100C.

• In part B you automate the data acquisition using an Arduino.

• In part C you use this thermometer to investigate the rate at which various liquids cool.

There are few instructions provided for part C instead you are given a copy of a published study of thistopic, and asked to repeat the procedures and check the conclusions for yourself.

You must write a short formal report on this exercise, using the published paper as a model. Details of thisreport will be provided in the lectures and on the module QM+ page.

Because the calibration of the thermometer is very sensitive to any changes in its electrical circuit, youshould do parts A, B and C on successive days, Monday/Tuesday or Thursday/Friday. Your circuit will beleft undisturbed on the bench between the two sessions. Plan your experiment well as you will require at least1h30m to record the data needed for part C. Making the thermometer requires you to use and understandsome of the electrical circuits covered in experiment 1, which you must have completed before starting this

1 Part A : Making the digital thermometer

1.1 Introduction

The temperature sensor is a semiconductor diode whose resistance varies with temperature. The diode isused as one arm of a Wheatstone bridge circuit, which will therefore only balance at one temperature. Theoff-balance voltage is measured with a digital multimeter (DMM) and adjusted with a potential divider togive a direct digital reading, in mV, of the temperature in degrees Celsius. There are three separate tasks:

1. measure the properties of the diode related to its temperature dependence;

2. set up and adjust the Wheatstone bridge circuit;

3. use a potential divider to adjust, calibrate and check the performance of your thermometer.

You should allocate at most an hour to each of these tasks (including tabulating and plotting data), so asto complete part A in the first afternoon.

1.2 Diode characteristics

Diodes are electrical devices which allow current to pass in only one direction, the forward direction. In thereverse direction they have a high resistance, and so can act as one-way switches. The symbol for a diode

Page 2: Digital Thermometry - QMplusqmplus.qmul.ac.uk/pluginfile.php/337311/mod_label/intro/scm-coffee-cooling.pdf1.3.3 Step 3 Take the diode out of the ice bath and see whether the DMM voltage

1 PART A : MAKING THE DIGITAL THERMOMETER 2

Figure 1: Characteristics of a diode. The relationship between voltage and current is non-linear. We willuse the diode in the forward-bias mode, past its knee region. Note the change of scale on the negative y-axis:the reverse-bias current is a few orders of magnitude smaller than the forward-bias current. There is an errorin the figure: the reverse-bias current is measured in micro amperes (µA) and not milli amperes (mA). Weuse silicon-based diodes in this laboratory. Figure taken from http://www.electronics-tutorials.ws/

diode/diode_3.html

is with the arrowhead indicating the forward direction, so a voltage applied thus + − causescurrent to flow; the diode is then said to be forward biased. To make a diode, a semiconducting material(silicon in this case) is doped with an impurity in order to give a deficit of electrons, hence excess positivecharge, in one region, and another impurity to give an excess of electrons, hence excess negative charge, inan adjacent region. The boundary between the regions is the junction. So the diodes you use here are calledsilicon pn junction diodes. The diodes themselves are small, the size of a match head; the one you use hasbeen encased in insulating mastic with only its two electrical leads left exposed.

The diode does not obey Ohm’s law since the current I is not proportional to the voltage V . The relationbetween I and V is called the characteristic and is shown schematically in fig. 1. In the forward-bias regime— that is the low-resistance mode of the diode — the characteristic has the theoretical form:

I = IS (exp (eV/kT ) − 1) , (1.1)

where, e is the electronic charge, k is Boltzmann’s constant, T is temperature measured in degrees Kelvin,and IS is the reversed-biased current. This characteristic is displayed in fig. 1. It is strikingly non-linear,but also has an explicit dependence on the temperature. If the current is kept constant then a change intemperature will be accompanied by a compensating change in voltage. Thus as T changes the resistanceof the diode, that is the ratio R = V/I, also changes. In this experiment we will work with the diode in itsforward-bias regime, just passed the knee region. We will also limit the current flowing through the diodeto be around 1mA.

We can determine the characteristic of the diode using the circuit shown in fig. 2. All we need do is varythe current flowing through the diode using the 10kΩ potentiometer (adjustable resistance) and measure thevoltage across the diode as a function of this current. However we will not perform this measurementin this experiment. This is mainly for lack of sufficient time. Instead, we have chosen the componentsused in the next section to allow us to operate the diode in its forward-bias regime with a current of around1mA flowing through it. We know from eq. (1.1) that as the temperature changes, the current flowingthrough the diode will change. Before moving on to the next section you need to determine just how muchthe voltage across the diode will change in response to change in the temperature. One summer’s day when

Page 3: Digital Thermometry - QMplusqmplus.qmul.ac.uk/pluginfile.php/337311/mod_label/intro/scm-coffee-cooling.pdf1.3.3 Step 3 Take the diode out of the ice bath and see whether the DMM voltage

1 PART A : MAKING THE DIGITAL THERMOMETER 3

+5V

10 kΩ

0 V

680 Ω

A

I

V

V

Figure 2: Circuit diagram to measure the characteristic of a diode. The voltage provided to the circuit isvaried using the potentiometer. The current flowing through the diode, I, and the voltage across it, V , aremeasured and the forward-bias characteristic of the diode may be determined. However, as mentioned inthe main text, you will not be determining the characteristic of the diode in this experiment!

0V

620 Ω

200 Ω

A

4.7 kΩ

B

4.7 kΩ

+5V

V

V

Figure 3: Wheatstone bridge circuit. The DMM is connected across nodes A and B.

the temperature in the lab was 28C the voltage across the diode was measured to be 607mV and current1mA. Using this data, answer the following:

• What is the resistance of the diode at this current and voltage?

• Use the characteristic equation given to calculate what voltage change will compensate for a tempera-ture change of 1C.

You should find that the voltage change is very small. It is this small voltage change that we seek to measure.We will need these pieces of information in determining the values of the resistors used in the circuits shownbelow.

1.3 The Wheatstone bridge circuit

You may like to review the Wheatstone bridge circuit by referring to the lab script for Experiment 2 beforecontinuing.

While you are getting on to the steps below, consider the following questions: why do you think we are usinga Wheatstone bridge to read out the voltage change across the diode? Why can we not read it out directlyusing a DMM? Surely the latter would be the simpler way, would it not? Or does the Wheatstone bridge

Page 4: Digital Thermometry - QMplusqmplus.qmul.ac.uk/pluginfile.php/337311/mod_label/intro/scm-coffee-cooling.pdf1.3.3 Step 3 Take the diode out of the ice bath and see whether the DMM voltage

1 PART A : MAKING THE DIGITAL THERMOMETER 4

have properties that make it superior to a direct reading? If so, what might these be? Get into a discussionwith the laboratory demonstrators or research this yourself.

HINTS: What does the balance-point allow you to do? How large an effect are you trying to measure? (seeresult of the last section) Would noise in the circuit allow you to measure this? Where might the noisearise from? Consider how a small fluctuation in the supplied voltage would effect a direct reading across thediode. What effect would this fluctuation have on the balance point of the Wheatstone bridge?

1.3.1 Step 1

Construct the bridge circuit of fig. 3. The leads on the small blue multi-turn variable resistor (helipot) areeasily broken do not stretch them!

We can easily place an upper bound on the current that will flow through the two arms of the bridge circuitby assuming that this circuit can be approximated by the two 4.7kΩ resistors. In other words by assumingthat the other resistors and diode have zero resistance. The two 4.7kΩ resistors in parallel present a combinedresistance of 2.35kΩ, allowing a current of no more than 5V/2350Ω. This corresponds to a current of about2mA to flow through the two arms of the bridge. At balance this will be divided equally between the arms,giving the desired 1mA current through the diode. You should have calculated a diode resistance of severalhundred ohms at this current; the 200Ω helipot is adjusted to this value to balance the bridge.

1.3.2 Step 2

We wish to balance the bridge at 0C (so as to get a reading of zero at this temperature), so place the diodein a beaker of melting ice. There should be both ice and water in this mixture! Set the DMM to the 200mVrange, connect it across the outputs AB of the bridge, and adjust the 200Ω helipot until the DMM readszero. This is a tricky adjustment that is very sensitive to small movements of the helipot. At balance theDMM may still be fluctuating a few tenths of a mV on either side of zero.

1.3.3 Step 3

Take the diode out of the ice bath and see whether the DMM voltage increases or decreases as the diodewarms up. If it decreases, reverse the meter connections to A and B so that the digital reading will bepositive for temperatures above 0C.

1.4 Calibration of the thermometer

Your calculation of the voltage change accompanying a 1C temperature rise should suggest that at 100Cthe DMM will register well over 100mV. To get a direct reading of temperature we need to reduce this usinga potential divider, preferably one with a high input resistance so that it does not overly disturb the currentsflowing in the bridge circuit. A resistance of 10kΩ should be sufficient.

• Replace the DMM across the output AB by the 10kΩ helipot, and connect the DMM itself across thecentre and an outside terminal of the helipot this is shown in fig. 4.

• Place the diode in boiling water and adjust this helipot until the DMM registers 100mV. Then checkthat the reading is still zero when the diode is in melting ice, making small adjustments to the 200Ωhelipot if necessary. Repeat the sequence until readings of 0mV and 100mV are obtained at 0C and100C, respectively. The hot water cools quickly so you may only reach a temperature of 80 − 95C.In this case you should adjust the helipot such that the DMM registers in mV the temperature of thewater in degrees Centigrade. You now have a direct reading digital thermometer!

Page 5: Digital Thermometry - QMplusqmplus.qmul.ac.uk/pluginfile.php/337311/mod_label/intro/scm-coffee-cooling.pdf1.3.3 Step 3 Take the diode out of the ice bath and see whether the DMM voltage

2 PART B : AUTOMATED DATA ACQUISITION 5

0V

620 Ω

200 Ω

A

4.7 kΩ

B

4.7 kΩ

+5V

10 kΩ

VDMM

A

C

Figure 4: Final circuit for digital thermometer. This is a modification of the circuit shown in fig. 3. Here,instead of the DMM across nodes A and B, we have introduced the 10kΩ potentiometer that, when calibrated,allows us to read-out the temperature using the DMM that is now connected across it. In automation stepof this experiment this DMM will be replaced by an Arduino Uno via an amplifier stage. Note that the twonodes labeled ‘A’ are equivalent.

• Finally, check and correct the calibration against the alcohol-in-glass thermometer. Adjust your digitalthermometer when the two thermometers are placed side by side in melting ice and boiling water. Thenrecord the readings when they are both placed in water at some intermediate temperatures, say about70C, 60C, 50C, 40C, and 30C. You do not need these exactly temperatures, just try to get closeto these values. Try to estimate the glass thermometer reading to one-fifth of a degree, and commentin your report on the agreement between the two temperature scales.

• Make sure you have enough of data from the previous step so as to determine the accuracy of the digitalthermometer. Remember that you have calibrated it against the glass thermometer, which itself willhave a read-out uncertainty.

2 Part B : Automated data acquisition

IMPORTANT: You should have made and calibrated your diode thermometer before coming to thissection. Make sure you have done this and check to see that your thermometer is accurate before

attempting to use it.

[The Arduino program for this experiment is provided at the end of the assignment and is available onlineas for reference].

You should now have a working digital thermometer. In the next section (Part C) you will need to recordcooling data for four different fluids. This takes time and is tedious, so here you will build an automaticdata acquisition system for your thermometer. The idea is simple: rather than use a digital multimeter(DMM) to read out the voltage, and hence the temperature, we will use the Analogue to Digital converters(ADC) on the Arduino to read the potential difference across the 10kΩ potentiometer. In principle thisis a simple step: all that needs to be done is to connect Arduino pins A0 and A1 (the ‘A’ indicates that

Page 6: Digital Thermometry - QMplusqmplus.qmul.ac.uk/pluginfile.php/337311/mod_label/intro/scm-coffee-cooling.pdf1.3.3 Step 3 Take the diode out of the ice bath and see whether the DMM voltage

2 PART B : AUTOMATED DATA ACQUISITION 6

these are analogue pins, that is, they are able to read an analogue signal like a voltage, and convert it to adigital signal) to the points where the DMM currently is (nodes A and C in fig. 4). The difference in thereadings will then be proportional to the potential difference. This does not work well as the ADCs on theArduino convert a voltage range of 0V to 5V to a value from 0 to 1023 (as the ADCs are 10bit convertersand 10bits corresponds to a range of values from 0 to 210−1 = 1023). However, the voltage we expect acrossthe 10kΩ potentiometer is only in the range 0mV to 100mV. This range would utilize only values 0 to 20(= 0.1 × 1023/5) on the ADC. This small range of values would give us very large uncertainties, somethingwe need to avoid.

2.1 Op-Amps

One solution to this problem is to amplify the signal by a factor of 50 as that would convert the 0mV to100mV range we expect across the 10kΩ potentiometer to 0V to 5V, which would fully utilise the range onthe Arduino. We have constructed the amplifiers for you using two sets of operational amplifiers. There aretwo op-amps in each of the black chips in shown in fig. 5. We use operational amplifiers, or op-amps, as theycan amplify signals with a minimal input current. The input resistance of an op-amp is typically a few MΩ,like the DMMs you have used in the Electrical experiment. Additionally, the amplification characteristic isusually fairly linear which is ideal for a good amplifier.

You will not be building the amplifier as you will not have the time to do so. Instead, we will supply youwith the pre-built amplifier shown in fig. 5.

Scanned by CamScanner

Figure 5: Image of the pre-built op-amp amplifier with input and output pins indicated. The variablepotentiometer can be used to fine tune the amplification to be A = 50. The voltage difference across nodesA and C in fig. 4 is the ‘bridge’ voltage that is is amplified and output is between the output at A0 and thecommon ground. For this to work all parts of the circuits should share a common ground.

Connections:

• Connect the power (5V and ground) to the amplifier.

• Connect the two ‘bridge’ inputs (nodes A and C in fig. ckt:digital-thermometer) to the points marked‘bridge’. You will need to experiment with the order of these connections. It will work one way andnot the other.

Page 7: Digital Thermometry - QMplusqmplus.qmul.ac.uk/pluginfile.php/337311/mod_label/intro/scm-coffee-cooling.pdf1.3.3 Step 3 Take the diode out of the ice bath and see whether the DMM voltage

2 PART B : AUTOMATED DATA ACQUISITION 7

• Before connecting the Arduino, check to see that the amplifier works. To do this, connect a secondDMM at the outputs A0 and Ground (this is the common ground of the circuit) of the amplifier.

• Power it up. Check the voltage at the output. Is it nearly 50 times the input voltage? If yes, yourcircuit is functional. If not, check your connections.

• Adjust the potentiometer on the amplifier to make the gain almost exactly A = 50. Note the uncertaintyon the gain.

2.2 Amplifier and Arduino

Once you are sure that the amplifier works (That is, the second DMM between the A0 output of the amplifierand ground shows a voltage that is 50 times the voltage across the bridge.), you can proceed to connectthe Arduino Uno to the circuit. Essentially, the Arduino will take the place of the second DMM you haveconnected across points A0 and the Ground. With a suitable program, it will record the voltage at specifiedtime intervals. A schematic view of the Arduino Uno is shown in fig. 6. The Arduino gets its power from thecomputer via the USB cable, so no additional power is needed. But it needs to be grounded to the commonground for it to be able to read voltages. This is why you needed to pass the ground to the Arduino.

Figure 6: Bread-board view of the Arduino. You will use only the Ground and pin A0. We will not use pinA1 in this experiment.

Connections:

• Connect ouput A0 of the amplifier to pin A0 on the Arduino.

• Connect ground output of the amplifier to any of the Ground pins on the Arduino.

• Connect the Arduino Uno to the computer using the USB cable.

• You do not need to disconnect the second DMM. It can serve as a useful check on the readings of theArduino.

Once this is done, upload the program (listed below, but please use the version on the SCM Wiki page) tothe Arduino. The program will cause the Arduino to record temperatures in Celsius every 30sec. It workscontinuously and so the reset button on the Arduino needs to be pressed to re-start it. Data will be displayedon the serial monitor. Ask a demonstrator for help if you are unsure of how to start the serial monitor.Before relying on the data recorded by the Arduino make sure it is recording the correct temperature (i.e.,

Page 8: Digital Thermometry - QMplusqmplus.qmul.ac.uk/pluginfile.php/337311/mod_label/intro/scm-coffee-cooling.pdf1.3.3 Step 3 Take the diode out of the ice bath and see whether the DMM voltage

3 COFFEE COOLING : PART C 8

check the output against the reading on the alcohol thermometer). Once you are satisfied it is, proceed topart C of this experiment.

The Arduino will display readings on the Serial Monitor (on the computer screen). You may cut-and-pastethese readings into a file for your records.

2.2.1 Reflection

What are the sources of error in this setup? What do you expect the uncertainty on the temperaturereadings to be? Is the uncertainty limited by the thermometer? Or the calibration step? Or the amplifier?Or the Arduino? What will be the random and systematic errors? Is the amplification of the amplifier reallyA = 50? How would you test this? If it is not 50, what effect would the error in the amplification have onyour results?

Consider these questions (and others you may have) while you proceed with Part C of this experiment.

3 Coffee cooling : Part C

HINT: You should have built your calibrated thermometer and got the automated data acquisition withthe Arduino working before coming to this section. Additionally, please read the paper the Rees and Viney

before you start this part of the experiment.

Rees and Viney found that black and white coffee cooled at different rates, and sought to explain this. Weare not asking you to attempt an explanation, but to repeat some of Rees and Viney’s measurements andcomment on whether your results agree with theirs and if not, what differences you find. You should be ableto make the measurements and draw the graphs in one laboratory period — you may also have time to makesome of the additional checks mentioned by Rees and Viney.

We suggest that, after checking that your thermometer still records the ice and boiling points correctly, youmeasure the cooling curves of:

• 200 ml of plain water, brought to the boil and poured into the china mug.

• Black coffee made by adding 200 ml of water to a level teaspoon of granules in the mug.

• White coffee made by adding 20 ml of cold milk to a freshly-made mug of black coffee (200 ml again),stirring, and pouring out 20 ml to leave 200 ml. Do not re-boil the coffee.

• Black coffee made by adding 20 ml of cold water to a freshly-made mug of black coffee (200 ml again),stirring, and pouring out 20 ml to leave 200 ml. Do not re-boil the coffee.

• Can you say why the fourth procedure might be informative?

• Use the digital thermometer to record the ambient room temperature.

3.1 Writing your report

The report must include:

1. A title.

2. Author’s name and affiliation.

Page 9: Digital Thermometry - QMplusqmplus.qmul.ac.uk/pluginfile.php/337311/mod_label/intro/scm-coffee-cooling.pdf1.3.3 Step 3 Take the diode out of the ice bath and see whether the DMM voltage

4 APPENDIX 9

3. An abstract, which is a brief summary of a few lines including results but not too detailed.

4. A short introduction — what are you describing, and why did you do it?

5. A brief summary of the theory (you can refer to other publications for this, e.g. ‘It is shown by Reesand Viney (1) that ...’). It is unacceptable to copy verbatim from the paper. You should present yourresults in your own words. Do not include theoretical details that are not relevant to your experiment,especially if you do not fully understand them. When you refer to the paper by Rees and Viney youshould cite it appropriately.

6. A brief description of your digital thermometer.

7. A brief description of how you used the Arduino to automate the data collection.

8. A brief description of what you did and measured.

9. A summary of the results, together with calculated quantities. Show raw data as graphs (much moreinformative than tables which you will not have the space to include), while derived quantities (suchas time constants) can conveniently be tabulated. Use log rather than linear plots where appropriate.

10. A discussion of the significance of the results, including any uncertainties due to measurement precision(errors) and whether or not differences found are meaningful.

11. A short conclusion.

12. A list of references with name(s) of author(s), journal name and volume number or book title andpublisher, page number(s), and date.

4 Appendix

4.1 Other Information

Larger versions of the circuits used can be found on the SCM Wiki page where the Arduino program neededto take the readings may also be found. A listing of the program is also provided in sec. 4.3.

4.2 The Dual Op-Amp pin diagram

The pin diagram for the Dual Op-Amp (TSS922IN or equivalent) used in the amplifier is shown in fig. 7.

Page 10: Digital Thermometry - QMplusqmplus.qmul.ac.uk/pluginfile.php/337311/mod_label/intro/scm-coffee-cooling.pdf1.3.3 Step 3 Take the diode out of the ice bath and see whether the DMM voltage

4 APPENDIX 10

TS922, TS922A Pin diagrams

Doc ID 5150 Rev 9 3/23

1 Pin diagrams

Figure 1. Pin connections (top view)

Figure 2. Pinout for Flip-Chip package (top view)

OUT2 -IN2 +IN2

VCC+ GND

+IN1-IN1OUT1

-

-

+

+

OUT2 -IN2 +IN2

VCC+ VCC-

+IN1-IN1OUT1

-

-

+

+

Figure 7: Pin diagram for the TS922IN dual op-amp.

Page 11: Digital Thermometry - QMplusqmplus.qmul.ac.uk/pluginfile.php/337311/mod_label/intro/scm-coffee-cooling.pdf1.3.3 Step 3 Take the diode out of the ice bath and see whether the DMM voltage

4 APPENDIX 11

4.3 The Arduino program

This will read out the temperature to the serial monitor in degrees Celsius. Readings are printed out every30sec. To smooth-out random fluctuations, readings are averaged for 1 sec.

This program is listed here for reference only. Please use the version from the SCM Wiki page!

/*

OpAmp Thermometer

written by: Navot Arad , Queen Mary University of London

*/

int InputPin = 0; // A0 is the amplified signal pin

float temp = 0; // variable to store data from pin A0

float AmpVoltage = 0; // Use float to convert data from A0 to voltage

float G = 50.0; // Amplification factor

float scaleG = 0;

float conversion = 0; // Conversion rate to degrees

float average = 0;

void setup() // Only runs once after board is reset

Serial.begin (9600); // Rate at which data is sent to serial monitor

Serial.println("Time Temperature"); // Sends everything inside " " as a string to the

serial monitor

void loop() // Runs continuously on repeat

// average temperature over first second

for (int i = 0; i < 100; i++)

temp = analogRead(InputPin); // Read data from the input pin (A0) on a 10 bit scale

scaleG = G + ((temp - 1023) * 1.5 * 0.00147);

conversion = (1023 * scaleG)/50; // conversion factor

AmpVoltage = temp *(100.0/ conversion); // Converts signal to temperature

average = average + AmpVoltage;

delay (10);

Serial.print(millis () /1000); // Sends value stored on AmpVoltage

// to serial monitor and starts new line

Serial.print(" ");

average = average /100;

Serial.println(average ,1);

average = 0;

delay (29000); // 29 second delay before loop runs again