Wireless Sensor Network for Monitoring Applications
Total Page:16
File Type:pdf, Size:1020Kb
Wireless Sensor Network for Monitoring Applications A Major Qualifying Project Report Submitted to the University of WORCESTER POLYTECHNIC INSTITUTE In partial fulfillment of the requirements for the Degree of Bachelor of Science By: __________________________ __________________________ Jonathan Isaac Chanin Andrew R. Halloran __________________________ __________________________ Advisor, Professor Emmanuel Agu, CS Advisor, Professor Wenjing Lou, ECE Table of Contents Table of Figures ............................................................................................................................................. 4 Abstract ......................................................................................................................................................... 5 1. Introduction ........................................................................................................................................... 6 1.1 What are Wireless Sensor Networks? ........................................................................................... 6 1.2 Why Sensor Networks? ................................................................................................................. 6 1.3 Application Examples .................................................................................................................... 7 1.4 Project Goal ................................................................................................................................... 8 2. Background ............................................................................................................................................ 9 2.1 Tmote Sky wireless sensor platform ............................................................................................. 9 2.1.1 TinyOS .................................................................................................................................. 10 2.1.2 Chipcon CC2420 Transceiver ............................................................................................... 10 2.2 Mesh Networking with TinyOS and IEEE 802.15.4 ...................................................................... 11 2.2.1 Low-Power Networking Background and Standards ........................................................... 11 2.2.2 Networking Protocol Stack .................................................................................................. 12 2.2.3 Mesh Networking with TinyOS ............................................................................................ 12 3. Requirements ...................................................................................................................................... 15 3.1 Choosing an Application .............................................................................................................. 15 3.2 Sensors ........................................................................................................................................ 15 3.2.1 Microphone ......................................................................................................................... 16 3.2.2 Motion Sensor ..................................................................................................................... 16 3.2.3 Accelerometer ..................................................................................................................... 16 3.3 Network Architecture .................................................................................................................. 17 3.3.1 System Overview ................................................................................................................. 17 3.3.2 Base Station ......................................................................................................................... 18 3.3.3 Data Storage ........................................................................................................................ 18 3.3.4 User Interface ...................................................................................................................... 18 3.4 Overall Requirements .................................................................................................................. 18 4. Design .................................................................................................................................................. 20 4.1 Sensor Design .............................................................................................................................. 20 4.1.1 Tmote Expansion Port ......................................................................................................... 20 4.1.2 Motion Detector .................................................................................................................. 21 4.1.3 Accelerometer ..................................................................................................................... 21 4.2 Sensor Node Software Design ..................................................................................................... 22 4.2.1 A/D Resolution .................................................................................................................... 22 4.2.2 Accelerometer Algorithm .................................................................................................... 23 4.2.3 Node Program Design.......................................................................................................... 24 4.3 Infrastructure Programming ....................................................................................................... 26 4.3.1 Base Station Software ......................................................................................................... 26 4.3.2 SQL Database ....................................................................................................................... 27 2 4.3.3 User Interface ...................................................................................................................... 28 5. Further Research ................................................................................................................................. 30 5.1 Sensor Localization ...................................................................................................................... 30 5.1.1 RF Localization Pilot Studies ................................................................................................ 30 5.1.2 Ultrasonic Localization ........................................................................................................ 31 6. Recommendations and Conclusion ..................................................................................................... 33 6.1 TMote Sky Platform and Alternatives ......................................................................................... 33 6.1.1 Sun Microsystems – Project Sun SPOT ................................................................................ 34 6.1.2 Sentilla – Formerly Moteiv .................................................................................................. 34 6.1.3 Implementing a ZigBee Network ......................................................................................... 35 6.2 Additional Technologies .............................................................................................................. 36 6.2.1 Alternative Energy Sources ................................................................................................. 36 6.2.2 Node Localization ................................................................................................................ 36 7. References ........................................................................................................................................... 37 8. Appendix A – User Guide..................................................................................................................... 39 9. Appendix B – Mote Code ..................................................................................................................... 41 9.1 Base Station (Sink Node) Mote Code .......................................................................................... 42 9.1.1 baseC.nc .............................................................................................................................. 42 9.1.2 baseM.nc ............................................................................................................................. 42 9.2 Accelerometer Mote Code .......................................................................................................... 44 9.2.1 accelC.nc .............................................................................................................................. 44 9.2.2 accelM.nc ............................................................................................................................ 45 9.3 Motion Sensor Mote Code .......................................................................................................... 50 9.3.1 motionC.nc .......................................................................................................................... 50 9.3.2 motionM.nc ......................................................................................................................... 50 9.4 Shared Mote Code ......................................................................................................................