1 / 33

Tutorial How to use sensors

Tutorial How to use sensors. Reporter : Jensen Vinson. Create a sensor network—sensing light. 1. Install TinyOS into Windows/Linux 2. Write the program called Oscilloscope 3. Install ‘BaseStation’ into N_0 and ‘Oscilloscope’ into N_1 and N_2

Download Presentation

Tutorial How to use sensors

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. TutorialHow to use sensors Reporter:Jensen Vinson

  2. Create a sensor network—sensing light 1. Install TinyOS into Windows/Linux 2. Write the program called Oscilloscope 3. Install ‘BaseStation’ into N_0 and ‘Oscilloscope’ into N_1 and N_2 4. N_1, N_2 sense data and N_0 collects data from N_1, N_2 and then transmits to PC N_2 N_1 data data data N_0

  3. Key words ● Component: • Two types of components:module and configuration • Define two scopes: ”the interfaces it contains” and “implementation” • A component provides and uses interfaces • if a component uses an interface, it can call the interface's commands and must implement handlers for its events ● configuration & module: • configurations are implemented in terms of other components, which they wire, while modules are executable code

  4. Key words ● Interface:bidirectional • Include commands and events • Provided interface: represent the functionality that the component provides to its user in its specification • Used interface: represent the functionality that the component needs to perform its job in its implementation

  5. ● Oscilloscope step1. Enable “Makefile”→ step2. Enable “OscilloscopeAppC” step3. Enable “OscilloscopeC”

  6. Oscilloscope.h

  7. OscilloscopeC.nc // red light // yellow light // green light

  8. Step4:Sensing data channel Link:DemoSensorC→VoltageC→Msp430InternalVoltageC→Msp430InternalVoltageP C:\cygwin\opt\tinyos-2.x\tos\chips\msp430\sensors

  9. 3. Install into Sensors step1. Install BaseStation (N_0) # cd /opt/tinyos-2.x/apps/BaseStation # make telosb install,<logic_ID> bsl,<COM port-1>

  10. step2. Install Oscilloscope (N_1) # cd /opt/tinyos-2.x/apps/Oscilloscope # make telosb install,<logic_ID> bsl,<COM port-1>

  11. step3. Enable forwarder on BaseStation # java net.tinyos.sf.SerialForwarder –comm serial@<COM port>:telosb&

  12. step4. Sensing data with GUI on BaseStation # cd /opt/tinyos-2.x/apps/Oscilloscope/java # make # ./run

  13. Example--Accelerometer Step1:Base on Oscilloscope in tinyos2.x Step2:Enable X,Y,Z axes • Create TarokoAccel0C.nc、TarokoAccel0P.nc for X axis • Create TarokoAccel1C.nc、TarokoAccel1P.nc for Y axis • Create TarokoAccel2C.nc、TarokoAccel2P.nc for Z axis Like “Msp430InternalVoltageP” Like “Msp430InternalVoltageC”

  14. compare Step3: Modify the critical codes

  15. compare OscilloscopeC.nc

  16. OscilloscopeC.nc

  17. Step4:Install BaseStation # cd /opt/tinyos-2.x/apps/BaseStation # make telosb install, <logic_ID> bsl,<COM port-1> Step5: Enable forwarder on BaseStation # java net.tinyos.sf.SerialForwarder –comm serial@<COM port>:telosb& Step6:Install Oscilloscope • # cd /opt/tinyos-2.x/apps/Oscilloscope • # make telosb install,<logic_ID> bsl,<COM port-1>

  18. Step7: Sensing data with GUI • # cd /opt/tinyos-2.x/apps/Oscilloscope/java • # make • # ./run

  19. Step8: Physical meaning of sensor reading ● The output depends on value g (-1~1) • when g=-1, the output is around 1,650 • when g=0, the output is around 2,048 • when g=1, the output is around 2,500 ● There are 6 main orientations (more details as following pages)

  20. Physical meaning of sensor reading(cont.) (1) X-out(red)=1g Y-out(white)=0g Z-out(green)=0g

  21. Physical meaning of sensor reading(cont.) (2) X-out(red)=0g Y-out(white)=1g Z-out(green)=0g

  22. Physical meaning of sensor reading(cont.) (3) X-out(red)=-1g Y-out(white)=0g Z-out(green)=0g

  23. Physical meaning of sensor reading(cont.) (4) X-out(red)=0g Y-out(white)=-1g Z-out(green)=0g

  24. Physical meaning of sensor reading(cont.) (5) X-out(red)=0g Y-out(white)=0g Z-out(green)=1g

  25. Physical meaning of sensor reading(cont.) (6) X-out(red)=0g Y-out(white)=0g Z-out(green)=-1g

  26. Q & A

More Related