Professional Documents
Culture Documents
of Arduino Uno
Michael Campbell*
Tennessee
E-Mail: mcampb25@vols.utk.edu
Abstract
In order to provide a more low-cost option in regards to high accuracy/low cost temperature
sensors that can be included in broader circuitry, the Arduino Uno was implemented alongside a
conversion, that was moderately accurate and precise. The resulting instrument, while able to be
integrated into much larger circuits, was difficult to keep calibrated and required near constant
adjustments.
Introduction
The biggest part of the circuit that makes up this sensor is the voltage divide. The voltage
divider (VD) is a very common resistor circuit that takes some voltage applied at the input and
provides a lower voltage at the output (Eggleston, 2011). The Wheatstone Bridge (WB) is simple
two voltage dividers set up in parallel. The WB can provide a way of calibrating your sensor but
can also just be used as an easy method to adjust the current going into the Platinum
Thermometer (PT). The Arduino Uno (AU) is a basic computer processor that can be
programmed to act as a voltmeter and with further calibration and calculations can be
programmed to work as a thermometer. The AU is able to take an analog signal input and using
the internal A-to-D converter it can be sent through relevant coding to display this information
Methods
A WB was used to adjust the input current to approximately 3.14 mA from the AU. The
breadboard was connected to the AU 3.3 V power output. Along with the 3.3 V power output,
the other pins that were used include Ground, Analog Reference, Analog Input 0, and Analog
Input 5. The WB used consists of two 2 kΩ trimmer resistors and one 100 Ω trimmer resistor.
𝑉 =𝐼∗𝑅
Eq 1: Ohm’s law. Used in this instance to calculate the current output of the circuit
𝑅𝑥
𝑉𝑅𝑥 = 𝑉𝑠𝑢𝑝𝑝𝑙𝑦
𝑅3 + 𝑅𝑥
2. void setup() {
3. Serial.begin(9600);
4. analogReference(EXTERNAL);
5. }
6. void loop() {
7. volt1 =analogRead(A0);
8. voltage1 = volt1*(3.3/1023.0)*100;
9. Serial.print("Voltage 1 is ");
10. Serial.print(voltage1);
11. Serial.println("V");
15. Serial.print(voltage2);
16. Serial.println("V");
19. Serial.print(temp);
21. delay(1000);
22. }
The AU program was used to convert the analog bit input to voltage and then the voltage was
converted to a temperature in Celsius. The different words were floated to allow them to be used
within the code. The void setup section of the code are commands that are only going to be
executed once. The void loop section of the code is going to go through each command in line
and then loop back to the start of that section and start again. Using the
analogReference(EXTERNAL) command told the AU to use the voltage supplied at the ARef
pin instead of the standard 5V. The analogRead command told the AU to read the bit input
related to the specified analog input pin. Serial.print told the AU to display the specified text in
the Serial Monitor. Serial.println told the AU to display the specified date on the next line of the
Serial Monitor. The delay command told the AU to delay the repeat of the looping code by 1
3.3
𝑣𝑜𝑙𝑡𝑎𝑔𝑒# = 𝑣𝑜𝑙𝑡# ∗ (( ) ∗ 100)
1023.0
This equation allowed me to convert the 1023 analog input into a voltage by dispersing the bit
input along the specified voltage. Multiplying by 100 converted the output to the cV range
contrary to the V range that is being show in the images allowing for better precision and
resolution. The equation to convert from voltage to degrees Celsius was calibrated by taking the
voltage readings in 0 °C ice bath and 100 °C boiling water standards. These were plotted in Excel
PT Calibration
26
y = 0.0774x + 17.74
25
24
23
Voltage cV
22
21
20
19
18
17
0 10 20 30 40 50 60 70 80 90 100
Temperature °C
Discussion
The overall process was actually a quite frustrating one. I first started by using the WB
set up with R1, R2, and R3 at 200Ω trimmer resistors. Knowing how many turns the trimmer
resistor took from one side to the other I calculated the number of ohms that were changed with
each quarter turn. I would then set the PT into the ice bath and using the AU code to calculate the
difference from one side of the WB to the other would count the number of turns of the R3
trimmer resistor in order to even out the WB. This method was overall a failure as I was getting
too much current into the PT causing it to heat up and skew my results. My next method that I
used involved just a voltage divider in order to get the current down within acceptable ranges to
not heat the PT. To do this I had to use such a high resistance resistor that the data was
completely unusable.
After getting some guidance from the TAs and Professor I set up the WB as described in
the Method section to get the current down, but used just one half of it as a VD to do my
calculations. One of the hardest things was to get all the circuitry elements to stay still in the
breadboard so that it would stop causing my output to jump around. This was only slightly
resolved with a whole lot of frustration. I had initially been converting my voltage readings into
resistance readings, and then converting those resistance readings to temperature readings. This
proved to cause a much higher degree of inaccuracy. In order to increase accuracy, I did the
of movement in the circuitry was enough to cause a shift in the voltage reading. Compound this
with only two points being used for calibration and it becomes exceedingly difficult to get
consistent readings. As shown in Figure 4 and elaborated on further in the Results section, a
change of only 0.32 cV in the voltage drop reading is enough to alter the temperature conversion
by 4.17 °C for the calibration that was used for both the body temperature reading as well as the
ice point reading. If more calibration points had been used it would have been possible to use a
polynomial trendline as opposed to a linear trendline which would have provided a much more
accurate voltage-to-temperature conversion equation. With this better equation there would be
less of a conversion output jump from such small changes in the voltage.
The resolution was limited due to the AU only having 1023 bits of data points available
for the readings. A way to get a better resolution on this point would be to increase the number of
bits of data points that are able to be read. This is however, a limitation of the AU since there is
no way to increase the number of bits of data points for the AU. It would require an altogether
different microcontroller/microcomputer that had a larger amount of bits of data points in order
to increase the resolution caused by this shortcoming. Another factor that limited the resolution
was that the AU reads input in volts. When dealing with minute changes in voltage this can lead
to data points too close together for the AU to separate in the serial monitor output. One method
of increasing the resolution with respect to this problem is to multiply your conversion factor. By
multiplying your conversion factor, you enable the output to be shown in much smaller units
than the AU regularly outputs, in this instance centivolts. This gives the AU the ability to resolve
data points that are very close together. It does however increase the sensitivity of the readings
which can lead to more frequent and intense fluctuations in the voltage readings. This can then
Conclusions
precision due to having a limited amount of bit data output. Other shortcomings of this setup as a
temperature sensor was the use of only two points for calibration. This only calibrated in a very
narrow range of temperatures and caused even the smallest voltage/resistance change to cause
huge leaps in the output temperature data. In a pinch this set-up can be used as a temperature
sensor but it is definitely not very accurate and takes a lot of readings to get close to calibration.
This could be used when low cost is a priority and high accuracy is not required. The physical
circuitry itself is not very stable. The slightest movement of the resistors or connectors caused
fluctuations in the readings that led to having to constantly adjust the voltage-to-temperature
Bibliography
Eggleston, D. L. (2011). Basic Electronics for Scientists and Engineers. Cambridge: Cambridge
University Press.