Embedded/Arduino

Arduino Nano + OSTSen-T007(TMP007) (MEMS) thermopile sensor Test

변화의 물결1 2024. 3. 17. 01:30

 

 

안녕하세요.

 

  지난번 비접촉 센서와 다른 타입의 센서를 구하게 되어서 테스트해 보았습니다.

 

  온도에 따라 물체에서 나오는 적외선이 다르기 때문에 비접촉으로 절대온도는 아니지만, 비슷하게 적외선으로 온도를 측정할 수 있습니다. 그중에 TI에서 내놓은 TMP007 MEMS 타입을 확인해 보겠습니다.

 


 

1. 제품 설명

 

  OSTSen-T007 is a microelectro-mechanical system (MEMS) thermopile sensing module, which is based on Texas Instruments TMP007. The TMP007 is a fullyintegrated microelectro-mechanical system (MEMS) thermopile sensor that measures the temperature of an object without direct contact. The thermopile absorbs passive infrared energy from an object at wavelengths between 4um to 16 um within the end- user defined field of view.

 

 

스펙트럼

 

 

  쉽게 설명하면, OSTSen-T007는 MEMS 타입의 써모파일 온도센서입니다. TI 사의 TMP007 모듈을 사용한 비접촉 온도 센서이고 감지 파장은 4㎛ ~ 16㎛ (대략 중적외선 범위)이라고 보시면 됩니다.  (TMP007 센서를  I2C 통신할 수 작게 만들어 놓은 모듈)  

 

 

2. TMP007 스펙

 

- ±1°C (max) from 0°C to +60°C

- ±1.5°C (max) from -40°C to +125°C

- I2C and SMBus Compatible

- Eight Programmable Addresses

- Supply: 2.5V to 5.5V

- Active Current: 270uA(typ)

- 2uA shutdown (max)

- TMP007 Size : 1.9mm x 1.9mm x 0.625mm DSBGA

- OSTSen-T007 Size :

 

OSTSen-T007 Size

 

 

3. 회로 확인

 

  - 참고로 adafruit 제품(TMP-006)이지만, 참고하시면 좋을 듯합니다.

 

 

adafruit 회로도

 

 

4. 연결하기

 

 - 모듈 뒷면에 보면 실크로 핀 이름이 표기되어 있습니다.

 

 

아두이노 나노와 연결

 

 

아두이노 나노 OSTSen-T007(TMP007)
A5핀 SCL
A4핀 SDA
5V VCC
GND GND
GND A0   (Default Address 0x40)

 

 

5. 소스 확인

 

- TMP007 해서 아두이노로 검색해 보면 두 회사의 소스가 많이 나오는 것을 알 수 있었습니다.

 

1) adafruit 소스

 

- 우선 모듈을 테스트하기 위해서 Adafruit TMP007 라이브러리를 다운로드합니다.

 툴(tool) -> 라이브러리 관리 -> Adafruit TMP007 -> 설치

 

 

라이브러리 검색

 

 

   - 메시지 창이 나타날 수 있습니다. "Install all"로 연관되어 있는 라이브러리를 같이 설치할지 물어봅니다.

Adafruit BusIO  라이브러리가 추가로 설치되었습니다.

 

 

필요 라이브러리 추가설치

 

 

- 예제로 소스파일을 확인할 수 있습니다.

  파일 -> 예제 -> Adafruit TMP007 Library -> tmp007

  (아니면, github에서 소스를 확인할 수 있습니다. 소스 동일합니다.)

   

 

#include <Wire.h>
#include "Adafruit_TMP007.h"

// Connect VCC to +3V (its a quieter supply than the 5V supply on an Arduino
// Gnd -> Gnd
// SCL connects to the I2C clock pin. On newer boards this is labeled with SCL
// otherwise, on the Uno, this is A5 on the Mega it is 21 and on the Leonardo/Micro digital 3
// SDA connects to the I2C data pin. On newer boards this is labeled with SDA
// otherwise, on the Uno, this is A4 on the Mega it is 20 and on the Leonardo/Micro digital 2

Adafruit_TMP007 tmp007;
//Adafruit_TMP007 tmp007(0x41);  // start with a diferent i2c address!

void setup() { 
  Serial.begin(9600);
  Serial.println("Adafruit TMP007 example");

  // you can also use tmp007.begin(TMP007_CFG_1SAMPLE) or 2SAMPLE/4SAMPLE/8SAMPLE to have
  // lower precision, higher rate sampling. default is TMP007_CFG_16SAMPLE which takes
  // 4 seconds per reading (16 samples)
  if (! tmp007.begin()) {
    Serial.println("No sensor found");
    while (1);
  }
}

void loop() {
   float objt = tmp007.readObjTempC();
   Serial.print("Object Temperature: "); Serial.print(objt); Serial.println("*C");
   float diet = tmp007.readDieTempC();
   Serial.print("Die Temperature: "); Serial.print(diet); Serial.println("*C");
   
   delay(4000); // 4 seconds per reading for 16 samples per reading
}   

 

 

2) sparkfun 소스

 

- github에서 다운로드하여 컴파일하고 다운로드시킵니다. (아래 소스만 있어서는 안 되고 I2C 관련 포함된 소스로 같이 실행시켜야 합니다. 하단 참조 사이트 3번 참고)

 

 

#include <stdint.h>
#include <math.h>
#include <Wire.h>
#include "I2C_16.h"
#include "TMP006.h"

uint8_t sensor1 = 0x40; // I2C address of TMP006, can be 0x40-0x47
uint16_t samples = TMP006_CFG_8SAMPLE; // # of samples per reading, can be 1/2/4/8/16

void setup()
{
  Serial.begin(9600);
  Serial.println("TMP006 Example");

  config_TMP006(sensor1, samples);
}

void loop()
{
  float object_temp = readObjTempC(sensor1);
  Serial.print("Object Temperature: "); 
  Serial.print(object_temp); Serial.println("*C");

  float sensor_temp = readDieTempC(sensor1);
  Serial.print("Sensor Temperature: "); 
  Serial.print(sensor_temp); Serial.println("*C");

  delay(2000); // delay 1 second for every 4 samples per reading
}

 

 

6. 동작 확인

 

 

 

뜨거운 물 온도 측정

 

 

7. 사용후기

 

  - 이번 모듈은 한 개 가지고 있어서 고장인지 확인할 수는 없었지만, 샘플링하는 횟수를 줄이고 측정 시간도 줄이고 해도 실제 온도 변화를 따라가는 것이 많이 느렸습니다. 그리고 온도가 대략 맞을 때까지 시간도 오래 걸리고 오차도 2~5도까지 나타났습니다. 측정 시 2~3cm 거리를 확보해 주어야 그래도 대략적인 온도를 확인할 수 있었습니다.

 

  - 모듈이 문제였는지 아니면 정확하게 작동을 시키지 못해서인지 모르겠지만, 약간 비접촉 온도 측정에 있어서 다른 모듈에 비해 만족스럽지는 않은 결과였습니다.

 

감사합니다.

 

 

<참고 사이트>

1) IR Infrared Radiation   적외선

http://www.ktword.co.kr/abbr_view.php?m_temp1=2709

2) OSTSen-T007 User Guide

3) https://www.sparkfun.com/products/retired/11859

4) https://learn.adafruit.com/adafruit-tmp007-sensor-breakout/arduino  

반응형