Sean P. Robinson
spatrick@mit.edu
1 / 13
Outline
2 / 13
What we did, and why we did it
WHAT: We used an Arduino microcontroller to
build a fancy thermostat.
Several experiments use heating ovens with temperature control by
setting variac voltage supply to a resistive heating element.
Requires trial and error to establish voltage-temperature relation
Slow to stabilize (10s of minutes) trial and error is tedious!!
Use a thermostat (negative feedback towards set point) instead!
This exercise: lets add challenge by using the PID control algorithm
instead of simple (threshold model) thermostat.
3 / 13
xkcd.com/730/
4 / 13
Microcontrollers: What are they?
Definition
Microcontroller : a small computer, often consisting of a single board
running whatever program has been uploaded to it, whose inputs and
outputs are analog and/or digital voltage ports. (Usually includes a
power input and some kind of serial connection for receiving uploaded
programs from some other computer.)
5 / 13
Why Arduino?
6 / 13
What does a working project with a
microcontroller look like?
7 / 13
How to start a project
Assuming you have an idea of something to build . . .
Get Arduino software Check out tutorials!!
(free) and hardware (cheap) Getting Started with
Download the Arduino IDE Arduino is what it sounds like:
development environment: arduino.cc/en/Guide/
arduino.cc/en/Main/Software HomePage
Buy Arduino hardware. Many Lady Adas tutorial is the best:
suppliers, but we like these guys: www.ladyada.net/learn/
www.adafruit.com/category/17 arduino/
Take a glance at the Arduino
Dont get confused by the varieties of
playground:
Arduino boards. Unless your project is
arduino.cc/playground/
high-performance, you probably want the
projects/ideas
Arduino Uno.
8 / 13
The joy of open source
9 / 13
Use other peoples code!
Every Arduino program needs a function named void setup() and
one named void loop().
10 / 13
About our temperature controller
project: two goals
1 An excuse to learn Arduino
2 Build a cheap, useful temperature controller.
The first goal outweighs the second, so we may make some odd choices.
11 / 13
Performance
300
120
250
100
200
80
150
deg C
Lid
deg C
60
Power switched Removed
100 off (10 mins) 40
50
20
0
0
0 10 20 30 40 50 60 70 80
0 5 10 15 20 25 30 35 40
Minutes minutes
140
120
100
Tuning PID constants is difficult.
80
deg C
12 / 13
Lets think of a project . . .
13 / 13