Using Arduino and a Vernier Temperature Probe you can measure and compare temperatures between liquids, while also adding a command to illuminate an LED. The Temperature Sensor will determine the temperature level of a liquid, and indicate whether it is hot or cold relative to the indicated setting on your Arduino. Depending on the temperature of the liquid, a light will go on/off indicating when the liquid has reached the desired temperature.
In this project, you will learn how to make a temperature probe function with Arduino, as well as the function to make an LED emit light for a given temperature. You will start by building the circuit, plugging in the code and finally testing it using different temperatures of liquid.
Here is a video of the end product: http://www.youtube.com/watch?v=vHH2bnjvt9U&feature=youtu.be
For the basic build you'll need the following materials:
- Arduino Uno microcontroller
- Solderless breadboard
- One 220Ω resistor
- One 470Ω resistor
- Jumper wires (connecting wires)
- Vernier Temperature Probe
- One LED
- Wire cutters/strippers
- Soldering iron
Now that you have gotten the materials, lets begin!
Step 1: Preparing Your Temperature Probe
Step 2: Building a Temperature Sensor Circuit
Following the schematic, build the circuit on the breadboard as shown in the third photo. One wire of the thermistor of the Vernier Temperature Probe is connected to 5V, while the other is connected to Arduino's analog pin A5. Use the 220Ω resistor for this circuit.
*Thermistor is running to 5V and analog pin 5
*220Ω resistor is attached to ground and running to analog pin 5
*Attach one jumper wire from ground to the negative rail
*Attach one jumper wire from 5V to the positive rail
Note: Image of thermistor in circuit drawing is inaccurate
Step 3: Program the Arduino : Thermistor
This code turns on the serial monitor and allows the Vernier Temperature Probe to output numerical values based on the temperature of the environment the probe is in. In this case the output are numbers from 0-100 (low numbers corresponding to low units of temperature, high numbers corresponding to higher units of temperature).
1. pinMode: Measures the inputs of analog pin 5
2. analogRead: Reads the inputs from the thermistor
3. map(): Makes values from serial monitor print from 0 to 1023 (current range) into 0 to 100 (target range)
Before we move on to the next step, let's check to make sure the temperature probe works! Fill two glasses with water: one with cold, one with hot. Insert Vernier temperature probe into the cold water: numbers on the serial monitor (between 0-100) should register as a low value. Then insert the probe into the cup of hot water; readings on the serial monitor should increase and be a relatively high value.
Step 4: Connect the LED to Your Circuit
*LED cathode (short leg) running to ground
*LED anode (long leg) running to to digital pin 13
*470Ω resistor running to pin 13 and anode of LED
*Attach one jumper wire from cathode of LED to the negative rail
*Attach one jumper wire from the resistor to the positive rail
Step 5: Reprograming the Arduino With LED
This code indicates that if the serial monitor outputs a number greater than or equal to 60, then the LED will omit light (turn on). If the serial monitor reads a value that does not fit under this restriction (“else”), then the LED will turn off.
1. if... else: else can proceed another if test, so that multiple, mutually exclusive tests can be run at the same time. Each test will proceed to the next one until a true test is encountered.
2. analogWrite: value id the duty cycle; between 0 (always off) and 255 (always on).
-if(reading) can be changed based on personal preference
-Serial.println() text can be changed based on personal preference
Step 6: Combined Code !
Step 7: Lets Try It Out!
Fill two cups up with water; one with hot water, and the other with cold water. Connect your Arduino to your computer using an adapter cord and open the Serial Monitor on Arduino.
Insert the probe in the cold water first, and watch what happens. Then put it into the hot water, what changes? When the probe is submerged in cold water, the LED should turn off. When the probe is submerged in hot water, the LED should turn on.
Hope this was helpful, have fun!