27
www.tyndall.ie Development of sensor drivers on Tyndall Wireless Platform Wassim MAGNIN Project presentation - 1 st July 2009 Supervisor: Dr. Essa Jafer Master 2 Electronique des Systèmes Communicants

Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie

Development of sensor drivers on Tyndall Wireless Platform

Wassim MAGNINProject presentation - 1st July 2009

Supervisor: Dr. Essa JaferMaster 2 Electronique des Systèmes

Communicants

Page 2: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie2Wassim Magnin - Tyndall National Institute - 2009

Table of Contents

• I. Introduction to Buildwise Project• II. Tyndall Wireless Platform• III. TinyOS and NesC• IV. XubunTOS environment for TinyOS development• V. Drivers development• VI. Graphic User Interface (GUI)• VII. National Access Program (NAP 217)• VIII. Conclusion• IX. Sources

Page 3: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie3Wassim Magnin - Tyndall National Institute - 2009

I. Buildwise Project

Residential building energy monitoring systems are based on non-residential buildings=> unsophisticated, high cost

Goal: specify, design and validate a data management technology platform=> integrated environmental energy management in buildings

Combination of holistic environmental and energy management scenarios

§ integrated building information model§ data mining methods and technologies § wireless sensor network technologies

Page 4: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie4Wassim Magnin - Tyndall National Institute - 2009

I. Buildwise Project

Ø Project Partners • UCC Environmental Research Institute

IRUSE: Informatics Research Unit for Sustainable Engineering

• UCC Department of Civil and Environmental EngineeringIT in AEC: Chair of Information Technology in AEC

• Cork Institute of TechnologyCentre for Adaptive Wireless Systems

Tyndall Platform development and implementation

Page 5: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie5Wassim Magnin - Tyndall National Institute - 2009

II. Tyndall Wireless Platform

Ø 25 25 mmØ Microcontroller ATMEL Atmega 128L

• 128K Bytes of In-System reprogrammable Flash• 4K Bytes EEPROM• 4K Bytes Internal SRAM

Ø Chipcon CC2420 2.4GHz transceiverØ Multi-sensors layerØ Power monitoring layerØ Coin cell battery

Page 6: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie6Wassim Magnin - Tyndall National Institute - 2009

II. Tyndall Wireless Platform

Figure 1: Tyndall mote architecture

Page 7: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie7Wassim Magnin - Tyndall National Institute - 2009

III. TinyOS and NesC

Ø III.1 TinyOS

§ originally developed as a research project in Berkeley

§ open-source operating system designed for wireless embedded sensor networks

§ component-based architecture => minimize code size

§ event-driven execution

§ designed for limited resources (8KBytes of program memory,512 bytes of RAM)

Page 8: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie8Wassim Magnin - Tyndall National Institute - 2009

III. TinyOS and NesC

Ø III.2 NesC

§ Programming language structured for TinyOS concepts§ Java, C,C++ mix§ Separation of construction and composition (component concept)§ Thread of control passed through interfaces

Module Configuration

Component

Interface

Application

Implements Wires

Events

Figure 2: NesC architecture

Page 9: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie9Wassim Magnin - Tyndall National Institute - 2009

III. TinyOS and NesC

Ø InterfaceDefines a set of functions and events

§ Interface providerImplements functions and signals events

§ Interface useruse functions and received events interrupts

readByte

writeByte

readByteDone

Provides Uses ProvidesWriteWord

ReadWord

+ Hardware independence

readWordDone

Component 1 Component 2 Component 3

Figure 3: NesC: Component concept

Uses

Page 10: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie10Wassim Magnin - Tyndall National Institute - 2009

III. TinyOS and NesC

Ø III.3 TinyOS hardware abstraction

§ 3 distinct layers of components§ Each layer dependant of interfaces provided by lower components

Platform Application

Hardware Interface Layer (HIL)

Hardware Adaptation Layer (HAL)

Hardware Presentation Layer (HPL)

Hardware Platform

HW/SW boundaries

Capability of the hardware using OS native concepts

Must provides rich set of customized interfaces

Reflects typical hardware services required by WSNs

Page 11: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie11Wassim Magnin - Tyndall National Institute - 2009

IV. XubunTOS

Figure 4: XubunTOS interface

• Xubuntu OS• Linux-like environment• TinyOS 2.1• Virtual Machine

Page 12: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie12Wassim Magnin - Tyndall National Institute - 2009

V. Drivers development

• Tyndall sensor board

§ Onboard light sensor§ Onboard Temperature and Humidity sensor§ Onboard PIR (Occupency detector)§ Miscellaneous purposes RS485 interface § Onboard 3-axis accelerometer§ Interface for water pipe and radian temperature sensor (external sensor)

Page 13: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie13Wassim Magnin - Tyndall National Institute - 2009

V. Drivers development

Ø V.I Light sensor

§ Example of driver using Atmega ADC§ Use AdcReadClientC component =>§ Concepts of generic component and resources

Figure 6: ADCReadClientC wiring

Figure 5: Light sensor schematics

Page 14: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie14Wassim Magnin - Tyndall National Institute - 2009

V. Drivers development

Ø V.2 I2C protocol ( Temp/Hum sensor and 3-Axis accelerometer)

devices connected to the ATmega128L 2 wires interface (TWI)SCK: clockSDA: data

driver follows I2C protocol with specific features depending on the hardware§ start sequence§ reset sequence needed…

Master ST SAD+W SUB DATA SP

Slave SAK SAK SAK

Figure 7: Write one byte using I2C protocol

Page 15: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie15Wassim Magnin - Tyndall National Institute - 2009

V. Drivers development

Ø V.2 I2C protocol ( Temp/Hum sensor and 3-Axis accelerometer)

LIS302DLRW interface

Accelerometer component

HardwareAdaptation

Layer

Driver

My Application

Accelerometer Reader

Hardware Presentation

Layer

Figure 8: 3-Axis Accelerometer components stack

Read, write, send start, send stop, wait for acknowledgment

Resource (TWI) management (is owner?) basic functions required (init,read X,Y,Z)

Resource arbiter, power management, hardware pins

Page 16: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie16Wassim Magnin - Tyndall National Institute - 2009

V. Drivers development

Ø V.3 Modbus protocol

§ External Water flow meter§ RS485 interface (EIA-485)§ Modbus ASCII mode:

– Frame to send: Address: 0x01 Function: 0x03 Data: 0x05

– Modbus Frame: 3A 30 31 30 33 30 35 D7 46 37 0A

Start Address LRCData End

1 char 2 chars 2 chars0 up to 2 252 char(s) 2 chars CR, LF

Function

2 chars

F7

Page 17: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie17Wassim Magnin - Tyndall National Institute - 2009

V. Drivers development

Ø V.3 Modbus protocol

Acknowledgments, LRC generator, LRC checking

Frame delimiters, ASCII conversion

Modbus interface

RWModbus interface

Modbus protocol

Encoder Framer

Raw UART Platform code for reading/writing bytes over the serial connection

My Application

Figure 9: Modbus components stack

Page 18: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie18Wassim Magnin - Tyndall National Institute - 2009

VI. Graphic User Interface (GUI)

• Using Labview to display data

Figure 10: Temp/Hum/Light/Motion sensors

Page 19: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie19Wassim Magnin - Tyndall National Institute - 2009

VI. Graphic User Interface (GUI)

Figure 11: Accelerometer GUI

Page 20: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie20Wassim Magnin - Tyndall National Institute - 2009

VI. Graphic User Interface (GUI)

Figure 12: Accelerometer demonstration

Page 21: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie21Wassim Magnin - Tyndall National Institute - 2009

VI. Graphic User Interface (GUI)

Acceleration vector

Vector components

aaaxis

rr

arcsin

T x

Xaxis

Yaxis

Zaxis

T z

T y

Acceleration vectors computation:

Page 22: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie22Wassim Magnin - Tyndall National Institute - 2009

VII. National Access Program (NAP217)

Ø NAP 217 purpose

§ Create a java mote using SQAWK Java Virtual Machine (JVM)

§ Based on the SUN Microsystems eSPOT architecture

§ Provides an high level programming interface for Java developers

§ Power management layer

§ CLDC compliant (J2ME)

§ PADS design (PCB design software)

Page 23: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie23Wassim Magnin - Tyndall National Institute - 2009

VII. National Access Program (NAP217)

Figure 13: eSPOT architecture

Page 24: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie24Wassim Magnin - Tyndall National Institute - 2009

VII. National Access Program (NAP217)

• Java SQUAWK layer integration

Java VM Layer (Atmel AT91RM9200)

Tyndall ATmega128L + Zigbee module

Power Management Layer

Battery Layer

USB device

Vcore

Figure 14: Tyndall SQUAWK mote architecture

Page 25: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie25Wassim Magnin - Tyndall National Institute - 2009

VIII. Conclusion

• Get experience with TinyOS and embedded systems

• Deal with hardware and software issues

• Interesting background

• Labview programming

• Work with the latest technologies for communication

• Partnership with other companies research centres

• Experience abroad

Page 26: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie26Wassim Magnin - Tyndall National Institute - 2009

IX. Sources

§ Tinyos website: http://www.tinyos.net/§ Avrdude compiler:http://www.nongnu.org/avrdude/user-

manual/avrdude_4.html§ Modbus protocol: http://www.modbustools.com/modbus.asp§ I2C protocol: http://en.wikipedia.org/wiki/I%C2%B2C§ XubunTOS: http://toilers.mines.edu/Public/XubunTOS§ Wikipedia:www.wikipedia.org

Page 27: Development of sensor drivers on Tyndall Wireless PlatformGraphic User Interface (GUI) ... § Provides an high level programming interface for Java developers § Power management layer

www.tyndall.ie

QUESTIONS?