+ All Categories
Home > Documents > Environmental Sensor Network The New Jersey Governor’s School … · 2020. 2. 18. · The New...

Environmental Sensor Network The New Jersey Governor’s School … · 2020. 2. 18. · The New...

Date post: 22-Aug-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
9
Environmental Sensor Network The New Jersey Governor’s School of Engineering and Technology 2014 Arthur Belkin Wayne Hills High School Shweta Dutta South Brunswick High School Yunhee Kang Ridge High School Hope McGovern Haddonfield Memorial High School Matthew Scalamandre Moorestown Friends School Abstract In order to demonstrate how technology can be used to facilitate human interaction with the en- vironment, the research team designed and built a proof-of-concept mesh network to collect data about the home environment and display it to a base station. Simplifying human to environment interaction makes life easier in a world where many people, devices, and tasks require a person’s attention. The network connects two sensors that report data to Arduino platforms. These platforms communicate with XBee radios, which in turn talk to a base laptop that displays the data to the user of the network. A mesh network that reports condi- tions within a house is a viable way of monitoring and regulating an area; this eases human to envi- ronment interactions. Subsequent work might im- plement technology for the mesh network to auto- matically respond to changes in the environment, as opposed to only reporting them back to the user. 1. Introduction Modern technology is intrinsically interactive. While it does connect humans to virtual reality and to each other, it can also be used to connect humans to their environment; such interactions can be both monitored and regulated. Sensor network technol- ogy has been previously used to communicate data from remote locations quickly and eectively. For example, a satellite-based remote sensor network allows researchers at the University of Hawaii to analyze the eruptions of volcanoes on remote is- lands othe coast of Antarctica within mere hours of the explosion 1 . Figure 1. A Nest Temperature Thermostat 2 Sensors can also be utilized in more quotidian sit- uations; Nest home thermostats include tempera- ture, humidity, light, and activity sensors in the unit in order to construct a personalized heating and cooling schedule. The Nest system automat- ically adjusts the temperature of a home accord- ing to activity, season, ambient temperature, and recorded preferences. It also communicates data about a user’s energy utilization and can be con- trolled via a smartphone application 3 . These systems provided the initial inspiration for the project; however, the group was determined
Transcript
Page 1: Environmental Sensor Network The New Jersey Governor’s School … · 2020. 2. 18. · The New Jersey Governor’s School of Engineering and Technology 2014 Arthur Belkin Wayne Hills

Environmental Sensor NetworkThe New Jersey Governor’s School of Engineering and Technology

2014

Arthur BelkinWayne Hills High School

Shweta DuttaSouth Brunswick High School

Yunhee KangRidge High School

Hope McGovernHaddonfield Memorial High School

Matthew ScalamandreMoorestown Friends School

Abstract

In order to demonstrate how technology can beused to facilitate human interaction with the en-vironment, the research team designed and builta proof-of-concept mesh network to collect dataabout the home environment and display it to abase station. Simplifying human to environmentinteraction makes life easier in a world wheremany people, devices, and tasks require a person’sattention. The network connects two sensors thatreport data to Arduino platforms. These platformscommunicate with XBee radios, which in turn talkto a base laptop that displays the data to the user ofthe network. A mesh network that reports condi-tions within a house is a viable way of monitoringand regulating an area; this eases human to envi-ronment interactions. Subsequent work might im-plement technology for the mesh network to auto-matically respond to changes in the environment,as opposed to only reporting them back to the user.

1. Introduction

Modern technology is intrinsically interactive.While it does connect humans to virtual reality andto each other, it can also be used to connect humansto their environment; such interactions can be bothmonitored and regulated. Sensor network technol-ogy has been previously used to communicate datafrom remote locations quickly and effectively. Forexample, a satellite-based remote sensor networkallows researchers at the University of Hawaii to

analyze the eruptions of volcanoes on remote is-lands off the coast of Antarctica within mere hoursof the explosion1.

Figure 1. A Nest Temperature Thermostat2

Sensors can also be utilized in more quotidian sit-uations; Nest home thermostats include tempera-ture, humidity, light, and activity sensors in theunit in order to construct a personalized heatingand cooling schedule. The Nest system automat-ically adjusts the temperature of a home accord-ing to activity, season, ambient temperature, andrecorded preferences. It also communicates dataabout a user’s energy utilization and can be con-trolled via a smartphone application3.These systems provided the initial inspiration forthe project; however, the group was determined

Page 2: Environmental Sensor Network The New Jersey Governor’s School … · 2020. 2. 18. · The New Jersey Governor’s School of Engineering and Technology 2014 Arthur Belkin Wayne Hills

2 THE GOVERNOR’S SCHOOL OF ENGINEERING AND TECHNOLOGY 2014

to create a simpler and cheaper in-home monitor-ing system it dubbed a “Smart-Home”. A “Smart-Home” is a house that has multiple sensors set upto detect the condition of appliances and objectsthroughout the building and report them to a cen-tral computer. As a proof-of-concept of how tech-nology can be used to organize environmental dataand facilitate regulation, the group created a wire-less sensor network to perform and regulate vari-ous household tasks. Sensors were used to mon-itor the progress of a washing machine cycle andthe ambient light level.

2. Background

2.1 Open-Source Movement

Programmers and hardware developers alike takepart in the ever-changing open-source movement.The concept of open-source refers to the freedomto distribute code and hardware for reuse and mod-ification. The operating system GNU, which re-cursively stands for “GNU’s Not UNIX,” is one ofthe more well-known products of this movement,with UNIX referring to the more restrictive operat-ing system controlled by AT&T and the Universityof California, Berkeley4. Today, platforms suchas Arduino allow for easy integration of hardwareand software into anything from personal projectsto full-scale replicable and marketable products.Open-source allows amateur coders and builders,start-up companies, or any person with an ideato contribute to the world of technology, puttingsome power into the hands of consumers who oth-erwise must rely on the giant technology compa-nies of today. Essential to the project, the open-source movement allows for effective developmentof proof-of-concept designs.

2.2 Arduino

Arduino is an open-source computing platformbased on a simple microcontroller and an In-tegrated Development Environment (IDE). Thephysical board, known as the microcontroller, hasmultiple pins and outputs which can be used tobuild circuits. Unlike other programmable circuitboards, Arduino requires only a USB cable to load

new code onto the microcontroller. Additionally,the simplicity of Arduino’s IDE - which has a lan-guage based on C++ - makes the programmingeasy to learn and manipulate5. Other advantagesof Arduino include its relatively cost-effective plat-form (with the more expensive modules valued at$50), cross-platform capabilities as it can run onWindows, Macintosh OSX, and Linux operatingsystems, and the open-source nature of its softwareand hardware6.

2.3 Sensors

Sensors are devices that allow humans or comput-ers to detect changes in their environment. Mostsensors are designed to respond to one particulartype of stimulus, such as temperature or light, andoutput data that corresponds to the intensity of theevent. The sensors used by Arduino output dataas either a digital or analog signal. The two sen-sors used for this project were a light sensor anda piezoelectric sensor. The light sensor combinesa silicon diode that converts incipient light into anelectric current with a device which converts thiscurrent into a square wave with frequency directlyproportional to the current, and therefore propor-tional to the light intensity. This signal can beread by the Arduino as a digital input7. Piezoelec-tric sensors detect vibrations, shocks, and impacts.Such an impact causes the sensor to deform, whichin turn produces a voltage. The voltage level cor-responds to the degree of deformation the sensorexperiences; this level can be read by the Arduinoboard8. Thus, sensor networks allow technologyto collect, analyze, and respond to environmentaldata otherwise inaccessible to humans.

2.4 XBee and Mesh Network

XBee radios, manufactured by Digi International,Inc., are small chips that wirelessly transmit infor-mation and allow multiple Arduinos. to communi-cate with each other. The protocol, or digital rulesfor data exchange between the radios, is ZigBee,which is typically used by small, low power ra-dios to transmit small amounts of data over a shortrange9. Multiple XBee radios can be connected

Page 3: Environmental Sensor Network The New Jersey Governor’s School … · 2020. 2. 18. · The New Jersey Governor’s School of Engineering and Technology 2014 Arthur Belkin Wayne Hills

ENVIRONMENTAL SENSOR NETWORK 3

to form a mesh network, providing a more exten-sive range with each XBee acting as a node. Muchlike the networking system used by cellular de-vices, XBees act as radio towers to relay wirelessinformation. For multiple radios to be able to sendand receive information, they must be set to Ap-plication Programming Interface (API) mode10, asopposed to Attention (AT) mode, which only letstwo radios communicate11. API mode sends andreceives data in frames, a technical term for radiomessages. Radios can be configured into two con-nection arrangements: full mesh and partial meshtopologies. In the former case, all radios are inter-connected; in the latter, some nodes in the networkhave restricted communicating ability with respectto the other nodes12. A full mesh network was cho-sen to connect all of the XBee radios.

3. Methods

3.1 Sensor Selection

The research group decided to create a network ofmultiple sensors to monitor in-home activities asa proof-of-concept of how technology can collectand react to ambient data. A piezoelectric sensorconverts motion into electrical voltage, which canbe monitored in the home environment to deter-mine whether a washing machine is running. Alight sensor can be used to determine the level oflight in an environment. Substantial documenta-tion exists for both of the sensors, and they are bothextremely cost-effective.

3.2 Arduino Platform

Extensive information on the Arduino microcon-troller and its corresponding programming lan-guage is readily available online from the creatorsof the Arduino board as well as from amateur de-velopers. Therefore, it was not necessary to fab-ricate a wholly new design for an Arduino-basedmesh network. The open-source nature of theboard encourages developers and coders to sharetheir projects on the internet. In addition to of-ficial documentation for using the selected sen-sors on the Arduino platform, many examples ofsensor-interfacing Arduino projects were available

Figure 2. Piezoelectric Sensor: SEN-1029313

Figure 3. Light to Frequency Conversion Sensor: ModelTSL235R14

to the research team to use and modify. It was alsonecessary for the researchers to familiarize them-selves with the Arduino programming language it-self, which is based on C++. This project uses twoArduino Uno boards and one Arduino Mega board.

3.3 Circuit Development and Testing

The light sensor returns the intensity of the lightit senses with the units µW/cm2, while the piezo-electric sensor returns a number from 0 to 1023,with 0 being the lowest and 1023 being the highest.Safety factors, particularly resistors, were incorpo-

Page 4: Environmental Sensor Network The New Jersey Governor’s School … · 2020. 2. 18. · The New Jersey Governor’s School of Engineering and Technology 2014 Arthur Belkin Wayne Hills

4 THE GOVERNOR’S SCHOOL OF ENGINEERING AND TECHNOLOGY 2014

Figure 4. Arduino Uno: Model R315

Figure 5. Arduino Mega: Model 2560 R216

rated into each design to shield the Arduino fromvoltage spikes; the piezoelectic sensor generates apotential difference when it senses a vibration thatdeforms it. Each circuit was then prototyped on abreadboard.The sensors were thoroughly tested before beingincorporated into the final network. To confirmthat each sensor worked properly, they were as-sessed in different conditions. It was determinedthat the piezoelectric sensor required a very se-cure attachment to a vibrating object in order toaccurately measure the oscillation level. The lightsensor was tested under varying intensities to de-termine its sensitivity. Perfecting data passingfrom one sensor to a separate laptop required trou-bleshooting and incremental development; for ex-ample, instead of creating the full mesh networkand testing it, the research team started by passingsensor information from one Arduino to anotherand then to a computer, fixing hardware and soft-ware challenges as they arose.

3.4 XBee Radios and Creation of Mesh Network

XBee radios constitute the nodes of the mesh net-work. A diagram of the mesh network is seen inFigure 6. Using X CTU software, the four XBeeradios were configured with one as the coordina-tor and the others as routers. This setup allowsfor simplified packaging of sensor messages by theArduinos, as the destination address is easily set tothe coordinator XBee radio that is connected to thebase station for data display. Each Arduino plat-form must package the messages, often referredto as a frame for the XBee radios to both trans-mit and read the information. The frame containsfields the XBee radios will recognize, with a mes-sage containing a start byte, which alerts the ra-dio that a valid message transmission is beginning.Next in the frame are frame details, which spec-ify attributes such as the length of the messageand the type of message being sent. A frame IDasks for a specific return sequence confirming thata message was sent successfully, left empty forthis project as the network created is too small torequire this check. This is followed by two ad-dresses, one 64-bit and another 16-bit. The 64-bitaddress is unique to all devices in the world andis called a destination address, whereas the 16-bitdestination network address references the coor-dinator XBee radio, unique to the mesh networkcreated. A broadcast radius was set, declaring themaximum number of nodes for the frame to passthrough before reaching its destination. Setting theradius to 0 allows the data to reach the receiver inhowever many nodes are necessary, and this is theradius used in the mesh network. Transmissionoptions can also be set allowing for data encryp-tion, unnecessary for a low-security smart-homenetwork. Finally, the actual sensor data formattedby the Arduino was added to the frame, followedby a checksum byte which ensures the entire datapacket was received.

filler filler filler filler filler filler filler filler fillerfiller filler filler filler filler filler filler filler fillerfiller filler filler filler filler filler filler filler fillerfiller filler filler filler filler filler filler filler fillerfiller filler filler filler filler filler filler

Page 5: Environmental Sensor Network The New Jersey Governor’s School … · 2020. 2. 18. · The New Jersey Governor’s School of Engineering and Technology 2014 Arthur Belkin Wayne Hills

ENVIRONMENTAL SENSOR NETWORK 5

Figure 6. Concept of Operations: Mesh Network

Page 6: Environmental Sensor Network The New Jersey Governor’s School … · 2020. 2. 18. · The New Jersey Governor’s School of Engineering and Technology 2014 Arthur Belkin Wayne Hills

6 THE GOVERNOR’S SCHOOL OF ENGINEERING AND TECHNOLOGY 2014

Figure 7. XBee Radio: Model XBEE217

3.5 Formatting Sensor Data for User

Data is sent from Arduino nodes to a host com-puter via XBee radios. However, this data must beformatted accordingly in order to be understood bya human user. For this task, a program was createdusing the Python programming language to capturedata from the Serial monitor, format it, and displayit in an organized fashion. PySerial is a Pythonapplication programming interface module used tocreate an application to store and display data. TheArduino platform that is connected to the piezo-electric sensor transmits one byte of sensor infor-mation: a 0 indicating no vibration, or a 1 indi-cating vibration. These values are only sent if thestate changed from the last sensor reading, other-wise no data is sent. If a 0 is sent to the coordinatorXBee, then PySerial will display a message tellingthe user that the washing machine/dryer cycle isdone. The Arduino connected to the light sensorsends the intensity of the light in µW/cm2, whichis converted by PySerial to a low to high intensityscale from 1 to 10 and displayed in a manner easilyunderstood by the user18.

4. Results and Discussion

The research team built a mesh network that suc-cessfully communicates environmental data to ahost computer. Sensor data is relayed from one

Arduino board to another by way of XBee radiosignals, which pack information into data frames.Messages are sent to the one XBee attached toa host laptop and are displayed on the base sta-tion monitor through a Python program. Arduinocode for the two sensor nodes is included in theAppendix B. The objective of the project was todemonstrate the usefulness of a mesh network infacilitating human interaction with the environ-ment. However, the result was limited by factorsincluding the reliability and range of the availablesensors and the practicality of a mesh network onthe scale to which it was built. The design wouldhave to be modified to be implemented on a largerscale.Significant difficulty was experienced in applyinga conceptual understanding of the mesh network tothe challenge of physically creating working codeto send messages between nodes on the network.The majority of difficulties the team encounteredwas in writing the programs to run the project. Twodistinct codes were needed to power the network:one to send and receive sensor data and one todisplay the data on the host laptop. Reading thepiezoelectric sensor was straightforward as it out-puts an analog voltage signal that the Arduino canread easily. However, it was difficult to acquire us-able data from the washing machine, as the valuesreturned were too low. The piezoelectric sensorwas tested in various configurations, but it was un-able to detect any meaningful events until a weightwas placed on the sensor. The weight vibratedin concert with the washing machine, intensifyingthe stimulus. The program used by the Arduinois also designed to increase accuracy by averag-ing the readings over a period of one second. Thelight sensor presented a different set of problems.It was easy to set up physically; however, readingthe light sensor proved more difficult as the sensoroutput a square wave that cannot be natively inter-preted by an Arduino. The problem was resolvedby finding sample code online that treated eachpeak of the square wave as a digital input and in-troduced an interrupt that kept count of the numberof inputs that occurred each second19. This allowsthe Arduino to calculate the intensity of incipient

Page 7: Environmental Sensor Network The New Jersey Governor’s School … · 2020. 2. 18. · The New Jersey Governor’s School of Engineering and Technology 2014 Arthur Belkin Wayne Hills

ENVIRONMENTAL SENSOR NETWORK 7

light with acceptable accuracy. At higher inten-sities, the interrupts occur with enough frequencyto overload the Arduino’s processor, causing it toreturn incorrect values; however, this problem isnot relevant at the intensities of light for which theproof-of-concept network is intended to be used.The team also encountered difficulties in program-ming the message passing system. Our main chal-lenge was formatting the data into a message thatthe XBee radios would understand. The group de-cided that the problem of differentiating betweentwo sensors would most easily be solved by havingthe message be of different lengths for each sensor.For the piezoelectric sensor, we simplified the re-sponse into one byte, whereas for the light sensorwe stored the value into two bytes. The light sen-sor returns a value that is often greater than 255,and therefore must be stored in two separate bytes.However, in dark environments, the sensor returnsa value less than 255. If the XBee attempted tosend this data, the base station would misinterpretthe message as coming from a piezoelectric sensor.To resolve this problem, the code was modified toforce the Arduino to parse the data into two vari-ables before sending it. This approach forces theradio to send two values in the message, which pre-serves the base station’s ability to discern betweenthe two sensors.Setting up the XBee radios required the use of XCTU software, which allows for easy installationof firmware. One XBee was made a coordinator,while the others were made into routers. Origi-nally, the data was hard-coded as a long series ofwrite method statements that wrote information tothe Serial port one byte at a time, problematic asthe frame was being sent in parts and received inparts as viewed through X CTU. While testing thenetwork, the X CTU software was sending mes-sage requests and receiving partial data, but thisissue was fixed in formatting the package of dataas a receive request in a byte array. Using a forloop, we filled an array of bytes one byte at a timewith the correct frame format as discussed in sec-tion 3.5. In this loop, the checksum byte is filledwith a 0, as it has to be calculated before being putin the byte. A second loop calculates the check-

sum, summing the values from the fourth byte tothe last non-checksum byte, dividing by 256, andthen taking the remainder when dividing by 256yet again. This byte is inserted as the last byteof the data, and then the package is transmittedusing the write method that accepts a byte arrayand its size as arguments. Through trial and error,the team recognized the need to send the bytes inhex instead of decimal, as the hex number systemis what the X CTU software reads the messagesin. Finally, PySerial was implemented to read thevalues sent in hex and translate them into consolemessages.

5. Conclusion

Based on the research completed, a mesh networkhas the ability to simplify human interaction withthe environment. This type of network allows tech-nology to act as an interface between the real worldand humans, reading and interpreting raw data andformatting it so that it is easy to understand andrespond to. The team’s network consisted of twosensors and a base station, and the setup can eas-ily be expanded to include more sensors and re-port other environmental information to the user.The group’s network successfully communicateddata about the home environment, specifically dataabout the light level in a room and about the func-tioning of a washing machine. Possible additionsand improvements that could be made to the cre-ated mesh network include adding multiple sensorsto one Arduino platform, adding more nodes to thenetwork to collect data from other locations, de-veloping a Graphical User Interface (GUI) to dis-play formatted sensor data and integrating it into asmartphone application, and creating actuators thatallow the network to not only transmit data, butalso react to the conditions sensed by taking physi-cal action, e.g. opening and closing window blindsin response to light levels. Further research mightlook into making mesh networks secure, in orderto avoid others from reading data transmitted, orpossibly broadcasting malicious signals that com-promise the performance of the network.As the open source movement continues to expandand include programmers and hardware-builders

Page 8: Environmental Sensor Network The New Jersey Governor’s School … · 2020. 2. 18. · The New Jersey Governor’s School of Engineering and Technology 2014 Arthur Belkin Wayne Hills

8 THE GOVERNOR’S SCHOOL OF ENGINEERING AND TECHNOLOGY 2014

alike, the future application of mesh networks alsogrows. Mesh networks can also be used in outdoorsettings where people might have trouble checkingcertain conditions manually due to physical limita-tions. A sensor placed in such areas could providea live feed of such conditions, connected in a fullmesh creating a local network that does not requirethe internet to send and receive data. Such a net-work would require sensors that are weather resis-tant and robust code that ensures network security,both easily developed and obtained from the opensource movement. Mesh networks, when com-bined with the advantages of open source, have thepotential to facilitate human to environment inter-actions.

6. Acknowledgements

We would like to acknowledge our project mentorsJosef Grossmann, Joe Mirizio, Ryan Flynn, andEdward Kahn from Lockheed Martin who havegenerously provided their time along with the nec-essary resources and information to successfullycomplete our proof-of-concept mesh network. Theteam would also like to acknowledge the New Jer-sey Governor’s School of Engineering and Tech-nology’s Program Director Dr. Ilene Rosen, alongwith the Assistant Program Director Jean PatrickAntoine and the entire GSET staff for present-ing such an incredible opportunity to the team,key to the coordination and organization of sucha comprehensive and exciting summer program.We also extend thanks to our Residential Teach-ing Assistant Maya Saltzman for overseeing theproject, making sure we had the required tools andworkspace. A final thank you goes to all of thesponsors of the New Jersey Governor’s School ofEngineering and Technology, specifically RutgersUniversity, The State of New Jersey, Morgan Stan-ley, Lockheed Martin, Silverline Windows, JerseySouth Industries, Inc., The Provident Bank Foun-dation, and Novo Nordisk.

7. References[1] Schmidt, Laurie J. "Sensing Remote Volca-noes." NASA Earth Observatory. National Aero-nautics Space Administration, 13 July 2004. Web.

11 July 2014.[2] Nest Temperature Thermostat. Digital image.Amazon. N.p., n.d. Web. 11 July 2014.[3] "Home." Nest. Nest Labs, n.d. Web. 13 July2014.[4] Henderson, Harry. "Open-Source Movement."Science Online. Facts On File News Services, n.d.Web. 10 July 2014.[5] "Arduino Introduction." Arduino - Introduction.Arduino, n.d. Web. 13 July 2014.[6] "What Is an Arduino?" SparkFun. SparkFunElectronics, 26 Feb. 2013. Web. 8 July 2014.[7] Light-To-Frequency Converter Datasheet. N.p.:Texas Advanced Optoelectronic Solutions, Sept.2007. PDF.[8] Piezoelectric Sound Components. N.p.: MurataManufacturing Co., Ltd., n.d. PDF.[9] "XBee Buying Guide." SparkFun. SparkFunElectronics, n.d. Web. 19 July 2014.[10] "What Is API (Application Programming Inter-face) Mode and How Does It Work?" Digi. DigiInternational Inc., n.d. Web. 19 July 2014.[11] "The AT Command Set." Digi. Digi Interna-tional Inc., n.d. Web. 19 July 2014.[12] Brinton, Stephen. Mesh Networks. N.p.: Gor-don College, 2009. PPT.[13] Piezoelectric Sensor. Digital image. SparkFun.SparkFun Electronics, n.d. Web. 15 July 2014.[14] Light to Frequency Conversion Sensor. Digi-tal image. SparkFun. SparkFun Electronics, n.d.Web. 15 July 2014.[15] Arduino Uno. Digital image. Tested. N.p., n.d.Web. 15 July 2014.[16] Arduino Mega. Digital image. Electroschemat-ics. N.p., n.d. Web. 15 July 2014.[17] XBee S2. Digital image. Entesla. N.p., n.d.Web. 15 July 2014.[18] Liechti, Chris. "Welcome to PySerial’s Doc-umentation." PySerial. N.p., n.d. Web. 19 July2014.[19] Tillaart, Rob. "Arduino Playground - Sen-sor TSL235R." Arduino Playground. Arduino, 30Nov. 2013. Web. 10 July 2014.

Appendix A

A1. Arduino Code for Light Sensor

Page 9: Environmental Sensor Network The New Jersey Governor’s School … · 2020. 2. 18. · The New Jersey Governor’s School of Engineering and Technology 2014 Arthur Belkin Wayne Hills

ENVIRONMENTAL SENSOR NETWORK 9

filler filler filler filler filler filler filler filler filler

no A2. Arduino Code for Piezoelectric Sensor

filler filler filler filler filler filler filler filler fillerfiller filler filler filler filler filler filler filler fillerfiller filler filler filler filler filler filler filler fillerfiller filler filler filler filler filler filler filler fillerfiller filler filler filler filler filler filler filler filler


Recommended