Allsensing Docs
올센싱 쇼핑몰올센싱 블로그
한국어
한국어
  • 올센싱 기술 문서
  • Product document
    • Allsensing
      • AGSM 사용 설명서
      • AGSM 아두이노 활용
      • AGSM IoT 활용(ESP32)
      • 올센싱 가스센서 모듈
      • 온습도센서(아날로그)
      • 온습도센서(디지털)
    • Nevadanano
      • 센서 특징
      • 디바이스 연결 방법
      • 통신프로토콜
      • 3.0/4.0/5.0 Version 변경사항
    • GSS
      • 설명
      • CozIR-LP2
      • CozIR-LP3
      • CozIR-Blink
        • 디바이스 연결 방법
        • 통신 프로토콜
          • 모드 설정 및 CO2 값 읽기
          • 인터페이스 유형별(UART,I2C) CO2값 읽기
          • Digital filter
          • UART Command
      • ExplorIR
        • 디바이스 연결 방법
        • 통신 프로토콜
          • 모드 설정 및 CO2 값 읽기
          • Digital filter
          • UART Command
      • SprintIR 6S
        • 디바이스 연결 방법
        • 통신 프로토콜
          • 모드 설정 및 CO2 값 읽기
          • Digital filter
          • UART Command
    • EC-Sens
      • 제품 종류 및 이론
      • EC Sense 센서 구동 회로
      • 가스 센서 모듈
      • TB600B(C),TB200B
      • TB420
      • DGM10
      • EC Sense DS4 Series
    • SST
    • Temp&Humi
      • ETH-01DV
      • ETH-01D
        • 디바이스 연결 방법
        • 통신 프로토콜
          • 온·습도 읽기
          • 온·습도 Resolution 읽기 및 쓰기
          • Sensor ID 읽기
          • Address 읽기 및 쓰기
        • Thingspeak 활용방법
    • Plantower
      • 디바이스 연결 방법
      • 통신 프로토콜
        • UART
        • I2C
    • DD Scientific
      • 배경지식
      • 회로도
        • 2전극 센서
        • 3전극 센서
        • DUAL Toxic
        • O2
        • 바이어스 센서
      • 애플리케이션
      • Q&A
  • 참고문서
    • 전기화학식 가스센서
      • 전기 화학식 가스 센서 Q&A
Powered by GitBook
On this page
  1. Product document
  2. Temp&Humi
  3. ETH-01D
  4. 통신 프로토콜

Sensor ID 읽기

Previous온·습도 Resolution 읽기 및 쓰기NextAddress 읽기 및 쓰기

Last updated 1 year ago

Step 1. ETH-01D I2C command 전송

  • Device에서 command(i2c Address(0x44),0xa0,0x00,0x00)를 ETH-01D로 전송

Step 2. 상위 Sensor ID 요청 Command

  • Device에서 Command((i2c Address+Write bit),0x1E(ID 상위 바이트), 0x00, 0x00)를 ETH-01D로 전송 후 120 μs 기다림

Step 2.1. 상위 Sensor ID 응답

  • Sensor ID 상위 바이트(16bit)를 읽음

Step 3. 하위 Sensor ID 요청 Command

  • Device에서 Command ((i2c Address+Write bit),0x1F(ID 하위 바이트), 0x00, 0x00)를 ETH-01D로 전송 후 120 μs 기다림

Step 3.1 하위 Sensor ID 응답

  • Device에서 Command ((i2c Address+Write bit),0x1F(ID 하위 바이트), 0x00, 0x00)를 ETH-01D로 전송 후 120 μs 기다림

소스 코드

#include <Wire.h>
#define slave_address 0x44
#define Sensor_power_port 6 // Arduino uno, Arduino mkr 1010, esp32
//#define Sensor_power_port 16 //esp8266
#define Power_enable digitalWrite(Sensor_power_port, HIGH)
#define Power_disable digitalWrite(Sensor_power_port, LOW)
void setup()
{
Wire.begin(); // Arduino uno, Arduino mkr 1010
// Wire.begin(7,8,5000); //esp32
// Wire.begin(4,5,5000); //esp8266
Serial.begin(9600);
pinMode(Sensor_power_port, OUTPUT);
}
void loop()
{
int Status;
int RegisterValueHigh;
int RegisterValueLow;
//===Module Power Reset===
Power_disable;
delay(1);
Power_enable;
delay(2); //10msec 이내에 신호 전송되어야함
// 레지스터 주소 쓰기===
//프로그래밍 모드로 들어가기 위한 명령, 명령어 처리 시까지 120usec 시간이 소요됨.
Wire.beginTransmission(slave_address);
Wire.write(0xA0);
Wire.write(0x00);
Wire.write(0x00);
Wire.endTransmission();
delayMicroseconds(120);
//Sensor 상위 id 요청
Wire.beginTransmission(slave_address);
Wire.write(0x1E);
Wire.write(0x00);
Wire.write(0x00);
Wire.endTransmission();
delay(1);
//Sensor 상위 id 응답
Wire.requestFrom(slave_address, 3);
if (Wire.available()) {
Status = Wire.read();
RegisterValueHigh = Wire.read();
RegisterValueLow = Wire.read();
Serial.print(" Sensor id_high: ");
Serial.print(Status, HEX); // status success = 0x81
Serial.print(" ");
Serial.print(RegisterValueHigh, HEX);
Serial.print(" ");
Serial.println(RegisterValueLow, HEX);
}
//Sensor 하위 id 요청
Wire.beginTransmission(slave_address);
Wire.write(0x1F);
Wire.write(0x00);
Wire.write(0x00);
Wire.endTransmission();
delay(1);
//Sensor 하위 id 응답
Wire.requestFrom(slave_address, 3);
if (Wire.available()) {
Status = Wire.read();
RegisterValueHigh = Wire.read();
RegisterValueLow = Wire.read();
Serial.print(" Sensor id_low: ");
Serial.print(Status, HEX); // status success = 0x81
Serial.print(" ");
Serial.print(RegisterValueHigh, HEX);
Serial.print(" ");
Serial.println(RegisterValueLow, HEX);
}
// 프로그래밍 모드에서 일반 모드로 전환
Wire.beginTransmission(slave_address);
Wire.write(0x80);
Wire.write(0x00);
Wire.write(0x00);
Wire.endTransmission();
delay(1000);
}
  • Sensor id 읽기 시리얼 모니터