Grove - Temperature Sensor

From Wiki
Jump to: navigation, search


The Grove - Temperature Sensor uses a Thermistor to detect the ambient temperature. The resistance of a thermistor will increase when the ambient temperature decreases. It's this characteristic that we use to calculate the ambient temperature. The detectable range of this sensor is -40 - 125ºC, and the accuracy is ±1.5ºC



Voltage: 3.3 ~ 5V Max power rating at 25℃: 300mW Zero power resistance: 10 KΩ Operating temperature range: -40 ~ +125 ℃ Demonstration

With Arduino Here is an example to show you how to read temperature information from the sensor.

1. Connect the module to the Analog port 0 of Grove - Basic Shield using the 4-pin grove cable.

2. Plug the Grove - Basic Shield into Arduino. 3. Connect Arduino to PC by using a USB cable.

Tempreture Sensor Connector.jpg

4. Upload Code below. Please click here if you do not know how to upload.

/* /* Grove - Temperature Sensor demo v1.0

  • This sensor detects the environment temperature,
  • Connect the signal of this sensor to A0, use the
  • Serial monitor to get the result.
  • By:
  • /
  1. include <math.h>

int a; float temperature; int B=3975; //B value of the thermistor float resistance;

void setup() {



void loop() {

 resistance=(float)(1023-a)*10000/a; //get the resistance of the sensor;
 temperature=1/(log(resistance/10000)/B+1/298.15)-273.15;//convert to temperature via datasheet ;
 Serial.print("Current temperature is ");

5. You can check the readings via the Serial Monitor. The default unit is Celsius degree.

Temperature Sensor Score.jpg

As a reference, the following is the resistance curve of TTC3A103*39H, the thermistor we used on this sensor. The higher the temperature goes, the smaller the resistance becomes.


With Raspberry Pi 1.You should have got a raspberry pi and a grovepi or grovepi+.

2.You should have completed configuring the development enviroment, otherwise follow here.


Plug the sensor to grovepi socket D3 by using a grove cable. 4.Navigate to the demos' directory:

  cd yourpath/GrovePi/Software/Python/

To see the code

  nano   # "Ctrl+x" to exit #

import time import grovepi

  1. Connect the Grove Temperature Sensor to analog port A0

sensor = 0

while True:

       temp = grovepi.temp(sensor,'1.1')
       print "temp =", temp
   except KeyboardInterrupt:
   except IOError:
       print "Error"

5.Run the demo.

  sudo python