HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Light Sense Lab. Read data from light(photo diode) sensor, display using oscilloscope.

Slides:



Advertisements
Similar presentations
TinyOS Tutorial, Part I Phil Levis et al. MobiSys 2003.
Advertisements

NesC Prepared for the Multimedia Networks Group University of Virginia.
NesC: A Programming Language for Motes David Gay, Phil Levis, Eric Brewer, Rob von Behren, Nikita Borisov, Mike Chen, David Culler Intel Research, UC Berkeley.
Lab7: Introduction to Arduino
1 Lab 3 Objectives  Case study: “Hello world” program on motes  Write you first program on mote.
MUC Coursework ● Deadline: 16 April ● Add all files to a folder, and send a compressed version of the folder (.zip or.tar) to by 26.
1 Lab4 Objectives  Learn to read light sensor data from sensor board  Learn to transmit a message containing the sensed data  through Mote serial port.
Mote Programming. 如何 compile 程式  make [re]install. : desired device address : target platform  install vs. reinstall install : compile the application.
TinyOS Tutorial Communication Networks I Wenyuan Xu Fall 2006.
GIIS’07 – Marrakech 3 rd July 2007 Behavioural Specification of Wireless Sensor Network Applications Nelson S Rosa and Paulo R F Cunha Universidade Federal.
Tutorial How to use sensors Reporter : Jensen Vinson.
Programming Motes A TinyOS and TOSSIM Tutorial By: Brent Rood.
Development of a Mica2 Mote Sensor Network Cliff Macklin Bill Ehrbar December 8, 2004 University of Colorado, Colorado Springs.
TinyOS Tutorial CS580S Sensor Networks and Systems February 7, 2007 Jisu Oh Dept. of Computer Science SUNY-Binghamton.
PtinyOS: Simulating TinyOS in Ptolemy II Elaine Cheong Dec 10, 2004 EE290N Project Presentation (Initial NC code generator by Yang Zhao and Edward Lee)
5/5/2003MobiSys 2003 Tutorial TinyOS Tutorial, Part II Robert Szewczyk, Joe Polastre, Phil Levis, David Culler Mobisys 2003.
NesC: 1.1 Bumps and Future Directions David Gay, Intel Research, Berkeley (and the nesC and TinyOS teams)
1 Lab 3 Objectives  Case study: “Hello world” program on motes  Write you first program on mote.
TinyOS 2.1 Jun Yi Partially based on the tutorial at IPSN 2009 By Stephen Dawson-Haggerty, Omprakash Gnawali, David Gay, Philip Levis, Răzvan Musăloiu-E.,
TinyOS Tutorial Based on Wenyuan Xu’s slides ( NetsF06/Comnet_TinyOS_Tutorial_xwy.ppt)
TinyOS Tutorial Jianping Wang (merge several tutorials found online)
Feb 2007WSN Training: XMesh Services1 Lab6 Objectives:  Route Control Interface  Understand XMesh transport services 1.Upstream 2.Upstream with end-to-end.
Sown Code Report: Aggregation Tracking Group Management Pascal A. Vicaire University of Virginia
1 Lab 5 Objectives  Use XMesh multi-hop networking service to send sensing data to a base station  Using XServe to display the sensor data message on.
Project #2 Mobile Multiplayer Game: Tic-Tac-Toe Project #3 TinyOS Sensing Application EE194WIR Matt Magpayo
Programming in nesC (and TOSSIM)
April 15, 2005TinyOS: A Component Based OSPage 1 of 27 TinyOS A Component-Based Operating System for Networked Embedded Systems Tom Bush Graduate College.
1 TinyOS Computer Network Programming Wenyuan Xu Fall 2007.
TinyOS 1/2 Onsystech Sangjae Han.
1 Lab2 Objectives  Basics of TinyOS  Basics of nesC programming language.
1 Lab2 Objectives  Basics of TinyOS  Basics of nesC programming language.
HW2: Q&A Oct. 02, Lab Machine TinyOS is installed in one machine (531AB). But, you have to bring your kit. There is a sign up sheet. Please sign.
Wireless Sensor Networks MOTE-KITS TinyOS Crossbow UC Berkeley.
Dhanshree Nimje Smita Khartad
An Introduction to nesC and TinyOS, or, A really complicated way to build very simple applications CENS Summer Internship 07/08/05 Ben Greenstein –
CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.
Lab 3 Introduction to TinyOS and nesC How to debug programs at PC Examples –Blink Timer –Blink –Hellow World Reference: 1.x/doc/tutorial/lesson1.html.
Simulation of Distributed Application and Protocols using TOSSIM Valliappan Annamalai.
TinyOS Tutorial Lesson 8 Data logging application.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 TinyOS & NesC.
Part 2 TinyOS and nesC Programming Selected slides from:
Feb 2007WSN Training: Creating a Simple Sensor Application1 A TinyOS Sensor Application called MyApp Objectives  How to create a simple Mote firmware.
Feb 2007WSN Training: XMesh Services1 Lab6 Objectives:  Route Control Interface  Understand XMesh transport services 1.Upstream 2.Upstream with end-to-end.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Wireless MAC Practice (MAC I)
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Toolkit Installation.
Code Review Time Synchronization Presented by Yong Chen Department of Computer Science University of Virginia.
Lecture 5 Sensing 石致豪. Introduction Sense application SenseAppC.nc configuration SenseAppC { } implementation { components SenseC, MainC, LedsC, new.
HANBACK ELECTRONICS CO., LTD. TinyOS 구조와 스케줄러의 이해 ㈜한백전자 이철희.
Lab 3, Part 2 Selected slides from: Wireless Sensor Networks Hardware/Software Tiny OS & NesC Programming borrowed from Turgay Korkmaz.
TinyOS Sandeep Gupta. Operating System (OS) What is an OS? Main functions  Process management  Memory management  Resource management Traditional OSs.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Gossiping Protocol.
TinyOS By Valliappan Annamalai. Hardware Mica motes (Mica2 and Mica2Dot) Hardware –Radio –Microcontroller –Flash memory –ADC –Sensor Board (MTA310)
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Lab1: LED Control ZigbeX mote has Red, Yellow, Green LED. This lab using LED control component provided by TinyOS.
Based on slides from Andreas Larsson Table from CY Chong, SP Kumar, BA Hamilton - Proceedings of the IEEE, 2003.
HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 HelloWorld By using LED & Timer components, we will display “helloworld” in a manner of Morse code.
Blink Blink.nc configuration Blink { } implementation { components Main, BlinkM, SingleTimer, LedsC; Main.StdControl -> BlinkM.StdControl; Main.StdControl.
Feb 2007WSN Training: XMesh Enabled Sensor App1 Lab 5 Objectives  Use XMesh multi-hop networking service to send sensing data to a base station  Using.
TinyOS Oscilloscope Application Project: micazXpl Developers: Ankit Singh Phillip Orekhov Rishu Seth Natalia Tarique Abdullah.
Cyber-Physical Programming
Presentation by HyounSoo. Kim Embedded System Lab ChungBuk National University Practice 5~6 : 온도 및 습도 센서 제어 및 적외선 센서 제어 (ZigbeX.
Why does it need? [USN] ( 주 ) 한백전자 Background Wireless Sensor Network (WSN)  Relationship between Sensor and WSN Individual sensors are very limited.
TinyOS Sandeep Gupta. TinyOS basics TinyOS is  Single tasking OS  Interrupt driven Written using a Component based language A set of components put.
Simulation of Distributed Application and Protocols using TOSSIM
WSN Training: XMesh Enabled Sensor App
Ad Hoc Networking using Flooding protocol
INC 161 , CPE 100 Computer Programming
An Introduction to nesC
Temperature and Humidity Lab.
WSN Training: TinyOS/nesC Basic Concepts TinyOS and nesC
SenseToRfm SenseToInt.Timer -> TimerC; configuration SenseToRfm {
Presentation transcript:

HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Light Sense Lab. Read data from light(photo diode) sensor, display using oscilloscope.

HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 ZigbeX Photo Diode

HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 ZigbeX Photo Diode Photo diode CDS – named CDS is connected to INT0 & ADC0 on Atmega 128(8bit CPU) –CDS inputs resistance value varying on light strength –Output to ADC0 Light Sensor Component –Photo component

HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Photo component ADCC component –Photo component needs to uses upper level component ADCC. ADCC functions Get data from ADC ADC.getData() – read data from ADC port(command). event ADC.dataReady(uint16_t data) – event delibers.

HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Read Light strength Ex. // upper level comp. xxx_function() { call ADC.getData() … } // upper level comp event ADC.dataReady(uint16_t data) { //data -> measured data … } Photo component

HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Using Oscilloscope

HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Oscilloscope Lab Oscilloscope program –Oscilloscope program delivers data from mote to PC via “com” port Oscilloscope Location –c:\Programfiles\UCB\cygwin\opt\tinyos ‐ 1.x\contrib\zigbex\ Osilloscop e – Oscilloscope.nc, OscilloscopeM.nc, &OscopeMsg.h.

HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Oscilloscope.nc –Osilloscope components UART Comm – connecting to PC DemoSensorC- Get the light data TimerC & LedsC configuration Oscilloscope { } implementation { components Main, OscilloscopeM, TimerC, LedsC, DemoSensorC as Sensor, UARTComm as Comm; Main.StdControl ‐ > OscilloscopeM; Main.StdControl ‐ > TimerC; OscilloscopeM.Timer ‐ > TimerC.Timer[unique("Timer")]; OscilloscopeM.Leds ‐ > LedsC; OscilloscopeM.ADC ‐ > Sensor; … }

HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Serial Comm. UARTComm component –UARTComm provides ReceiveMsg interface and SendMsg interface. UARTComm functions ReceiveMsg event TOS_MsgPtr receive(TOS_MsgPtr m) – received from PC with event type, and message type is TOS_Msg SendMsg send(...) – sense mode to PC, passes TOS_Msg sendDone(...) - send(...) - when done, tells by event type

HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 OscilloscopeM.nc OscilloscopeM.nc (1) includes OscopeMsg; module OscilloscopeM { provides interface StdControl; uses { … // interfaces } } implementation { … // variables command result_t StdControl.init() { … // initialization return SUCCESS; }

HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 OscilloscopeM.nc OscilloscopeM.nc (2) command result_t StdControl.start() { call SensorControl.start(); call Timer.start(TIMER_REPEAT, 125); call CommControl.start(); return SUCCESS; } command result_t StdControl.stop() { … return SUCCESS; } event result_t Timer.fired() { return call ADC.getData(); }

HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 OscilloscopeM.nc OscilloscopeM.nc (3) async event result_t ADC.dataReady (uint16_t data) { struct OscopeMsg *pack; atomic { pack = (struct OscopeMsg *) msg[currentMsg].data; pack ‐ >data[packetReadingNumber++] = data; readingNumber++; dbg(DBG_USR1, "data_event\n"); if (packetReadingNumber == BUFFER_SIZE) { post dataTask(); } if (data > 0x0300) call Leds.redOn(); else call Leds.redOff(); return SUCCESS; }

HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 OscilloscopeM.nc OscilloscopeM.nc (4) task void dataTask() { struct OscopeMsg *pack; atomic { pack = (struct OscopeMsg *)msg[currentMsg].data; packetReadingNumber = 0; pack ‐ >lastSampleNumber = readingNumber; } pack ‐ >channel = 1; pack ‐ >sourceMoteID = TOS_LOCAL_ADDRESS; if (call DataMsg.send(TOS_UART_ADDR, sizeof(struct OscopeMsg), &msg[currentMsg])) { atomic { currentMsg ^= 0x1; } call Leds.yellowToggle(); } event result_t DataMsg.sendDone (TOS_MsgPtr sent, result_t success) { return SUCCESS; }

HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Oscilloscope Lab.

HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Oscilloscope lab. 1 Starts cygwin. Move to folder as follows make zigbex cd /opt/tinyos ‐ 1.x/contrib/zigbex cd Oscilloscope

HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Oscilloscope lab. 2 ZigbeX Download –Run AVR studio at Windows –Tolol->auto connect-> browse main.hex located at –c:\Programfiles\UCB\cygwin\opt\tinyos ‐ 1.x\contrib\zigbex\Oscilloscope\ build \ zigbex

HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Oscilloscope lab. 3 Java application –When it is configured correctly, –Move to /opt/tinyos ‐ 1.x/tools/java in Cygwin –Type as follows export cd /opt/tinyos ‐ 1.x/tools/java java net.tinyos.oscope.oscilloscope

HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Oscilloscope result Result