Florida State University Libraries

Electronic Theses, Treatises and Dissertations The Graduate School

2018 Design and Implementing Multipurpose Sensor Network for Smart City Monitoring Donglin Cai

Follow this and additional works at the DigiNole: FSU's Digital Repository. For more information, please contact [email protected] FLORIDA STATE UNIVERSITY

COLLEGE OF ENGINEERING

DESIGN AND IMPLEMENTING MULTIPURPOSE SENSOR NETWORK FOR SMART CITY

MONITORING

By

DONGLIN CAI

A Thesis submitted to the Department of Electrical and Computer Engineering in partial fulfillment of the requirements for the degree of Master of Science

2018

Copyright c 2018 Donglin Cai. All Rights Reserved. Donglin Cai defended this thesis on July 19, 2018. The members of the supervisory committee were:

Reza Arghandeh Professor Directing Thesis

Sastry Pamidi Committee Member

Simon Y. Foo Committee Member

The Graduate School has verified and approved the above-named committee members, and certifies that the thesis has been approved in accordance with university requirements.

ii ACKNOWLEDGMENTS

I would like to acknowledge the thank those people who supported and helped me not only in my thesis but through out the whole life during the research time. I will express my gratitude to my superadvisor, Dr. Reza Arghandeh, who always guide me and helped me all along the way of my reserch and even daily life. I can’t image how can I finish this without his help. I also want to say thank you to my whole group worked on UrbanBox project, it’s wonderful to have such great teammates who really helped me a lot. I would like to thank Dr. Simon Y. Foo and Dr. Petru Andrei to be my committee member. I thank my parents for alway supporting my education.

iii TABLE OF CONTENTS

List of Tables ...... vi List of Figures ...... vii Abstract ...... ix

1 Introduction 1 1.1 Introduction ...... 1 1.1.1 What is a Wireless Sensor Network ...... 2 1.1.2 How Do Sensor Networks Work ...... 2 1.1.3 What is Smart City ...... 3 1.1.4 Why Do We Need Smart Cities ...... 4 1.1.5 What Is the Challenge and Concerns of Smart Cities ...... 5 1.2 Objective ...... 6 1.3 Motivation ...... 6

2 State of the Art 9 2.1 State of the Art ...... 9 2.1.1 Array of Things ...... 9 2.1.2 Smart Citizen ...... 12 2.1.3 Citizen Sense ...... 13

3 UrbanBox Hardware Design 15 3.1 UrbanBox Design Idea ...... 15 3.1.1 Microcontroller Comparision ...... 15 3.2 Hardware List and Functions ...... 18 3.2.1 Light Sensor - Photo-resistor ...... 18 3.2.2 Gas Detection Sensor - Grove- Multichannel Gas Sensor RB-See-488 . . . . . 18 3.2.3 Dust Sensor - Grove- Sharp Dust Sensor ...... 18 3.2.4 Temperature and Humidity Sensor - DHT22 ...... 19 3.2.5 Sound Sensor - High Sensitivity Sound Microphone Sensor Detection Module 20 3.2.6 Camera - TTL Serial Camera ...... 21 3.2.7 Micro-SD Breakout Board ...... 21 3.2.8 Fona 808 Shield ...... 21 3.2.9 GPS Antenna - Passive GPS Antenna uFL ...... 22 3.2.10 Lithium Ion Polymer Battery ...... 23 3.2.11 Mini Fan ...... 24 3.2.12 Others ...... 24 3.3 Whole System Design and Connection ...... 24 3.3.1 System Demo ...... 26

iv 4 Networking and Communication 29 4.1 Introduction ...... 29 4.2 Networking ...... 29 4.2.1 4G Technology ...... 29 4.2.2 WiFi Technology ...... 30 4.2.3 Ethernet Technology ...... 30 4.3 WSN Network Topologies ...... 31 4.3.1 Components of a WSN Node ...... 31 4.4 UrbanBox Network ...... 32 4.4.1 MQTT Protocol ...... 33 4.4.2 UrbanBox Platform ...... 34 4.4.3 Data Size ...... 35 4.5 UrbanBox Software ...... 37 4.5.1 IDE ...... 37

5 Future Work 40 5.1 Future Work ...... 40 5.1.1 Sensors and Shields ...... 40 5.1.2 Mesh Network ...... 41 5.1.3 Soldering and PCB Design ...... 41 5.1.4 Backup Power Supply ...... 41 5.1.5 Software and Platform ...... 42 5.1.6 Application ...... 42 5.1.7 Data Analytics ...... 42

Appendix A Coding Part 43 A.1 Arduino Code ...... 43 A.2 Arduino-Fonahelper ...... 50

Bibliography ...... 52 Biographical Sketch ...... 55

v LIST OF TABLES

2.1 Sensor List for Array of Things ...... 11

2.2 Sensor List for Smart Citizen ...... 13

3.1 DHT22 Accuracy ...... 20

3.2 Sensor Pins Connection ...... 25

4.1 Control Packages in MQTT Protocol[27][18][33] ...... 34

vi LIST OF FIGURES

3.1 Arduino Uno Board ...... 16

3.2 3 ...... 17

3.3 Light Sensor ...... 18

3.4 Gas Sensor ...... 19

3.5 Dust Sensor ...... 19

3.6 DHT22 Sensor ...... 20

3.7 Sound Sensor ...... 20

3.8 TTL Serial Camera ...... 21

3.9 Micro-SD Breakout Board ...... 22

3.10 Fona 808 Shield with Antenna ...... 22

3.11 GPS Antenna ...... 23

3.12 Lithium Ion Polymer Battery ...... 23

3.13 Mini Fan ...... 24

3.14 Hardware Wires Connection ...... 25

3.15 Hardware Diagram ...... 26

3.16 UrbanBox Demo 1 ...... 27

3.17 UrbanBox Demo 2 ...... 28

4.1 Three Network Topologies ...... 31

4.2 UrbanBox Network ...... 32

4.3 MQTT Publish/Subscribe ...... 33

4.4 Adafruit IO Feeds List for UrbanBox ...... 35

4.5 Temperature Plot in Adafruit IO ...... 35

4.6 Humidity Plot in Adafruit IO ...... 36

4.7 Dust Plot in Adafruit IO ...... 37

vii 4.8 Temperature Data Size of Two Weeks ...... 38

4.9 Arduino IDE ...... 39

viii ABSTRACT

Weather and Air quality monitoring are very important aspects of smart city management. As population increase in the cities, the emission of pollutants includes Carbone Monoxide, Nitrogen Dioxide, Ozone and the Particulate matter will increase which will cause health and environmental issue. This paper is about developing a low-cost Urban sensors box based on . The Urban box is equipped with 4G/3G wireless communication which allows the wide range of mobility around the city. The Urban Sensor box is a collaborative work to monitor real-time data of the citys environment, infrastructure, and activities. All these data will be provided to understand the interconnected behavior of different tangible networks of the urban environment.

ix CHAPTER 1

INTRODUCTION

1.1 Introduction

In nowadays, lots of smart projects are developed and managed by the goverment and industries, for instance smart wireless sensor networks, smart water distribution system, smart power grids and smart home automation control systems. Almost all of these smart systems are taking about one single concept, which is known as Internet of Things (IoT), uses intelligently connected devices and systems to transfer data over a network without asking for human interaction.[25] The IoT concept, hence, aims at making the Internet even more common used. What’s more, lots of data will be generated by a huge amount of various devices such as monitoring sensors, cameras, displays, vehicles and others smart devices. Behind this, application in many different domains will be needed, such as home automation, industrial automation, mobile healthcare, energy management and smart power grids, automotive, weather alert, traffic alert, traffic managerment and many others.[40] For our urban sensor box project, we aim to collect real-time data of physical conditions around FSU campus and CAPS building. The data will come from a well-designed, various kinds of sensor included, wireless communication sensor boxes. We focus on developing differnet applications based on various conditions. For example, we can do event classifications in the transportation aspect to find the traffic condition is good or bad in the crossing. Or anomaly detection such as making a alert when there is an traffic incident happened, people could save their time to avoid to be stopped in the street for a long time. Besides that, we can make predictions as well, such predict the traffic conditions based on the history of the traffic jam. There are lots of other things we can try, cross compare the weather conditions in different locations and find the inner relationship between weather and traffic.

1 1.1.1 What is a Wireless Sensor Network

A Wireless Sensor Network(WSN) is consisted of a set of smart sensors to monitor physical conditions (enviroment) and to cooperatively send their data into a main location through net- work.[29]At the begging of the history of WSN, it was motivated by military applications such as battlefield survaillance;[44] More applications are applyed and used in industrial and consumer field later on, such as environmental monitoring in the buidings, machine process control and monitoring, processing monitoring and so on. Potential Applications Designers have made WSN applications for locales including social protection, utilities, and remote watching. In therapeutic administrations, remote devices make less prominent patient checking and social protection possible. For utilities, for instance, the power structure, streetlights, and water municipals, remote sensors offer a lower-cost system for social affair system prosperity data to reduce essentialness utilize and better supervise resources. Remote checking covers a broad assortment of use where remote systems can supplement wired structures by decreasing wiring costs and allowing new sorts of estimation applications.[9] Remote checking applications include: Environmental observing of air, water, and soil Structural monitoring for buildings and bridges Mechanical machine checking Process checking Resource following

1.1.2 How Do Sensor Networks Work

Wireless sensor systems impart inside themselves and with a client not really close to the system’s area. How does this function? Wireless sensor network gathers information about what is going on and play out some activity as per that information, be it moving, setting off alerts, or just account the information. These activities change the world that the hub is in, causing different changes, et cetera. Due to the association between the hubs, these progressions influence every hub, and the majority of the information gathered by the hub is steered to the parent hub. This parent hub is associated with a PC of a higher power that plays out a capacity for which the hubs are not planned. One such capacity is to get to the web and exchange the hubs’ information to the

2 client’s PC. The client may also speak with the hubs. On the off chance that the client gives a few orders, the directives will be sent over the web to the PC/station.

1.1.3 What is Smart City

The concept of the smart city is characterized as a city that its subjects are locked in and its foundations are associated electronically. A city which is called smart city ought to be able to coordinate numerous advances secury to deal with its advantages. Nearby departments frameworks, schools, libraries, transportation systems, hospitals, power plants, law enforcement, and other network administration ought to be incorporated into its advantages, yet not constrained to these perspectives.[30][35] The objective of building a smart city is to enhance the effectiveness of administrations and address inhabitants’ issues by using technology so that the personal satisfaction will be moved forward. Technology develops to meet the needs of the business.[12] New technologies and innova- tions are created and generated every day in large-scale urbanization city. The interaction among the city officials, the community and the citys infrastructure is mainly affected by technologies. Information is gathered from the nationals and sensors and afterward prepared continuously. The data and information assembled are the keys to advancing frameworks and handling wastefulness. Technological solutions are offered by the smart city to tell what is going on in the city, how the city is creating, and how to encourage a superior personal satisfaction. [17] Hypothetically, any zone of city administration can be fused into a smart city activity. A great case is the smart parking meter that uses an application to enable drivers to discover accessible parking spots without delayed hovering of swarmed city squares. The smart meter also empowers advanced installment, so there’s no danger of missing the mark regarding coins for the meter. Also in the transportation field, smart traffic management is utilized to screen and dissect activity streams to upgrade streetlights to keep roadways from ending up excessively congested in light of the time of day or surge hour plans. Smart public transit is another feature of smart urban communities, used to guarantee open transportation takes care of client demand. Smart travel organizations can facilitate benefits and satisfy riders’ needs continuously, enhancing productivity and rider fulfillment. Ride-sharing and bicycle sharing are also basic administrations in a smart city.

3 Vitality protection and productivity are major focal points of smart urban areas. Utilizing brilliant sensors, savvy streetlights diminish when there aren’t autos or people on foot on the roadways. Smart grid technology can be utilized to enhance tasks, support, and arranging, and to supply control on request and screen vitality blackouts. Smart city activities also intend to screen and address ecological concerns, for example, environ- mental change and air contamination. Sanitation can likewise be enhanced with shrewd innovation, be it utilizing web associated junk jars and IoT-empowered armada administration frameworks for squander gathering and evacuation, or utilizing sensors to gauge water parameters and assurance the nature of drinking water at the front end of the framework, with legitimate wastewater expulsion and seepage at the back end.

Smart City Components. Smart city innovation is progressively being utilized to enhance open security, from observing territories of high wrongdoing to enhancing crisis readiness with sensors. For instance, keen sensors can be basic parts of an early cautioning framework before dry seasons, surges, avalanches or tropical storms. Smart buildings are also regularly part of a keen city project. Heritage framework can be retrofitted and new structures developed with sensors to not just give continuous space adminis- tration and guarantee open security, yet in addition to screen the auxiliary strength of structures. Joining sensors to structures and different structures can identify wear and tear and inform au- thorities when repairs are required. Residents can help in this issue, informing authorities through a brilliant city application when repairs are required in structures and open foundation, for ex- ample, potholes. Sensors can likewise be utilized to identify spills in water mains and other pipe frameworks, diminishing expenses and enhance the effectiveness of open laborers. Smart city advances bring efficiencies to urban assembling and urban cultivating, including work creation, vitality productivity, space administration and fresher merchandise for customers.

1.1.4 Why Do We Need Smart Cities

Cities have attracted and concentrated a massive number of people, new problems are generated along with a large number of people. Not only limit in managing resources in public sector, but also for the private sector, pushing companies to promote a continuous adaption in business to meet the new consumption demands. The growth of our cities is skyrocketing inequality. While

4 the population and economy grow rapidly, a better standard of living is required. Residents need the government and industries to provide public data, electronic service delivery, water quality monitoring etc. Furthermore, smart cities are transformed by improving infrastructure and trans- portation systems, providing waste management, reducing traffic congestion. Smart cities become more innovative, competitive, and attractive by promoting integrated and sustainable development. Thus the quality of residents living conditions is improved.[39]

1.1.5 What Is the Challenge and Concerns of Smart Cities

As the development of urban areas keeps encouraging, to ensure populace development, financial advancement and social advance stroll in a similar way, the difficulties of urban communities should be however through. Urban areas are where the imbalances are more grounded and, when you didn’t oversee it, the negative impacts can surpass the positive ones.[17] There will be some main issues that we need to consider. To build a smart city, the cost will be a lot for the government. Generally, it will cost billions of money to build a smart city, which is really hard to afford for the government. Also, how to manage and mobilizing such huge finance will be a challenge for any government in the world. In the private sector, privacy is another thing that we need to pay attention. When there are lots smart devices which collect data from surroundings and citizens, it will related to the private life of everybody in the city.Since smart city technology realies largely on wireless IP networks, which have become increasingly vulnerable to harckers. And it is easily to link all these information to a identifiable person with his/her phone number, email address, credit card details, scoial media accounts, etc. How to make the identifiable information be secured, and how to protect the privacy for citizens will be big challenges for the government. Smart city initiatives must incorporate the general population it plans to encourage: its occu- pants, businessmen and guests. City pioneers must not just bring issues to light of the advantages of the savvy city advances being actualized, yet in addition, advance the utilization of open democ- ratized information to its nationals. On the off chance that individuals recognize what they are partaking in and the advantages, it can bring, they will probably lock-in. Fostering collaboration between general society and private segment and city occupants is crit- ical to making a keen subject will’s identity drew in and engaged and emphatically add to the city and network. New and inventive coordinated effort strategies can enhance commitment. Smart

5 city projects ought to incorporate plans to make the information straightforward and accessible to residents, frequently through an open information entryway or portable application. This empowers occupants to draw in with the information and comprehend what it is utilized for. Through a keen city application, inhabitants may likewise have the capacity to finish individual tasks, for example, seeing their home’s vitality utilization, paying bills and finding effective open transportation. Smart city adversaries stress that city administrators won’t keep information protection and security best of brain, dreading the presentation of the information that natives deliver regularly to the danger of hacking or abuse. Moreover, the nearness of sensors and cameras might be seen as an attack of protection or government reconnaissance. To address this, savvy city information gathered ought to be anonymized and not be by and by identifiable data.

1.2 Objective

Urban sensor box will provide real-time data of multiple types including environment, air quality and traffic about the city of Tallahassee. The information will assist us in increasing the effectiveness of our city administration in different areas, for example, transportation, safety, and condition(e.g., garbage management). It will also help the city to reduce the power consumption, and will be a nice monitoring system.

1.3 Motivation

Nowadays, lots of smart devices and objectives are integreted with different types of sensors as a whole system to dectect the environmental information. According to a report recently published by Gartner , the IoT market are growing much more rapidly than we thought. The market will sell around one million new IoT devices every hour and nearly 2.5 million US dollars will be spent per minute on IoT by the end of 2021.[12][19] Dealing with the rising IoT needs a merge and adaptable stage. This is a delegate of data administration, that is created by the gadgets. It is generally spread in the earth, including the ones that need human nearness. IoT is bunched by the tending to, checking, interfacing, investigating the framework, and responding, yet in addition improving the correspondence between human to human, human to things and things to things. The quantity of gadgets, that create data and information from the earth and dispatch it to the Internet, offer a colossal assortment of uses.

6 IoT implies that everything from family unit apparatuses, to development hardware, to vehicles and structures will transmit information and speak with different objectives or individuals. That implies everything will have the capacity to be estimated and followed constantly. Cloud-based applications and apparatuses will have the capacity to investigate and make an interpretation of that information into helpful data. This information can fuel better choices and help grow better results. Enormous information has officially made waves in almost every industry, demonstrating the estimation of data and examination. Envision the potential outcomes if about each question uti- lized as a part of the multi-day transmitted information that could then be adroitly broke down continuously. Like what Array of things did in Summer 2016, 42 nodes has been assembled on the traffic signal lights near Chicago city. We aim to provide a more complicated, flexible sensor box which can give us insights about the co-mobility of the city Tallahassee. For instance, organizations in smart urban areas incorporate CO, CO2, NO sensors for estimating aerates and cools and pollutions, vibration sensors for observing extensions and activity, and cameras for keeping an eye out potential wrongdoings. Those associated gadgets frame a vast size of IoT framework with geologically circulated endpoints, which produce an enormous volume of information streams after some time. The IoT will also affect the industries. The more correspondence among machines - the more associated they are - the more associated everybody will be to each other. Information won’t be siloed into one specific industry. It will be utilized crosswise over organizations and businesses, energizing advancement. For instance, information from smart autos can enhance activity, which can create and enhance the smart city, which can influence vitality to utilize more proficient, et cetera. The potential outcomes will be unfathomable when machines, enterprises, and individuals can associate and move upgrades. For business visionaries, IoT implies new open doors for a joint effort, profitable organizations and outside bits of knowledge to improve their business. What’s more, all the data will be shared. Every information that IoT conveys won’t exist in a vacuum - it will be shared among colleagues, partners, and different gatherings. For instance, con-

7 sider how wearable tech enables people to gather wellbeing information and offer it with specialists and suppliers, to enhance mind. At the point when this sort of innovation is connected in different enterprises, the effect will be enormous. Observing the adequacy of procedures, the aftereffects of crusades and the proficiency of frame- works end up simpler and more noteworthy when more individuals are on the up and up. The capacity to associate and offer information has the likelihood to unite assorted offices - like book- keeping and HR - to settle on choices everybody can concur on.

8 CHAPTER 2

STATE OF THE ART

2.1 State of the Art

Array of Things, Smart Citizen and Citizen Sense are reviewed separately here due to the platform differences in these three different projects. In this study, I will compare against each other to cross analyze the differences and similarities in whats the goal for each project and what they want to find or improve for the city. Moreover, I will compare the components that each project used and try to learn something after this study.

2.1.1 Array of Things

What Is the Array of Things. Imagine a scenario where a light shaft instructed you to keep an eye out for a frosty fix of walkway ahead. Imagine a scenario in which an application disclosed to you the most populated course for a late-night stroll to the El station without anyone else’s input. Consider the possibility that you could get climate and air quality data hinder by-obstruct, rather than city-by-city. The Array of Things (AoT) is an urban detecting project, a system of intuitive, particular sensor boxes that will be introduced around Chicago to gather ongoing information on the city’s condition, framework, and movement for research and open utilize. AoT will basically fill in as a ”wellness tracker” for the city, estimating factors that effect bearableness in Chicago, for example, atmosphere, air quality and commotion.[2]

What Is the Objective of Array of Things. The Array of Things project expects to put urban sensor encloses the city of Chicago at different crossing points and parts of the city. This system of sensors will make a strategy for getting information which is more confined, with information that applies to zones of a city rather than the present estimations which are taken over the bigger metropolitan zone. Array of Things plans to make an application which will take into consideration the utilization of cell phones by subjects to get to the recorded information which can help streamline travel and additionally urge natives to be more aware of their condition. The

9 undertaking will likewise serve to spare valuable cash for the city, as individualized information will enable the city to convey their city assets all the more adequately. [2]

What Data Is Collected. The Array of Things project will measure air information, for example, carbon monoxide, nitrogen dioxide, sulfur dioxide, ozone, vehicle and passerby activity, light, barometric weight, temperature, and encompassing sound. Venture pioneers plan to grow the sensor boxes so the sensor boxes can likewise quantify surge levels and standing water, and also precipitation, wind speed and different sorts of toxins. The square to-piece information can be utilized to create more individualized information for urban areas.[11]

What Can Be Done with This Data. Raw information will be presented on the City of Chicago’s open information system and Plenario, an online entrance that backings open information pursuit, investigation, and downloading with open datasets from Chicago and around the globe. Since the data will be appropriated direct and without charge, it will likewise reinforce the change of innovative applications, for instance, a flexible application that empowers an occupant to track their introduction to certain air contaminants, or to investigate through the city in perspective of evading urban warmth islands, poor air quality, or over the best upheaval and obstruct. Potential utilization of information gathered by the Array of Things include: Sensors checking air quality, sound and vibration (to distinguish generous vehicle movement), and temperature can be used to prescribe the most advantageous and unhealthiest walking times and courses through the city or to consider the association among diseases and the urban condition. The ongoing discovery of urban flooding can enhance city administrations and framework to counteract property harm and sickness. Estimations of small-scale atmosphere in various zones of the city, so inhabitants can get up and come, high-determination ”obstruct by-square” climate and atmosphere data. Watch which regions of the city are intensely populated by people on foot at various circum- stances of day to propose sheltered and effective courses for strolling late during the evening or for timing activity lights amid top movement hours to enhance person on security and decrease blockage related contamination. Array of Things information and innovation will be accessible for instructive purposes, connect- ing with neighborhood understudies and preparing them on critical occupation aptitudes. Read about Lane of Things, our educational programs with Lane Tech High School in Chicago.

10 How Was the Privacy and Security. All hardware, programming, and data being assem- bled will be reliably investigated by a Technical Security and Privacy Group drove by Von Welch, executive of Indiana University’s Center for Applied Cybersecurity Research. Functioning as an external, free overview gathering, the board will in like manner be advised at whatever point there is an interest for another kind of data to be accumulated. The Array of Things Executive Oversight Council will be co-driven by Commissioner of the City’s Department of Innovation and Technology Danielle DuMerer, Urban Center for Computation and Data Director Charlie Catlett, with additional people browsed the insightful world, industry, non-benefits, and the system. No data will be checked without the support of the assurance and security external oversight board, the City of Chicago and the AoT official board, and the action of the Array of Things will be spoken to by security techniques that will be circulated before the foundation of centers.[2]

Table 2.1: Sensor List for Array of Things

Measurement Purpose/Application Carbon Monoxide Environment Hydrogen Sulphide Environment Nitrogen Dioxide Environment Ozone Environment Sulfur Dioxide Environment Air Particles Air Quality,Health (PM 2.5 to 40) Barometric Pressure Weather Conditions Humidity Weather Conditions Temperature Weather Conditions Physical Shock/Vibration Detect heavy vehicles, shock to street pole (e.g. accident) Acceleration and Orientaion Magnetic Field Detect heavy vehicle flow Infrared Light and Orientaion Cloud cover, sunlight intensity Light Cloud cover, sunlight intensity Visible Light Cloud cover, sunlight intensity Ultraviolet Intensity Cloud cover, sunlight intensity RMS Sound Level Sound intensity (loudness) Camera Street conditions, traffic flow, events

Notes: 1: These sensors do not have the capability to measure or identify individuals. 2: Microphones and cameras in public spaces do not collect sensitive personally identifiable information (PII). Microphone and camera images will be processed in near-real-time within the

11 installed equipment, not transmitted or stored, with the exception of less than 1 percent images at random times, saved for the purposes of image processing software calibration. Although these images will not contain PII, they will be controlled and protected with the same measures typically afforded PII. 3: During the 2016-2017 pilot period, the cameras will be used for the purposes of detecting and publishing (a) count/flow of pedestrians, (b) count and flow of various vehicle types, and (c) extent to which road surface is covered with standing water (flooding). This list will be updated prior to publishing new types of data from images.

2.1.2 Smart Citizen

What Is Smart Citizen . Smart Citizen is a platform to produce participatory procedures of individuals in the urban areas. Associating information, individuals, and learning, the goal of the stage is to fill in as a hub for building beneficial and open pointers, and circulated devices, and from that point the aggregate development of the city for its own tenants. The Smart Citizen project depends on geolocation, the Internet and free equipment and pro- gramming for information gathering and sharing. It interfaces individuals with their condition and their city to make more powerful and enhanced connections between assets, innovation, networks, administrations and occasions in the urban condition. The Smart Citizen platform is a full set of tools waiting from you to start using them: enroll to the stage, check the API, download the Android application, get a Kit or add to the open-source project.

What Are the Sensors Used in Smart Citizen. The Smart Citizen Kit is a bit of equip- ment involved with a sensor and an information preparing board, a battery and an enclosure. The principal board conveys sensors that measure air organization (CO and NO2), temperature, moistness, light power and sound levels. When it’s set up, the gadget will stream information estimated by the sensors over Wi-Fi utilizing the FCC-ensured, remote module on the informa- tion handling board. The gadget’s low power utilization considers putting it on overhangs and windowsills. Energy to the gadget can be given by a sun-oriented board as well as battery. The Kit isn’t another discovery, it is good with Arduino and all the outline records are open- source (schematics and firmware).

12 What Can We Do with Smart Citizen. Researchers: Use it as an instrument for informa- tion catch and examination in innovation arrangements, or for social investigations. Comprehend the connection between individuals, condition, and innovation by doing genuine arrangements. Savvy Citizen is being utilized as a part of significant colleges around the globe to fabricate tries around engineering, plan, software engineering, innovation, among different orders. School: Information could be a capable instruction device. Utilize Smart Citizen equipment and programming instruments to teach software engineering and environmentalism in your classroom. Open discussions about the ecological quality at schools, the utilization of sensors and information in the training segment. Cities: Smart Cities ought to be manufactured together with Smart Citizens. The development of new foundation isn’t just conceivable because of a monstrous interest in new innovations, however, should be possible through the better enhancement of the current assets. Co-make with your natives, incorporating support in the political life in the regular city. Citizen science: Lessen the gaps to get information caught and streamed by sensors. No more cables, shields, and libraries with a specific end goal to get profitable information from the earth. Analyse the information on the web, or download it to place it in your favored device.[12]

Table 2.2: Sensor List for Smart Citizen Measurement Purpose/Application light Environmental Aspect Sound Environmental Aspect Temperature Environmental Aspect Humidity Environmental Aspect CO Air Quality/Health NO2 Air Quality/Health Micro SD card Data storage Solar panels Power supply

2.1.3 Citizen Sense

What is Citizen Sense. Citizen Sense is broken into three different phases, the first focuses on pollution, by utilizing sensors which measure air and water pollution. Phase 2 is known as the Urban Sensing phase, which places a high emphasis on applying sensors to more densely populated urban areas. Finally, the Wild Sensing phase is geared toward mapping and tracking animals and

13 vegetation in and around the urban environments. Citizen Sense utilizes the Citizen Sense Airsoft PM2.5 Data Analysis Toolkit.[13] Pollution sensing:this is the task which centers around checking and announcing natural contam- ination. Nosier, air, soil and water contamination are neighborhood if dispersed natural unsettling influences that numerous urban tenants involvement all the time. By concentrating on the ecolog- ical unsettling influence, we could locate the inward connection between the strength of individual bodies and natural wellbeing. In this task territory, they are examining the utilization of sensors in resident detecting ventures to study and record contamination. They led a progression of strolling class occasions that furnish open doors for trying different things with sensors and for drawing in with contamination as an ecological occasion and matter of concern. Urban sensing: this is the project which researches the utilization of computerized natural sensors in urban conditions to advance supportability. Various undertakings are currently situated at the convergence of remote sensor scenes with urban procedures. Remote detecting advances are an approach to accomplish more maintainable and productive urban areas. These undertaking examinations the use of sensors in inhabitant recognizing wanders that would make urban methods more normally steady and will give open entryways for testing sensors and for attracting with urban conditions and process through automated modalities. Activities around there propose on one level to make foundations more proficient, yet on another level residents with detecting capacities are a key manner by which urban procedures may run all the more effectively by observing their individual utilization exercises, transport examples, and vitality utilize. Regularly, urban subject detecting ventures expand the worries of contamination detecting by taking part in types of observing and detailing identified with urban procedures. These perceptions may then convert into ground-up commitments to a natural strategy for urban zones. In any case, they may likewise raise new worries about the appropriation of administration in and through carefully oversaw situations.

What We Can Do with Citizen Sense. Create a network of connected nodes which will allow citizens to interface with the nodes via smartphones in order to analyze the environmental data collected by these nodes. Similar to the Smart Citizen project, Citizen Sense seeks to create a network of interconnected sensors by engaging the general public and encouraging citizens to take an active role in environmental data acquisition.

14 CHAPTER 3

URBANBOX HARDWARE DESIGN

3.1 UrbanBox Design Idea

The integral part of the urban sensor box lies in the hardware design with the combination of most accurate and most informative sensors. In our UrbanBox project, several components are used including micro-controller, GSM shield, GPS clock and sensors, to cover a wide range of capabilities.

3.1.1 Microcontroller Comparision

To start with our project, we first have to pick one micro-controller board as kind of the ’brain’ of the whole system. It’s used to run the programming commands and control the sensors to push its data into either commercial platform or our own database system. Before starting to pick the micro-controller board, we need to figure out what’s our need for the board, in other words, what we are going to do with the board. Our main goal is to make an Urban monitoring system in three aspects: environmental, air quality and transportation. Above all, we need a micro-controller board to manage different kinds of sensors and push the data from the sensors to the database. This requirement for the board is pretty simple. There are two popular products on the market, one is Raspberry Pi and another one is Arduino Uno.

Arduino Uno. Arduino Uno is a microcontroller board which has 14 digital input/output pins, 6 analog inputs, a 16MHz quartz crystal, a USB connection, a power jack, an ICSP header and a reset button. You can easily program Arduino board without any experience. Because Arduino has a large library for coding sensors, motors, shields and so on.[14] Another advantage of using arduino uno is that many forums present on the internet, which means online support is also quite convenient for Arduino users, you can simply post your questions or issues of your project, there are lots of experts who are willing to help you with your own problems. Besides that, The UNO is the most used and documented board of the whole Arduino family. The price of Arduino Uno

15 is around 30 dollars and the size is 68.6mm of length and 53.4mm of width. It is also simple and easy to integret arduino board with sensors and some additional shields.[28]

Figure 3.1: Arduino Uno Board

Raspberry Pi 3. Raspberry Pi is like a small computer with a Quad Core 1.2GHz Broadcom BCM2837 64bit CPU, 4 USB 2 ports, 100 Base Ethernet port, a DSI display port for connecting a Raspberry Pi touchscreen display, 40-pin extended GPIO and a Micro SD port for loading your operating system and storing data. And its price is around 40 dollars. Raspberry Pi runs in system and requires some programming skills before using it.[6][34][38][46]

Final Microcontroller Board. Arduino Uno board are used in our project as micro-controller. There are some reasons that why we choose it: first of all, Arduino is intended to make applications, intelligent controls, or conditions effectively versatile and it’s an easy to use stage which gives an extensive library to specialists, understudies and experts to make applications that play in human interface world utilizing sensors, actuators, engines and other simple items. Also, the typical prices of Arduino boards are around 25 dollars, for instance in our project, Arduino Uno costs only 20 dollars. Not only the price is cheap, but the Arduino boards can also

16 Figure 3.2: Raspberry Pi 3 assemble other shield which make the Arduino board to accomplish some other functions, such as Ethernet shield, ZigBee transistor and receiver, 4G shield and so on. Considering several UrbanBoxes will be built in the future, it’s necessary to add GPS clock to the design. Different UrbanBoxes needs to communicate with each other, and refer to different locations which UrbanBox might locate, time synchronization is very important. Since we will analysis the data from various urbanbox, the data needs to be compared in the same time standards. GPS clock synchronization kills the requirement for manual clock setting to build up traceability to national and global benchmarks so different occasions can be connected notwithstanding when they are time-stamped by various tickers. The advantages are various and include lawfully approved time stamps, administrative consistency, secure systems administration, and operational effectiveness. For the sensors part, in order to get make the connection between environment and transporta- tion, environmental sensors and camera are required in this design.

17 3.2 Hardware List and Functions 3.2.1 Light Sensor - Photo-resistor

Light Dependent Resistor, also called photo-resistor, are light delicate devices frequently used to show the nearness or nonattendance of light, or to quantify the light force. The most well-known kind of LDR has a resistance that falls with an expansion in the light power, and in the opposite way, the resistance will go up when the it’s dark. Three pins are used:the input power pin(VCC), analog signal pin(DATA), and negative power pin(GND). Since the readings are quit related to the light intensity, the accuracy of light is high and reliable.

Figure 3.3: Light Sensor

3.2.2 Gas Detection Sensor - Grove- Multichannel Gas Sensor RB-See-488

Including CH4, CO, NH4 and a bit more different kind of gases.

3.2.3 Dust Sensor - Grove- Sharp Dust Sensor

Dust sensor can detect that tobacco smoke and dust, house tidy, for example, warming pro- grammed suction device, Using the same as the molecule counter standard as the establishment, to identify without a doubt the quantity of particles per unit volume. This Dust Sensor has five pins: the input power pin(VCC), signal pin1 (P1), signal pin 2(P2), digital pin 0(RX) and negative power pin(GND). Note that this sensor only detect the size of the particles while does not detect the amount of particles.

18 Figure 3.4: Gas Sensor

Figure 3.5: Dust Sensor

3.2.4 Temperature and Humidity Sensor - DHT22

DHT22 is a very simple and cheap sensor which output calibrated digital signal. Its low cost and only requires a 3 to 5V power. It has a small size with 15mm x 25mm x 7.7mm and 4 pins including the input power pin(VCC), digital signal pin(DATA), not connected pin (NC) and negative power pin(GND). With a simple connection and a great library DHT.h in Arduino, we can easily get both temperature and humidity readings. Temperature and humidity will be measured at the same time by this sensor.

19 Table 3.1: DHT22 Accuracy

Measurement Range Accuracy Temperature 0-100 percent 2-5 percent Humidity -40 to 80C 0.5C

Figure 3.6: DHT22 Sensor

3.2.5 Sound Sensor - High Sensitivity Sound Microphone Sensor Detection Module

This sound sensor has two outputs, one is anolog output with a real-time output voltage signal of the microphone and another digital output.

Figure 3.7: Sound Sensor

20 3.2.6 Camera - TTL Serial Camera

Camera is designed to work with a storage device. The storage device will be attached with an SD card which can be 4GB, 8GB or 16GB depends on how many images we are looking for. One image is about 50KB, if we would like to count the amount vehicles which passes the crossing, we should take picture at least every 5 seconds. That means we will have around 600KB every minute, 35MB every hour and about 840MB images for one day.

Figure 3.8: TTL Serial Camera

3.2.7 Micro-SD Breakout Board

In order to save the images and do image processing to count the amount of vehicles, we need this board to storage the images first. This board can connect to TTL serial camera directly with its pins and a 4GB/8GB SD card is needed.

3.2.8 Fona 808 Shield

GSM shield is the extension board that we used to attached into the micro-controller board, in order to provide a wireless connect between micro-controller and database/platform that we used to storage our sensor data. Adafruit FONA 800 Shield is our final choice for our design. Why?Since it is extremely delightful across the board mobile phone shield that gives you a chance to include voice, content, SMS, and information to our undertaking in a simple to utilize the pluggable shield. It has Quad-band 850/900/1800/1900MHz which can connect onto any global GSM network with any 2G SIM, send and receive SMS messages, send and receive GPRS data(TCP/IP, HTTP, etc),

21 Figure 3.9: Micro-SD Breakout Board and so on. But this shield needs some help with other components: a 2G mini SIM card is required to do anything on the cellular network, a Lipoly battery is needed as power supply(1200mAh), and a slim uFL antenna have to be assembled into this shield.[6]

Figure 3.10: Fona 808 Shield with Antenna

3.2.9 GPS Antenna - Passive GPS Antenna uFL

This GPS antenna is pretty small with only 9mm x 9mm x 6.5mm in size and a a 50mm long uFL cable. It’s quite small but has an high accuracy about 2.5 meters. The GPS antenna not only gives the exact location of the UrbanBox, but also provides the time when we received the data.[6] When we make more than one prototype, time synchronization will become a serious issue that we

22 can fix with this. It is important that we can have a standard time clock when we try to do the data analysis in time serials.

Figure 3.11: GPS Antenna

3.2.10 Lithium Ion Polymer Battery

This battery is thin, light and powerful with capacity of 1200mAh and 3.7V. It is necessary for the FONA 808 shield. In other words, FONA 808 shield will not work without this battery. It is very easy to plug this battery as a power supply to the shield. Note that it is better to put the adapter and charge it along with the microcontroller board.

Figure 3.12: Lithium Ion Polymer Battery

23 3.2.11 Mini Fan

In order to keep the box in a safe temperature condition and protect the electronics, we add a mini fan to this UrbanBox design. So that there are no items will be melt by the high temperature in Florida.

Figure 3.13: Mini Fan

3.2.12 Others

By connecting these items, we also used some jump wires and breadboards. Also, AC to DC adapters with charging wires are necessary to provide the power.

3.3 Whole System Design and Connection

In this project, we divided the whole into two main parts: hardware, software. In the hardware part, sensors and micro-controller are the main components. Also, in order to make the system available in conditions without Ethernet, or WiFi, a 4G shield is attached to the micro-controller. The network is also considered as a significant part of this project. We will talk about the software and network part in the next chapter. To make a project with many electronic items, we can either do it by soldering or using some jump wires to do the physical connections. Some basic soldering for the sensors are necessary for this project, for example, the pins for shield and sensors need to be done before we connect them

24 Figure 3.14: Hardware Wires Connection to the microcontroller. But when we do the connections between sensors and microcontrollers, we can use jumper wires to make this system adjustable and flexible. Because further on, we could change the sensor type or communication shield type, or replace the sensors with a better accuracy one easily. Below is the physical wires connection shown in Figure 3.14: Table 3.2: Sensor Pins Connection Sensors pin 1 pin 2 pin 3 pin 4 pin 5 pin 6 DHT22 Vcc D1 NC (Not Connected) GND Photoresistor A0 5V GND Sharp dust sensor 5V GND D3 GND A2 5V BMP280 Vcc NC GND A0 NC A1 DHT22 NC NC RX TX GND Vcc DHT22 Vcc GND A3 NC

After finishing all the hardware connections, we should make UrbanBox work as the diagram shown below: Several different types of sensors are connected with microcontroller board through jump wires and breadboards. Using a 4G/GSM shield attached to the microcontroller board to make sure the

25 Figure 3.15: Hardware Diagram cellular network(SIM card is inserted into the shield). Adding a GPS clock to make a location tracking system and make the time synchronized. Using MQTT protocol to make the machine to machine communication and finally send the data to the platform and storage them into the database.

3.3.1 System Demo

This demo is for testing communication and environment. It is located outside the Center for advanced power system(CAPS) building, Tallahassee. We keep it running for 2 weeks, and during that time, it had been a sunny day, rainy day, cloudy day. With all these different conditions, it runs smoothly and perfectly. For the power supply part, we use two chargers with an extended wire from the building. And in the side of the box, we made some holes so that the air can exchange and the temperature will not raise a lot due to a sealed condition. Since we are in Florida, the Sunshine State, the temperature is always a big issue when we do the tests especially when we put this outside. Before testing, we were worried about that the electronics might be melt by the sun. But fortunately, this bad situation did not happen. It’s good to have some backup plan just in case this happened. For example, we have a few spare sensors and shields and we add a mini fan to this design to help cool down the system.

26 Figure 3.16: UrbanBox Demo 1

27 Figure 3.17: UrbanBox Demo 2

28 CHAPTER 4

NETWORKING AND COMMUNICATION

4.1 Introduction

This section describes all the network and communication methods which used in this project. It constructs the data interaction for the IOT system which realize the transparent transmission of data between the end systems. It interfaces each IOT part consistently and it’s in charge of convey- ing rapid, low misfortune, secure and solid conveyance of information data to another layer while perceiving the information. The particular capacities incorporate tending to and directing, founda- tion, hold, and end of the association. The strategies dependably contain one of the accompanying 4G, Wi-Fi, Bluetooth, Zigbee, or Ethernet, and so on.

4.2 Networking

The Fourth Generation of Broadband Cellular Network Technology (4G) 4G and can quickly transfer data, high quality, audio, video and images which can meet the needs of any user of wireless services. The reason for using 4G is that the Ethernet has the limitation of find the Ethernet port. In the same time, although WI-Fi has a higher data rate, it also more compatible with indoor system. For monitoring a city, a outdoor project, 4G technology will be the first technology should be considered.

4.2.1 4G Technology

Comparing with the third generation mobile communication Technology (3G), the peak down- load speed is100Mbit/s, and the upload speed around 50Mbit/s; On the another hand, the peak download speed of 4G transmission can reach 1000Mbit/s, and the upload speed also up to 500Mbit/s. It will provide a possible to get the data in high speed way which will be critical to get the fresh data. A standout amongst the most imperative parts of 4G innovation is the end of parallel circuit- exchanged and bundle exchanged system hubs utilizing Internet Protocol version 6 (IPv6). The

29 presently utilized standard, IPv4, has a limited constraint on the quantity of IP tends to that can be doled out to gadgets, which means copy tends to must be made and reused utilizing network address translation(NAT), a solution that lone veils the issue rather than completely comprehending it. IPv6 gives a considerably bigger number of accessible locations and will be instrumental in giving a streamlined affair to clients.

4.2.2 WiFi Technology

Wi-Fi was intended for remote cash registers called WaveLAN at first in the 1980s imparted to the establishment of Electrical and Electronics Engineers(IEEE) bunch in charge of systems administration benchmarks, known as advisory group 802. At that point it was produced amid the 1990s further until the point when the council distributed standard 802.11 out of 1997. Wi-Fi is a development that empowers electronic devices to connect with a neighborhood (WLAN), commonly using a 2.4G Ultra High Frequency (UHF) or 5G Super High Frequency (SHF) Industrial, Scientific and Medical (ISM) radio repeat band. Partner with a WLAN is ordi- narily watchword anchored, yet it may similarly be open, empowering any device inside the WLAN to interface, for instance, PCs, phones, propelled cameras, tablet PCs, and present-day printers. The extent of Wi-Fi as a rule is around 20 meters and a more unmistakable range outside.

4.2.3 Ethernet Technology

Ethernet technology was created by engineers Bob Metcalfe and D.R. Boggs in 1972. Industry gauges in view of their work were built up in 1980 under the IEEE 802.3 arrangement of specifi- cations.[10] Since the long history of Ethernet innovation, it has developed and developed over a significant lot and it is generally utilized as a part of LAN and Wide Area Network (WAN), which is a wire association strategy. Ethernet interconnects the gadgets at 10 to 100 Mbps, and Ethernet is the most broadly and predominantly utilized innovation because of its ease, high dependability, and 10 Mbps rate. Data sent over the Ethernet is therefore imparted to all devices on the framework. By taking a gander at their Ethernet address against the address in the edge header, each Ethernet contraption tests each edge to choose whether it was anticipated them and examines or discards the packaging as fitting. Framework connectors combine this limit into their hardware.

30 4.3 WSN Network Topologies

WSN hubs are normally sorted out in one of three kinds of system topologies. In a star topology, every hub interfaces specifically to a gateway. In a cluster tree network, every hub interfaces with a hub higher in the tree and afterward to the entryway, and the information is steered from the most reduced hub on the tree to the passage. At long last, to make the system more reliable, mesh network interface with various hubs in the framework and send information over the most solid way accessible. Most of the time router is the mesh link here.[5][10]

Figure 4.1: Three Network Topologies

4.3.1 Components of a WSN Node

A WSN hub contains a couple of particular parts. These join the radio, battery, microcontroller, straightforward circuit, and sensor interface. While using WSN radio development, you should make crucial trade-offs. In battery-energized systems, higher radio data rates and more normal radio use more power. Frequently three long stretches of battery life is a necessity, such a significant number of the WSN frameworks today depend on ZigBee because of its low-control utilization. Since battery life and power administration innovation are continually developing and due to the accessible IEEE 802.11 data transfer capacity, Wi-Fi is a fascinating innovation. [5][10] The second development thought for WSN structures is the battery. Despite long life require- ments, you should consider the size and weight of batteries and what’s more worldwide models for

31 conveyance batteries and battery openness. The simplicity and wide availability of carbon-zinc and acid neutralizer batteries settle on them a run of the mill choice. To extend battery life, a WSN center point incidentally stirs and transmits data by driving on the radio and after that controlling it back off to save imperativeness. WSN radio advancement ought to capably transmit a banner and empower the system to come back to set down with inconsequential power use. This suggests the processor included ought to in like manner has the ability to wake, control up, and return to rest mode profitably. Chip designs for WSNs consolidate diminishing power use while keeping up or extending processor speed. Much like your radio choice, the power usage and taking care of speed trade-off is a key concern while picking a processor for WSNs. This makes the x86 outline a troublesome option for battery-filled devices.[5][10]

4.4 UrbanBox Network

UrbanBox network flow is shown below:

Figure 4.2: UrbanBox Network

Sensors are connected with devices(microcontroller, shield, battery and so on). The device is sending data through the cellular network while using MQTT protocol. After communicating with the platform using a specific API key, the data find its correct path to deliver the information. Afterward, data are saved in the cloud and transferred to the database. Some plots will show up on the dashboard.

32 4.4.1 MQTT Protocol

MQTT is the abbreviation of MQ Telemetry Transport. It is a publish/subscribe, exceedingly easy and lightweight informing protocol, proposed for obliged gadgets and low-data transmission, high-inertness or untrustworthy systems. The motivation behind the plan is to limit arrange data transmission and gadget asset prerequisites and ensuring the unwavering quality and some level of affirmation of conveyance. These principles in like manner wind up influencing the tradition to flawless of the creating ”machine-to-machine” (M2M) or ”Web of Things” universe of related contraptions, and for flexible applications where transmission limit and battery control are at a premium. [21]

Figure 4.3: MQTT Publish/Subscribe

MQTT Publish Subscribe Architecture. The MQTT messages are conveyed asynchronously (”push”) through publish-subscribe architecture. The MQTT convention works by trading a pro- gression of MQTT control bundles defined. Each control parcel has a particular reason and each piece in the bundle is precisely created to diminish the information transmitted over the system. A MQTT topology has a MQTT server and a MQTT customer. MQTT customer and server impart through various control parcels. The table underneath quickly depicts every one of these control bundles.[8]

33 Table 4.1: Control Packages in MQTT Protocol[27][18][33]

Control package Direction of flow Description CONNECT Client to Server Client request to connect to server CONNACK Server to Client Connect acknowledgment PUBLISH Both way Publish message PUBREC Both way Publish acknowledgment PUBREL Both way Publish received PUBCOMP Both way Publish release SUBSCRIBE Client to Server Client subscribe request SUBACK Server to Client Subscribe acknowledgment UNSUBSCRIBE Client to Server Unsubscribe request UNSUBACK Server to Client Unsubscribe acknowledgment PINGREQ Client to Server PING request PINGRESP Server to Client PING response DISCONNECT Client to Server Client is disconnecting

4.4.2 UrbanBox Platform

Since the most components of UrbanBox come from Adafruit company, Adafruit.io become our first choice as an online platform to receive and storage the data. Not only collecting and saving data, Adafruit.io also provides a pretty nice dashboard to show the visulization of the data streams which make it look more clear and organized. To use Adafruit.io as the platform, first of all, we need to be familiar with one concept ’Feeds’. Feeds are the core of the Adafruit IO system. Whatever metadata we sent from the sensors will be held by feeds. Feeds includes settings for the status of the data(public or private), and the basic description of the data. It will likewise save the sensor data values that generated from our devices. For UrbanBox project, I created several feeds for each different sensor measurements. Basically, every measurement has its own feed, and all the data we received from the sensors will go into feed and storage there for up to 30 days. Be aware of that, to make this data flow, we put the API keys before we making this communication. The API key is generated automatically in the website. Here is the current feeds list below: Notes: concentration is for the dust sensor. Let’s take a look at three different plots we have in the list(Temperature, humidity and dusts): From these three plots, we can see there are some habits in periods more exactly in days. We will talk abou some deeper data analysis later in chapter 6.

34 Figure 4.4: Adafruit IO Feeds List for UrbanBox

Figure 4.5: Temperature Plot in Adafruit IO

4.4.3 Data Size

In order to work with the data, we first need to know how much data we are dealing with. I downloaded one feed’s data as an example, which period is two weeks(from May 29, 2018 to June

35 Figure 4.6: Humidity Plot in Adafruit IO

11, 2018). Let’s check the properties of the downloaded CSV file. From the properties, we can see the size of this file is 628KB. And similar to this feed, we have 8 more feeds in total. Let’s do a calculation and see what’s the approximation size of full data during two weeks. Assume total data size is Dt, and single data size is St. So

Dt = 9 ∗ St (4.1)

St = 628KB (4.2)

Dt = 5652KB = 5.52MB (4.3)

36 Figure 4.7: Dust Plot in Adafruit IO

4.5 UrbanBox Software 4.5.1 Arduino IDE

The open-source Arduino Software (IDE) makes it simple to compose code and transfer it to the board. And it can be downloaded from Arduino Software home page. It keeps running on Windows, Mac OS X, and Linux. The earth is composed in Java and in light of Processing and other open-source programming. The coding part in Arduino is similar to Java and C/C++, so it will be even easier for you if you have some experience in programming with Java or C/C++. If you do not have any experience with programming before, you can also find many useful tutorials and people online.[13] This software can be utilized with any Arduino board. There a cup of things that need to be done before uploading your code. First, you will need to check that undet the ’Tools’ button, ’Board’ is setting the same as your microcontroller board. And ’Port’ should be the exact port you plugged the USB cable in. Then, in your Arduino Library you will need to have the documents

37 Figure 4.8: Temperature Data Size of Two Weeks before you use a specific library in your coding part. For example, if your code has the part like below: include ”DHT.h” then you will have to first have DHT.h library in your Arduino Software library. After doing these, you can simply upload your code and wait until it is done. You can check your results in Serial Monitor in the end.

38 Figure 4.9: Arduino IDE

39 CHAPTER 5

FUTURE WORK

In this chapter, we will some future work about this project and what we can do with the data we received from the sensors in the future.

5.1 Future Work

Although we have built a prototype for this project, it still has some space that we can make it better. Many ideas are not testing on the project yet since the lack of time and there are so many communication ways that we can explore. Also, based on different kinds of applications, various sensors and devices can be added to this design. Right now we are focusing on the monitoring system, but later on, we can develop other kinds of systems like home automation, traffic alert and so on.

5.1.1 Sensors and Shields

There are a bunch of sensors with a higher accuracy that we can use to replace some of the sensors we used right now. But the more accuracy usually means more expensive it is. Meanwhile, more sensors require a better capability of the microcontroller board and even ask for more power supply. Be aware of that almost all electronics need to run in a safe voltage/current level, it’s necessary to do some tests before adding new items to the design. What’s more, although we have a datasheet of the element(sensor, shield...), some basic tests are needed. For instance, when the new items have arrived, we need to first check if it has enough pins and whether it’s good enough to run as it says in the datasheet. There are also other communication shields that we can use, like WiFi, ZigBee, Ethernet etc. Depending on what environment we want to put the UrbanBox on, shields could be different and adjustable. If we would like to make a building monitoring system, Ethernet cable or WiFi will be a better choice for the design instead of using the cellular network. Or if it is used in an industry environment, properly ZigBee is good to make the communication. Before choosing the

40 communication way, we need to figure out what we are going to do or what is our goal with the design.

5.1.2 Mesh Network

In the future, we are going to build more UrbanBox nodes in the city of Tallahassee. There is one important thing that we need to pay attention to: how to make these nodes in different locations talk to each other and send data to the same cloud. First, in order to make sure these nodes can talk to each other, we need to build a mesh network among these nodes. Then we need to have a gateway to gather all the information together. After that, we can send the data through the gateway to the cloud online. ZigBee technology may be considered as the gateway.

5.1.3 Soldering and PCB Design

For now, our UrbanBox is still using jumper wires and breadboard to make the hardware connections: sensors to the microcontroller board, microcontroller board to shield and even battery to shield. It’s not a good way to make a complete prototype using these since it’s not stable and the wires are easy to drop by some small mistakes. To have a better wires/pins connection and a stable circuit board, it is necessary to solder the wires and pins together. What’s more, if we make a printed circuit board (PCB), it will help to save a lot of space in the box and we can put more pieces when it’s needed. Besides, a well-designed PCB will show the full design in a smart and understandable way to the users.

5.1.4 Backup Power Supply

In case when power goes off, we need to have backup plan when bad things happens. There is one option for short term power shortage: we use a high capacity power bank as the emergency power supply when can afford around 5 hours after testing. Another option is using solar panels to generate electrisicy and charge the UrbanBox which may work for a long time. Since this project is a low-cost project, most of the components in this project requires a 5V voltage and around 0.2A current, so the power from solar panels is good enough to keep UrbanBox running for several days. Also, once we finish the PCB design of this project, the power consumption will reduce because there are some power losses in the long wires we are using right now.

41 5.1.5 Software and Platform

When we talk about the software part in this project, we are not just talking about the program software Arduino, but also considering the platform we used for storing data in the cloud and plotting data in the dashboard. We are using Adafruit.io as our platform right now, but there is some limitation on this platform. Adafruit.io can only support 10 feeds at most, which means we can only use up to 10 different type of sensors. And the storage is only saved for 30 days, so we have to find a way to store the data in another database system. In the future, a better platform with greater capability of holding more sensors and saving data for a long time, so we don’t have to transfer the data every 30 days and this will help a lot on saving either time and human resources.

5.1.6 Application

Currently, we are working on the monitoring system of the city, but this is not our final goal. There is some more work we want to achieve in the future, for example, our team is also working on microPMU, which has a high-resolution measurement on the power grids, how can we combine the data from the environmental aspect and the electrical aspect will be the future working area. Since we have the camera in our design, so another proper approach will be how can we add the transportation information to the data analysis procedures. But when we deal with the camera, we need to make sure we will obey the privacy policy in Florida and do not keep the vehicle images. Especially, we should avoid taking the plates of the vehicles or the faces of the drivers.

5.1.7 Data Analytics

After receiving all the sensor data, we need to think about how to make use of the data. Urban- Box project detects various aspects of the environment of the city, including weather conditions, noise, pedestrians, air pollutions and car mobility. We can apply a multiple linear regression model on our dataset to find relationships between different urban environment parameters. For example, using temperature, and the number of cars to predict air quality. Also, we are studying the impact of weather condition and traffic on electricity consumption. UrbanBox Data can later help us in that study.

42 APPENDIX A

CODING PART

A.1 Arduino Code include ¡AdafruitSleepyDog.h > include ¡SoftwareSerial.h¿ include ”AdafruitF ONA.h” include ”AdafruitM QT T.h” include ”AdafruitM QT TF ONA.h” include ”DHT.h” const int DHTPin = 6; DHT dht(DHTPin, DHTTYPE); const int sensorPin = A0; const int AnalogPin=A1; const int soundPin=A2; define FONARX2 define FONAT X3 define FONARST 4 char replybuffer[255];

SoftwareSerial fonaSS = SoftwareSerial(FONAT X,FONARX); SoftwareSerial *fonaSerial = fonaSS;

AdafruitF ONAfona = AdafruitF ONA(FONARST ); define FONAAPN”wholesale” define FONAU SERNAME”T ingData” define FONAP ASSW ORD”” define AIOSERVER”io.adafruit.com” define AIOSERVERPORT 1883 define AIOU SERNAME”CAP SF SU”

43 define AIOK EY ”48bdf58833dd462a99a646dc4be95ad8”

AdafruitM QT TF ONAmqtt(fona, AIOSERV ER, AIOSERVERPORT,

AIOU SERNAME, AIOK EY ); define halt(s) Serial.println(F( s )); while(1); boolean FONAconnect(const F lashStringHelper∗apn, const lashStringHelper∗username,const F F lashStringHelper∗password);

AdafruitM QT TP ublishphotocell =

AdafruitM QT TP ublish(mqtt, AIOU SERNAME”/feeds/photocell”);

AdafruitM QT TP ublishGas =

AdafruitM QT TP ublish(mqtt, AIOU SERNAME”/feeds/Gas”);

AdafruitM QT TP ublishsound =

AdafruitM QT TP ublish(mqtt, AIOU SERNAME”/feeds/sound”);

AdafruitM QT TP ublishtemperature =

AdafruitM QT TP ublish(mqtt, AIOU SERNAME”/feeds/temperature”);

AdafruitM QT TP ublishhumidity =

AdafruitM QT TP ublish(mqtt, AIOU SERNAME”/feeds/humidity”);

AdafruitM QT TSubscribeonoffbutton =

AdafruitM QT TSubscribe(mqtt, AIOU SERNAME”/feeds/onoff”);

AdafruitM QT TP ublishlatitude =

AdafruitM QT TP ublish(mqtt, AIOU SERNAME”/feeds/latitude”);

AdafruitM QT TP ublishlongitude =

AdafruitM QT TP ublish(mqtt, AIOU SERNAME”/feeds/longitude”);

AdafruitM QT TP ublishconcentration =

AdafruitM QT TP ublish(mqtt, AIOU SERNAME”/feeds/concentration”); uint8ttxfailures = 0; define MAXTXFAILURES 3 int pin = 8; unsigned long duration; unsigned long starttime; unsigned long sampletimems = 2000; //sampe30snbsp;;

44 unsigned long lowpulseoccupancy = 0; float ratio = 0; uint8treadline(char ∗ buff, uint8tmaxbuff, uint16ttimeout = 0); uint8ttype; void setup() while (!Serial); Serial.begin(115200); Serial.println(F(”Adafruit FONA MQTT demo”)); fonaSerial-¿begin(4800); if (! fona.begin(*fonaSerial)) Serial.println(”Couldn’t find FONA”); while (1); type = fona.type(); Serial.println(”FONA is OK”); Serial.print(”Found ”); mqtt.subscribe(onoffbutton); Watchdog.reset(); delay(5000); Watchdog.reset(); while (! FONAconnect(F(FONAAPN),F (FONAU SERNAME),F (FONAP ASSW ORD))) Serial.println(”Retrying FONA”); Serial.println(F(”Connected to Cellular!”)); Watchdog.reset(); delay(5000); Watchdog.reset(); pinMode(8,INPUT); starttime = millis(); void loop() Watchdog.reset();

MQTTconnect();

45 if (!fona.enableGPS(true)) Serial.println(”Failed to turn on”); char gpsdata[120]; fona.getGPS(0, gpsdata, 120); float x; x=analogRead(sensorPin); Watchdog.reset(); Serial.print(F(”photocell val ”)); Serial.print(x); Serial.print(”...”); if (! photocell.publish(x)) Serial.println(F(”Failed”)); txfailures++; else Serial.println(F(”OK!”)); txfailures = 0; float t; t= (float) dht.readTemperature(); Watchdog.reset(); Serial.print(F(”Temperature val ”)); Serial.print(t); Serial.print(”...”); if (! temperature.publish(t)) Serial.println(F(”Failed”)); txfailures++; else Serial.println(F(”OK!”)); txfailures = 0; float h; h= (float) dht.readHumidity();

46 Watchdog.reset(); Serial.print(F(”Humidity val ”)); Serial.print(h); Serial.print(”...”); if (! humidity.publish(h)) Serial.println(F(”Failed”)); txfailures++; else Serial.println(F(”OK!”)); txfailures = 0; //Reading latitude double la; String lati = getLatitudeGPS(gpsdata); la= lati.toDouble(); Watchdog.reset(); // Now we can publish stuff! Serial.print(F(”Analog val ”)); Serial.print(la); Serial.print(”...”); if (! latitude.publish(la)) Serial.println(F(”Failed”)); txfailures++; else Serial.println(F(”OK!”)); txfailures = 0; //Reading longitude double lo; String longi = getLongitudeGPS(gpsdata); lo= longi.toDouble(); Watchdog.reset();

47 // Now we can publish stuff! Serial.print(F(”Analog val ”)); Serial.print(lo); Serial.print(”...”); if (! longitude.publish(lo)) Serial.println(F(”Failed”)); txfailures++; else Serial.println(F(”OK!”)); txfailures = 0; duration = pulseIn(pin, LOW); lowpulseoccupancy = lowpulseoccupancy+duration; if ((millis()-starttime) ¿= sampletimems)//ifthesampeltime == 30s ratio = lowpulseoccupancy/(sampletimems ∗ 10.0); //Integerpercentage0 = gt; 100 float concen = 1.1*pow(ratio,3)-3.8*pow(ratio,2)+520*ratio+0.62; // using spec sheet curve Serial.print(F(”Analog val ”)); Serial.print(concen); Serial.print(”...”); if (! concentration.publish(concen)) Serial.println(F(”Failed”)); txfailures++; else Serial.println(F(”OK!”)); txfailures = 0; lowpulseoccupancy = 0; starttime = millis(); Watchdog.reset(); // this is our ’wait for incoming subscription packets’ busy subloop

AdafruitM QT TSubscribe ∗ subscription; while ((subscription = mqtt.readSubscription(5000)))

48 if (subscription == onoffbutton) Serial.print(F(”Got: ”)); Serial.println((char *)onoffbutton.lastread); if(! mqtt.ping()) Serial.println(F(”MQTT Ping failed.”)); delay(100000); void MQTTconnect() int8tret; // Stop if already connected. if (mqtt.connected()) return; Serial.print(”Connecting to MQTT... ”); while ((ret = mqtt.connect()) != 0) Serial.println(mqtt.connectErrorString(ret)); Serial.println(”Retrying MQTT connection in 5 seconds...”); mqtt.disconnect(); delay(5000); // wait 5 seconds Serial.println(”MQTT Connected!”); //Read latitude and longitude from the GPS String getLatitudeGPS(String data) // Find commas int commaIndex = data.indexOf(’,’); int secondCommaIndex = data.indexOf(’,’, commaIndex+1); int thirdCommaIndex = data.indexOf(’,’, secondCommaIndex+1); int fourthCommaIndex = data.indexOf(’,’,thirdCommaIndex+1); int fifthCommaIndex = data.indexOf(’,’, fourthCommaIndex+1); return data.substring(thirdCommaIndex+1, fourthCommaIndex); String getLongitudeGPS(String data) // Find commas int commaIndex = data.indexOf(’,’); int secondCommaIndex = data.indexOf(’,’, commaIndex+1);

49 int thirdCommaIndex = data.indexOf(’,’, secondCommaIndex+1); int fourthCommaIndex = data.indexOf(’,’,thirdCommaIndex+1); int fifthCommaIndex = data.indexOf(’,’, fourthCommaIndex+1); return data.substring(fourthCommaIndex+1, fifthCommaIndex);

A.2 Arduino-Fonahelper include ¡AdafruitSleepyDog.h > include ¡SoftwareSerial.h¿ include ”AdafruitF ONA.h” define halt(s) Serial.println(F( s )); while(1); extern AdafruitF ONAfona; extern SoftwareSerial fonaSS; boolean FONAconnect(const lashStringHelper∗apn,const F F lashStringHelper∗username, constF lashStringHelper∗password)W atchdog.reset(); Serial.println(F(”Initializing FONA....(May take 3 seconds)”)); fonaSS.begin(4800); // if you’re using software serial if (! fona.begin(fonaSS)) // can also try fona.begin(Serial1) Serial.println(F(”Couldn’t find FONA”)); return false; fonaSS.println(”AT+CMEE=2”); Serial.println(F(”FONA is OK”)); Watchdog.reset(); Serial.println(F(”Checking for network...”)); while (fona.getNetworkStatus() != 1) delay(500); Watchdog.reset(); delay(5000); // wait a few seconds to stabilize connection Watchdog.reset(); fona.setGPRSNetworkSettings(apn, username, password); Serial.println(F(”Disabling GPRS”));

50 fona.enableGPRS(false); Watchdog.reset(); delay(5000); // wait a few seconds to stabilize connection Watchdog.reset(); Serial.println(F(”Enabling GPRS”)); if (!fona.enableGPRS(true)) Serial.println(F(”Failed to turn GPRS on”)); return false; Watchdog.reset(); return true;

51 BIBLIOGRAPHY

[1] arduino.ru

[2] arrayofthings.github.io

[3] Liu, Xiaorui. ”Open-source low-cost internet of things platform for buildings”, The Florida State University, 2018

[4] compnetworking.about.com

[5] Uday Kumar Rai, Knanika Sharma. ”Maximum likelihood estimation based clustering al- gorithmn on wireless sensor network-A review”, 2017 International Conference on Energy, Communication, Data Analytics and Soft Computing(ICECDS), 2017

[6] store.nerokas.co.ke

[7] www.techmemicro.com

[8] annals-csis.org

[9] Mishra, Ram Prakash. ”Development and Implementation of Wireless Sensor Networks for Measuring Water Quality.”, Lamar University - Beaumont, 2018

[10] Hwa-Young Jeong. ”A priority for WSN in ubiquitous environment: multimedia security requirements”, Multimedia Tools and Applications, 2016

[11] Franco, Fernand Diaz. ”Low Voltage Ride-Through for Photovoltaic Systems Using Finite Control-Set Model Predictive Control.”, The Florida State University, 2018

[12] David Frederick Ross. ”Distribution Planning and Control”, Springer Nature, 2015

[13] ”Do-it-yourself: Virtual Telepresence Robot Using Raspberry Pi.”, Electronics For You

[14] M. Abdul Kader Riyaz, S. ArunJeyakumar, M. Abdul Hameed Sharik, A. Tamilarasi. ”Graphene coated LED based automatic street lighting system using Arduino microcon- troller”, 2017 IEEE International Conference on Power, Control, Signals and Instrumentation Engineering(ICPCSI), 2017

[15] diginole.lib.fsu.edu

[16] forum.mysensors.org

52 [17] forummarseille.com

[18] docs.oasis-open.org

[19] Pradip Kumar Sharma, Mu-Yen Chen, Jong Hyuk Park. ”A software Defined Fog Node Based Distributed Blockchain Cloud Architecture for IoT”, IEEE Access, 2018

[20] www.seeedstudio.com

[21] Wimmler, Christian. ”Towards Electrical Isolated Systems Based on 100 percent Renewables.”, Universidade do Porto (Portugal), 2018 [22] ibms03.cityu.edu.hk

[23] www.howmuchsnow.com

[24] www.coursehero.com

[25] Vishal Deep, Tarek Elarabi. ”Efficent IEEE 802.15.4 ZigBee Standard hardware design for IoT applications”, 2017 International Conference on Signals and Systems(ICSigSys), 2017

[26] www.insticc.org

[27] media.jmesnil.net

[28] store.arduino.cc

[29] www.slideshare.net

[30] www.houseofhiranandani.com

[31] www.reddit.com

[32] Yoko Ishino, Yan Jin. ”Estimate design intent: a multiple genetic programming and multivari- ate analysis based approach”, Advanced Engineering Informatics, 2002

[33] Pietro Colombo, Elena Ferrari. ”Access Control Enforcement within MQTT-based Internet of Things Ecosystems”, Proceedings of the 23nd ACM on symposium on Access Control Models and Technologies - SACMAT’ 18, 2018

[34] www.coolcomponents.co.uk

[35] ”Smart Secure Systems - IoT and Analytics Perpective”, Springer Nature, 2018

[36] weblab.deusto.es

53 [37] Pyne, Moinak. ”Design and evaluation of a microgrid for PEV charging with flexible distribu- tion of energy sources and storage”, Proquest, 2016

[38] www. raspbian.info

[39] Hana Kopackova, Petra Libalova. ”Smart city concept as socio-technical system”, 2017 Inter- national Conference on Information and Digital Technologies(IDT), 2017

[40] Tarek Elarabi, Vishal Deep, Chashamdeep Kaur Rai. ”Design and simulation of state-of- art ZigBee transmitter for IoT wireless devices”, 2015 International Symposium on Signal Processing and Information Technology(ISSPIT), 2015

[41] publications.nscl.msu.edu

[42] Brooks, Hannah. ”Predicting physical activity in former high school athletes”, Proquest, 2013

[43] ”Technologies for E-Learning and Digital Entertainment”, Springer Nature, 2007

[44] upcommons.upc.edu

[45] Mishra, Subhendu. ”Design and Analysis of a Novel High Temperature Superconducting Synchronous Machine”, The Florida State University, 2017

[46] Abhishek Kumar, Gaurav Chattree, Sasikumar Periyasamy. ”Smart Healthcare Monitoring System”, Wireless Personal Communications, 2018

[47] Alhamdawi, Nashmiah. ”A Dynamic Scalling Methdology for Improving Performance of Big Data System”, South Dakota State University, 2018

54 BIOGRAPHICAL SKETCH

Before entering Florida State University, I got my bachelor degree in Anhui University of Technol- ogy, China. Four years of undergraduate studies had me well trained in a wide range of disciplines, once majoring in Electrical Engineering, I got devoted and dedicated to my major courses. I be- came very dedicated to the study of Electrical Engineering right after declaring it as my major. EE as an engineering subject is very difficult sometimes. Whenever I encounter some obstacles, I always puzzle the questions carefully endeavoring to solve it by myself. The process of challenging myself is also the most intriguing phase. And once I get it, the knowledge will stay with me forever because the intuition and mechanism under that knowledge is the most critical foundation. The long-term persistence endows me with solid professional knowledge, special perspective as well as enhanced expertise. And my outstanding academic performance in my undergrad encouraged me to pursue an ad- vanced degree. With a concentration on mathematics, communication and computer science I studied a variety of courses, among which were Higher Mathematics, Probability Statistics, and Stochastic Process, Theories of Signal and Information, High-Frequency Circuits and Principles of Modern Communications Systems, Computer Principle and other courses in the Electronic Tech- nology fields. But the more I am educated, the deeper I realize that this is the field I want to explore more. As for my future, I am determined to devote to Electrical Engineering, whether it is in academia or industry. It’s been almost three years studying in FSU, and it’s a wonderful experience to work with talented and skillful teachers and students here.

55