Using the Temperature Sensor

The Temperature Sensor measures the temperature at the tip of its metal probe. You can measure the temperature in either degrees Celsius (°C) or degrees Fahrenheit (°F).

You can use the temperature sensor, for example, to measure the air temperature around your robot, or to track changes in water temperature.
Temperature Sensor Data
The Temperature Sensor can give the following data:
DataTypeRangeNotes
Degrees CelsiusNumeric-20 to 120Temperature in degrees Celsius (°C)
Degrees FahrenheitNumeric-4 to 248Temperature in degrees Fahrenheit (°F)
Examples Using the Temperature Sensor
Some examples of how you can use the Temperature Sensor in your program are shown below.
Example 1: Beep when the Sensor Gets Warmer
This program has the robot make a beep sound once the temperature at the end of the probe rises by 5°F. The Program uses the Wait block in the Temperature Sensor – Change – Fahrenheit mode to wait for the temperature of the probe to increase by 5°F.
Tips and Tricks
Try warming the probe with your hands while running this program.
Example 2: Display “Hot” or “Cold” depending on the Temperature
This program changes the display to show “Hot” or “Cold” depending on whether the temperature is greater than 80°F. The program uses a Switch block in the Temperature Sensor – Compare – Fahrenheit mode to choose between two different Display blocks.
Tips and Tricks
While running this program, try moving the temperature sensor probe between glasses of hot and cold water.
Example 3: A Temperature Controlled Motor
This program varies the speed of a motor based on the temperature of the temperature sensor. It uses the Temperature Sensor block in Measure – Celsius mode to measure the temperature. The result is connected to the Power input of a Medium Motor block using a data wire.
Tips and Tricks
Try sampling the temperature of different objects while this program is running.
Temperature Sensor Blocks and Modes
The table below shows all of the programming blocks and modes that you can use with the Temperature Sensor.
BlockModeUse
Wait Temperature Sensor - CompareWait for the temperature to reach a certain value.
WaitTemperature Sensor - ChangeWait for the temperature to change by a certain amount.
Loop Temperature SensorRepeat a sequence of blocks until the temperature reaches a certain value.
Switch Temperature SensorChoose between two sequences of blocks based on the temperature.
Temperature SensorMeasureMeasure the temperature, and get the result on a Numeric data wire.
Temperature SensorCompareCompare the temperature to a threshold, and get the result on a Logic data wire.
Data LoggingSee Data Logging.
Temperature
Quick links