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
  • UART 설정
  • UART mode
  • UART command
  • Sensor response interface protocol
  • 모드 설정 및 미세먼지 농도 읽기
  1. Product document
  2. Plantower
  3. 통신 프로토콜

UART

UART 통신 프로토콜

적용 모델: PMS A003A, PMS A003C, PMS 7003, PMS 7003M, PMS 5003, PMS 9003M

UART 설정

PARAMETER
TYP

Baud Rate (Fixed)

9600 bps

Data Bits

8

Parity

None

Stop Bits

1

Flow Control

None

UART mode

mode
Description

Active mode

데이터를 연속적으로 보내주는 모드. 기본 설정 값

Passive mode

사용자의 요청이 있을 때만 데이터를 보내주는 모드

Sleep mode

절전 모드

UART command

Command
Data 1
Data 2
Data 3
Data 4
Data 5
Data 6
Data 7

Active

0x42

0x4d

0xe1

0x00

0x01

0x01

0x71

Passive

0x42

0x4d

0xe1

0x00

0x00

0x01

0x70

Data request

(Passive status)

0x42

0x4d

0xe2

0x00

0x00

0x01

0x71

sleep

0x42

0x4d

0xe4

0x00

0x00

0x01

0x73

Wake up

0x42

0x4d

0xe4

0x00

0x01

0x01

0x74

Sensor response interface protocol

모드 설정 및 미세먼지 농도 읽기

  • 사용 라이브러리: SoftwareSerial, PMS

  • PMS7003을 사용하여 예제 code 작성

#include "PMS.h"
#include <SoftwareSerial.h>
SoftwareSerial mySerial(12, 13); //Uno Rx Tx (12 13) = SoftwareSerial

PMS pms(mySerial);
PMS::DATA data;

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

void loop()
{
  if (pms.read(data))
  {
    Serial.println("Data:");

    Serial.print("PM 1.0 (ug/m3): ");
    Serial.println(data.PM_AE_UG_1_0);

    Serial.print("PM 2.5 (ug/m3): ");
    Serial.println(data.PM_AE_UG_2_5);

    Serial.print("PM 10.0 (ug/m3): ");
    Serial.println(data.PM_AE_UG_10_0);

    Serial.println();
  }
}
  • 시리얼 모니터

#include "PMS.h"
#include <SoftwareSerial.h>
SoftwareSerial mySerial(12, 13); //Uno Rx Tx (12 13) = SoftwareSerial

PMS pms(mySerial);
PMS::DATA data;

void setup()
{
  Serial.begin(9600);   
  mySerial.begin(9600);  
  pms.passiveMode();    // Switch to passive mode
}

void loop()
{
  Serial.println("Wake up, wait 30 seconds for stable readings...");
  pms.wakeUp();
  delay(30000);

  Serial.println("Send request read...");
  pms.requestRead();

  Serial.println("Wait max. 10 seconds for read...");
  if (pms.read(data, 10000))
  {
    Serial.println("Data:");

    Serial.print("PM 1.0 (ug/m3): ");
    Serial.println(data.PM_AE_UG_1_0);

    Serial.print("PM 2.5 (ug/m3): ");
    Serial.println(data.PM_AE_UG_2_5);

    Serial.print("PM 10.0 (ug/m3): ");
    Serial.println(data.PM_AE_UG_10_0);
  }
  else
  {
    Serial.println("No data.");
  }

  Serial.println("Going to sleep for 60 seconds.");
  pms.sleep();
  delay(60000);
}
  • 시리얼 모니터

Previous통신 프로토콜NextI2C

Last updated 1 year ago