Grove - Temperature Sensor V1.2

Introduction

3.3V 5.0V

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

Note: This wiki works with Grove - Temperature sensor V1.1 as well, for V1.0 please refer to Grove - Temperature Sensor

Specifications

  • Voltage: 3.3 ~ 5V
  • Zero power resistance: 100 KΩ
  • Resistance Tolerance: ±1%
  • Operating temperature range: -40 ~ +125 ℃
  • Nominal B-Constant: 4250 ~ 4299K

Tip

More details about Grove modules please refer to Grove System

Platforms Supported

Getting Started

After this section, you can make Grove - Temperature Sensor V1.1/1.2 run with only few steps.

Preparations

Now we are making a simple demo to get data from Grove - Temperature Sensor V1.1/1.2 require following modules.

  • Seeeduino v4.2

Seeeduino V4.2 is fully compatible with Arduino.If this is your first time using Arduino, Please refer to here to start your Arduino journey.

Hardware Connection

Just connect Grove - Temperature Sensor into A5 connector of Seeeduino v4.2 as shown below:

Download

Launch Arduino IDE and click File>New to open a new page.

Then copy below code into Arduino IDE:

// Demo code for Grove - Temperature Sensor V1.1/1.2
// Loovee @ 2015-8-26

#include <math.h>

const int B = 4275;               // B value of the thermistor
const int R0 = 100000;            // R0 = 100k
const int pinTempSensor = A5;     // Grove - Temperature Sensor connect to A5

void setup()
{
    Serial.begin(9600);
}

void loop()
{
    int a = analogRead(pinTempSensor);

    float R = 1023.0/a-1.0;
    R = R0*R;

    float temperature = 1.0/(log(R/R0)/B+1/298.15)-273.15; // convert to temperature via datasheet

    Serial.print("temperature = ");
    Serial.println(temperature);

    delay(100);
}

Click Tools>Board to choose Arduino UNO and select respective serial port.

Now click Upload(CTRL+U) to burn testing code. Please refer to here for any error prompt and you can also add comment on forum

Review Results

After upload completed, Open Serial Monitor of your Arduino IDE, you can get the temperature:

Reference

If you want to know how the algorithm of temperature coming, please refer to the below image:

Resources


ArduinoWioBeagleBoneRaspberry PiLinkIt ONE

Caution

The platforms mentioned above as supported is/are an indication of the module's hardware or theoritical compatibility. We only provide software library or code examples for Arduino platform in most cases. It is not possible to provide software library / demo code for all possible MCU platforms. Hence, users have to write their own software library.

Techsupport

For any technical issue, you are most welcome to contact techsupport@seeed.cc, our techsupport engineers will help you. Thank you!

Help us make it better

Welcome to the new documentation system of Seeed Studio. We have made a lot of progress comparing to the old wiki system and will continue to improve it to make it more user friendly and helpful. The improvement can't be done without your kindly feedback. If you have any suggestions or findings, you are most welcome to submit the amended version as our contributor via Github or give us suggestions in the survey below, it would be more appreciated if you could leave your email so that we can reply to you. Happy Hacking!