instruction manual on building a simple temperature...
TRANSCRIPT
Instruction Manual on Building a Simple Temperature Measuring Device Using an Arduino
Prepared by
Christopher Sisneros, Brain Terdoest and Mitchell Walker
April 18, 2014
Technical Writing TECM 2700.001
Instructor: Terry C. Smith
iii
Table of Contents Preface............................................................................................................................................. v
Chapter 1: The Arduino and the Thermocouple ............................................................................. 1
Thermocouple ............................................................................................................................. 1
Figure 1.1- Type K Thermocouple ......................................................................................... 1
Arduino ....................................................................................................................................... 1
Figure 1.2- Arduino Uno Rev. 3 ............................................................................................. 1
Chapter 2 Building the Circuit and Loading the Sketch ................................................................. 3
Difficulty Level ........................................................................................................................... 3
Materials ..................................................................................................................................... 4
Table 2.1-Project Materials ..................................................................................................... 4
Tools ........................................................................................................................................... 4
Table 2.2- Project Tools .......................................................................................................... 4
Procedure: Hardware .................................................................................................................. 5
Figure 2.1- Attaching header pins to LCD.............................................................................. 5
Figure 2.2-Headers soldered and LCD attached to breadboard .............................................. 5
Figure 2.3-Step 1 ..................................................................................................................... 6
Figure 2.4-Step 2 ..................................................................................................................... 6
Figure 2.5-Step 3 ..................................................................................................................... 6
Figure 2.6-Step 4 ..................................................................................................................... 7
Figure 2.7-Step 6 ..................................................................................................................... 8
Figure 2.8-Step 8 ..................................................................................................................... 9
Procedure: Software .................................................................................................................. 10
Figure 2.9- Empty Sketch Screen ......................................................................................... 10
Figure 2.10-lcdthermocouple Sketch .................................................................................... 11
v
Preface There have been more than 250,000 Arduino boards sold around the world. Arduino Boards have
become a sensation for all newcomers to electronics as well as veterans. With it’s easy to learn
approach to programming, Arduinos have unlocked a whole new field for practicing artists in
their respective field of interest. Arduino has become a revolutionary do it yourself enabler for
anyone wanting to create any number of a diverse multitude of projects ranging from
Breathalyzers to home automation, data acquisition, transient art, and robotics.
Before jumping into detailed information about using the Arduino Board, it is particularly
important for users to understand what the developers of these versatile boards planned to
accomplish. Before Arduino was developed, in the early 1990’s the microcontroller “Basic
Stamp” by Parallax Inc. was available which offered somewhat similar programming skills
however being a decade old it didn’t offer modern computing power or functionality on different
operating systems such as Mac or PC. The Italian creators of Arduino wanted to create a super
cheap platform ($30 compared to Basics $100) which users could share their creations openly
across the web with up to date microprocessor. As you can see this board is created for you to
experiment, we hope that you will enjoy your endeavors into the world of electronics.
Now let’s get to specifics. What can an Arduino Board actually do? First, the Arduino Board
was developed to “sense and control more of the physical world than your desktop computer”
(Arduino). That being said, it can be used to develop computation of physical information to be
used to control motors, switches, and sensors. The programming language used mixes Java with
C++ as well as using other computer software such as Flash or MAXMSP. The specific board
used with this manual is the Arduino Uno Rev 3 which (at the printing of this manual) is the
most recently released version of the Arduino Uno board. As you progress in your building of
the simple temperature measuring device, you will gain insight into the circuit prototyping
process and valuable experience that will aid you in your next Arduino endeavor.
As in all Arduino projects, we implore that you share your completed project with other techno-
enthusiasts.
vi
1
Chapter 1: The Arduino and the Thermocouple
Thermocouple A thermocouple is a simple device that is used to measure temperature (see figure 1.2). There are
many types of thermocouples but they all share the same design, namely two wires made up of
different metals that are joined at one end. When you introduce a temperature gradient along the
wires (by making the joined end of the wires a different temperature than the loose ends) a
voltage difference between the loose ends is induced. This occurs because the two differing
metals react to temperature differently by producing a voltage that is unique to that metal at that
temperature. This natural phenomenon is known as the Seebeck Effect, named after the Baltic
German physicist Thomas Johann Seebeck. By measuring
the voltage on the loose ends of the two wires you can use a
relationship based on the types of wires used that will
convert the measured voltage into a temperature.
There are many common and standard types of
thermocouples. In this instruction manual, we will use a type
k thermocouple because of its wide range in temperature
measurement and its low cost.
Arduino The Arduino Uno Rev.3 is a microcontroller board based on
the Atmel ATmega328 8-bit microcontroller. A
microcontroller is essentially a small computer on an
integrated chip (IC) that contains a processor and memory.
The memory is used to store a program which tells the
processor core what actions to carry out. The Arduino board
makes programming the microcontroller and accessing the
input/output pins easy.
Because of the open source nature of the Arduino, the plans
for building this microcontroller board are readily and freely available for anyone to use. Third-
party companies actually make and sell their own Arduino based boards! However, the low cost
of buying an Arduino (around $30) is much more attractive to the average electronics hobbyist
than the trouble and difficulty of making their own.Chapter 2: Building the Circuit
Figure 1.1- Type K Thermocouple
Figure 1.2- Arduino Uno Rev. 3
3
Chapter 2 Building the Circuit and Loading the Sketch
Difficulty Level
For this project you will have:
Minimal soldering
Easy circuit building with a breadboard
No programing required
This project is a beginner’s level project that requires basic soldering skills and the use of a
breadboard. Although these skills are not covered in this manual you can learn about them
online. A good resource for learning how to solder is coldrestart’s video tutorial “How to Do It:
Basic Soldering” which can be found online at
https://www.youtube.com/watch?v=BLfXXRfRIzY. For breadboard basics, Andrew Millinson
has a great video tutorial on his YouTube channel titled “How to use Breadboard – Using
Breadboard for beginners and prototyping circuits” at
https://www.youtube.com/watch?v=gwcVr5VfXwA. We also assume that you are able to
download software onto your computer and know how to use the copy and paste functions. You
do not need to know how to write code, just how to copy and paste it.
On the next page you will find a list of materials and tools that are needed to complete this
project. I have listed a vendor that stocks each part or tool as well as the listed price.
4
Table 2.1-Project Materials
Materials
Item Number Price Source
Computer running Windows, MaxOSX, or Linux
1 Varies Varies
Arduino Uno Rev.3 microcontroller board
1 $28.49 Arduino.cc
USB 2.0 Type A/B cable 1 $2.49 Arduino.cc
9V battery holder with 5.5mm/2.1mm plug
1 $3.95 Adafruit.com
9V battery 1 $5.47 (for 2 pack) Walmart
MAX31855 thermocouple amplifier breakout board
1 $14.95 Adafruit.com
Type k thermocouple (1 meter)
1 $9.95 Adafruit.com
RGB backlit negative LCD16x2 with 10K potentiometer and header pins
1 $13.95 (price includes LCD screen, potentiometer, header
pins)
Adafruit.com
Half-size breadboard 1 $5.00 Adafruit.com
Pack of premium 6 inch
male/male assorted jumper wires
1 $7.95 (pack of 40) Adafruit.com
Tools
Adjustable 30W
soldering iron
1 $22.00 Adafruit.com
Mini Solder spool -
60/40 lead rosin-core
solder 0.031" diameter
1 $5.95 Adafruit.com
Precision screwdriver
set (6 pieces)
1 $7.95 Adafruit.com
Table 2.2- Project Tools
5
Procedure: Hardware The first thing you need to do is to prepare the LCD for placement onto the breadboard. The
LCD comes with header pins but they are not attached. Attach a header pin to each of the solder
tabs on the LCD as shown in Figure 2.1. It is best to put the length of 16 header pins into the
solder tabs on the display and starting at one end, solder each of the pins in place. It can be easier
to put the long end of the pins into the breadboard so that the header pins are held straight.
With all the headers attached to the LCD, and inserted into the breadboard your project should
look like Figure 2.2. Now we are ready to wire the LCD to the breadboard. You will need to
follow these steps:
LCD
Soldering iron
Header pin
Figure 2.1- Attaching header pins to LCD
Figure 2.2-Headers soldered and LCD attached to breadboard
6
1. Connect +5V pin on the Arduino to the red rail on the breadboard, and the Arduino ground to
the blue rail on the breadboard using jumper wires as shown in Figure 2.3.
2. Connect up the backlight for the LCD by connecting LCD pin 16 to breadboard ground and LCD
pin 15 to +5V.
3. Install the 9V battery into the battery holder and connect the 5.5mm/2.1mm power jack of the
battery holder into the jack input on the Arduino board. At this point you should see the LCD
light up!
Figure 2.3-Step 1
Figure 2.4-Step 2
Figure 2.5-Step 3
7
4. Next, connect the 10K potentiometer to the breadboard near LCD pin 1 and then wire the
potentiometer up by connecting one of its outer pins to +5V and the other to ground. It does
not matter which side goes to +5V or ground. The middle pin on the potentiometer needs to be
wired to LCD pin3.
5. The next step is to wire up the logic of the LCD. To do this make the following connections:
LCD pin1 to ground
LCD pin 2 to +5V
At this point, you should be able to adjust the potentiometer and see the backlight of the
LCD screen brighten or darken as you turn the potentiometer knob.
6. Now we will make the connections that allow the Arduino to send data commands to the LCD.
These are the 7 connections that you need to wire up.
LCD pin 5 to ground
LCD pin 4 to Arduino digital pin 7
LCD pin 6 to Arduino digital pin 9
LCD pin 14 to Arduino digital pin 12
LCD pin 13 to Arduino digital pin 11
LCD pin 12 to Arduino digital pin 10
LCD pin 11 to Arduino digital pin 9
Figure 2.6-Step 4
8
Your project should now look like Figure 2.7
Next, you will need to create the temperature sensing circuit by wiring up the Arduino board,
MAX31855 amplifier and type k thermocouple.
7. Insert the pins of the MAX31855 type k thermocouple amplifier into the breadboard as shown in
Figure 2.8. The connections are as follows:
The CLK pin on the MAX31855 connects to Arduino digital pin 3.
The CS pin on the MAX31855 connects to Arduino digital pin 4.
The DO pin on the MAX31855 connects to Arduino digital pin5
8. The last step to creating the temperature sensing circuit is to wire up the thermocouple to the
amplifier. The thermocouple wires are polarized which means one wire is positive and the other
negative. However, even though the amplifier is clearly marked (+) and (-) the thermocouple
may not be. Have no worries though. Should you get them backwards your temperature
readings will be in the negative. If this is the case simply switch the polarities of the
thermocouple. If your circuit looks like Figure 2.8 on the next page then you should now be
ready to move on to the software side of things.
Figure 2.7-Step 6
9
Figure 2.8-Step 8
10
THE ARDUINO SOFTWARE IS PROVIDED TO YOU "AS IS," AND WE MAKE NO EXPRESS OR
IMPLIED WARRANTIES WHATSOEVER WITH RESPECT TO ITS FUNCTIONALITY,
OPERABILITY, OR USE, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR INFRINGEMENT. WE
EXPRESSLY DISCLAIM ANY LIABILITY WHATSOEVER FOR ANY DIRECT, INDIRECT,
CONSEQUENTIAL, INCIDENTAL OR SPECIAL DAMAGES, INCLUDING, WITHOUT
LIMITATION, LOST REVENUES, LOST PROFITS, LOSSES RESULTING FROM BUSINESS
INTERRUPTION OR LOSS OF DATA, REGARDLESS OF THE FORM OF ACTION OR LEGAL
THEORY UNDER WHICH THE LIABILITY MAY BE ASSERTED, EVEN IF ADVISED OF THE
POSSIBILITY OR LIKELIHOOD OF SUCH DAMAGES.
Procedure: Software Download the free open source Arduino Integrated Development Environment (IDE) for your
computer. Choose the correct version depending on whether your computer runs Windows, Mac
OS, or Linux. This can be found at: http://arduino.cc/en/Main/Software. When the software is
done downloading run the .exe file and follow the onscreen instructions to install it on your
computer.
The Arduino IDE is where you create a program that you will upload to the Arduino
microcontroller. In the Arduino IDE, a program is called a sketch.
Here is a sketch without any code:
Figure 2.9- Empty Sketch Screen
11
Now we need a sketch that tells the Arduino to run our temperature sensing circuit. User
Ladyada on the website Github.com has already written this sketch for you to use. You simply
need to obtain the relevant code and upload it to your Arduino . This is outlined in the following
steps:
9. Go to https://github.com/adafruit/Adafruit-MAX31855-library and download the Adafruit
MAX31885 Arduino Library. After downloading you will need to place this file into the Library
folder in the Arduino IDE. If you do not halve a Library folder yet, simply create on by clicking on
file, then new. Rename the folder Library.
10. Once step 9 is completed you can open the relevant sketch by clicking on File, then Examples,
then Adafruit_MAX31855, and then finally lcdthermocouple. This should bring up the sketch in
Figure 2.10.
Figure 2.10-lcdthermocouple Sketch
12
11. Once you have this open, connect the Arduino to your computer via the USB cable and upload
the sketch to the Arduino. The upload button is located on the top left corner of the Arduino
Environment and is depicted as a small arrow pointing to the right. Click it once and wait for the
code to compile and transmit to the Arduino. You will know when it is done transmitting when
the status bar at the bottom of the Arduino Environment says “Upload Complete”.
12. Disconnect the USB cable from the Arduino and bask in the satisfaction of making your very own
temperature measurement device.
13