1 / 19

Tinyos 센싱

Tinyos 센싱. Sense 프로그램 분석 및 온도 / 습도 측정 방법 Oscilloscope 분석 및 수정. TinyOS 상에서 sensing 데이터 획득 방법. 두 가지 절차 Configuring a sensor Reading the sensor data Configuring a sensor 플랫폼 , 센서 종류 , 사용 인터페이스 (ADC or another interface) 에 따라 달라짐 TinyOS 2.X 상에서는 플랫폼 - 독립적으로 공용 인터페이스를 사용

Télécharger la présentation

Tinyos 센싱

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Tinyos 센싱 • Sense 프로그램 분석 및 온도/습도 측정 방법 • Oscilloscope 분석 및 수정

  2. TinyOS 상에서 sensing 데이터 획득 방법 • 두 가지 절차 • Configuring a sensor • Reading the sensor data • Configuring a sensor • 플랫폼, 센서 종류, 사용 인터페이스(ADC or another interface)에 따라 달라짐 • TinyOS 2.X 상에서는 플랫폼-독립적으로 공용 인터페이스를 사용 • 관련 인터페이스: Read, ReadStream, ReadNow • 주로 Read 인터페이스를 사용하여 센서의 종류와 관계 없이 디지털로 변환된 센싱 값을 취득 • Configuring 시에 자신이 사용하는 센서에 맞는 센싱 component(read 등의 인터페이스 지원)를 설정해야 함

  3. Sense Application (1) /opt/tinyos-2.x/apps/Sense SenseAppC.nc (Configuration) SenseC 일부

  4. Sense Application (2) • Read interface (/opt/tinyos-2.x/tos/interface) • val_t 데이터 형 • 여러 가지 데이터 형을 가지는 모든 종류의 센서들을 지원하기 위한 일종의 undefined 데이터 형태 • Configuring 시에 실제 사용하는 데이터 형으로 설정하면 됨, Sense 응용에서는 <uint16_t> 를 사용함

  5. Sense Application (3) • ADC (Analog-to-Digital Convert)장치 • 센서 플랫폼에 결합되는 대부분의 센서들은 ADC 장치에 의해서 측정한 아날로그 값을 디지털 값을 변환하여 전달함 • 센서가 취득한 아날로그 형태의 값을 디지털 값으로 변환하는 장치를 ADC 장치라고 함 • 대부분의 물리적인 환경 데이터(온도, 습도, 조도 등)은 아날로그 값 • 센서 종류에 따라 조금 다르나 대부분의 센서(센싱 보드)들은 내부에 ADC를 가지며 12/14 비트로 변환된 디지털 데이터를 제공함

  6. 참고: 실제 온도/습도 변환 • 실제 우리가 사용하는 온도, 습도 값으로 변환하기 위해서는 다음과 같은 식의 변환이 필요하다. • SHT11 센서를 사용 경우, 획득 ADC 값을 실제 단위 값 환산

  7. Sense Application (5) SenseC 코드

  8. DemoSensorC component • DemoSensorC 컴포넌트 • 자신의 플랫폼에 따라 자동 로딩됨 • 만약 teolosb 일 경우, /opt/tinyos-2.x/tos/platforms/telosb • 현재는 VoltageC 컴포넌트와 연결되어, 실제 센싱 값이 아닌 내부 Mote의 전압 값이 센싱됨 • Mote 센서 보드에서 센싱한 값을 읽어 들이기 위해서는 VoltageC 대신 실제 센서 컴포넌트와 연결해야 함 • 센서 보드 구입 시 제공하는 매뉴얼 및 데이터 시트를 참조

  9. SHT11 센서를 이용한 온도/습도 측정 방법 • 현재 실습 중인 Telsob 통신 노드에는 MTS-EM100이라는 센서 보드가 부착되어 있음. • Maxfor사의 MTS-EM1000 센서 보드 (상세 내용은 해당 매뉴얼 참조) • SHT11 센서를 내장하여 온도 및 습도 측정 • S1087 및 S1087-01 센서를 내장하여 광(조도) 측정

  10. SHT11 센서용 온도/습도 제공 컴포넌트 ~/tos/platforms/telosa/chips/sht11 SensirionSht11C() 컴포넌트

  11. SHT11 센서의 온도 측정 코드 수정 (1) • Sense 프로그램 수정 • ~/apps/Sense 프로그램을 SenseTemp로 복사

  12. SHT11 센서의 온도 측정 코드 수정 (2) • SenseApp.nc 수정 • DemoSensorC 컴포넌트 대신 SensirionSht11C 컴포넌트 사용 • SenseC.Read 인터페이스를 Sht11의 Temperature로 연결 • 컴파일 및 설치해서 동작시켜 볼 것

  13. Oscilloscope Application • 수행 기능 • 주기적(250ms)으로 DemoSensorC에서 센싱값을 획득 • 전체 10개의 센싱 데이터가 생성되면, 이를 radio를 통해 브로드캐스트 시킴 • OsilloscopeApp.nc (Configuration) • ~/apps/Oscilloscope

  14. Oscilloscope Application (2) Osilloscope.h

  15. Oscilloscope Application (3) OscilloscopeC.nc

  16. Oscilloscope Application (4)

  17. Oscilloscope 테스트 • Node 1 (BaseStation 동작) • cd /opt/tinyos-2.x/apps/BaseStation/ • make telosb install.X0 • Node 2 (Oscilloscope 동작: Sensing & Sending) • cd /opt/tinyos-2.x/apps/Oscilloscope/ • make telosb install.X1 • Node 3 (Oscilloscope 동작: Sensing & Sending) • cd /opt/tinyos-2.x/apps/Oscilloscope/ • make telosb install.X2 • Vmware 상 • Serial forwarder 동작 & Packet read 확인 (지난 수업 참조) • $ java net.tinyos.sf.SerialForwarder • cd /opt/tinyos-2.x/apps/Oscilloscope/java • make • ./run

  18. 조도 측정 조도 측정 Configuration

  19. Oscilloscope 테스트및 실습 • 실습: 앞의 Sense 프로그램 수정과 같이 • 센싱 데이터를 “온도”로 변환하여, 위의 그림과 같이 테스트 • 센싱 데이터를 “습도” 또는 “조도” 변환하여, 테스트

More Related