Temperature Sensor Block

The Temperature Sensor block gets data from the Temperature Sensor. You can measure the temperature in either degrees Celsius (°C) or degrees Fahrenheit (°F) and get a Numeric output. You can also compare the temperature to a threshold value to get a Logic (True or False) output.

See Using the Temperature Sensor for more information about what the Temperature Sensor does, the data that it provides, and programming examples.
Tips and Tricks
The Temperature Sensor block outputs data with a Data Wire. See Using the Temperature Sensor for other ways to use the Temperature Sensor that don’t require a data wire.
Choose the Sensor Port and Mode


Port Selector
Mode Selector
Inputs
Outputs

Use the Port Selector on the top of the block to make sure that the sensor port number (1, 2, 3, or 4) matches the port on the EV3 Brick that the Temperature Sensor is connected to.

Use the Mode Selector to select the mode for the block. The Inputs and Outputs available will change depending on the mode.
Modes
Measure – Celsius


The Measure – Celsius mode outputs the temperature in degrees Celsius (°C) in the Temperature Celsius output.
Measure – Fahrenheit


The Measure – Fahrenheit mode outputs the temperature in degrees Fahrenheit (°F) in the Temperature Fahrenheit output.
Compare – Celsius


The Compare – Celsius mode compares the temperature in degrees Celsius (°C) to the Threshold Value using the selected Compare Type. The True/False result is output in Compare Result, and the temperature is output in Temperature Celsius.
Compare – Fahrenheit


The Compare – Fahrenheit mode compares the temperature in degrees Fahrenheit (°F) to the Threshold Value using the selected Compare Type. The True/False result is output in Compare Result, and the temperature is output in Temperature Fahrenheit.
Inputs and Outputs
The inputs available for the Temperature Sensor block will depend on the mode selected. You can enter the input values directly into the block. Alternatively, the input values can be supplied by Data Wires from the outputs of other Programming Blocks.
InputTypeAllowed ValuesNotes
Compare Type Numeric0 - 50: = (Equal to)
1: ≠ (Not Equal to)
2: > (Greater than)
3: ≥ (Greater than or Equal to)
4: < (Less than)
5: ≤ (Less than or Equal to)
Threshold Value NumericAny numberValue to compare sensor data to
The outputs available will depend on the mode selected. To use an output, use a Data Wire to connect it to another Programming Block.
OutputTypeNotes
Temperature Celsius NumericTemperature in degrees Celsius (-20 to 120°C).
Temperature Fahrenheit NumericTemperature in degrees Fahrenheit (-4 to 248°F).
Compare Result LogicTrue/False result of a Compare mode.
Temperature
Quick links