A Smart City Application: Waste Collection System with LoRaWAN Network for Providing Green Environment, Cost Effective and Low Power Consumption Solutions.

The trend towards cities and urbanization, which increases the number of people living in urban areas, makes it necessary for local authorities to be more e�cient and effective in providing services and natural resources and to develop some strategies for a sustainable environment. The more effective use of resources, increasing awareness of sustainable environment, climate con�dence and motivation to make cities more livable is a new concept Smart City. In this study, the proposed system supports the garbage collection of the city government and works with low budget, low energy and free radio frequencies. The IoT (Internet of Things) sensor node is assembled, and the network is set up based on LoraWan protocol to connect it to the sample garbage can and collect data. Instant data collection by this network through the Internet of Things approaches and designed using this collected data. To establish an ideal system for smart garbage collection for cities and support sustainability in cities by integrating it with city government information systems. The data received from the sensor nodes and the e�ciency of the system were demonstrated for the local governments. The primary outcome of this research is how to build a practical smart city application with minimum resources and support local authorities in their daily operation. Moreover, another objective is to investigate how low-power wan communication network in 868Mhz frequency works in İstanbul-TURKEY and the best alternative for cellular networks for excellent communication in smart cities.


Introduction
The main objective in this study is to investigate the bene ts of building a solid waste collection system based on IoT.IoT device will be based on LoRaWAN network which has many advantages in many aspects.With this study, extensive networks are created thanks to LoRaWAN technology which is not yet used in Turkey.In this study, the problem is studied from different perspectives.These are environmental issues, sustainability of cities, heavy dependence on fossil fuels for energy consumption in Turkey.
Before entering into the details of the study, the problems will be placed in the eld in which the study would be of use.To this end, attention has been directed chie y to the rate of growth of the population living in cities.The rapid population growth requires the use of IoT to meet the demands of the population.On the other hand, the case of Turkey, its dependence on fossil fuels, which are currently preferred in disposal vehicles, as a country and its economic consequences are studied.Thirdly, in order to support the aim of the study, the increase of emission repairs over the years and its negative impact on the environment have been mentioned.At this point, emissions are mentioned to be reduced depending on the use of IoT.Some of the issues such as effective management of natural resources, reducing environmental problems, supporting sustainable cities, cheaper solutions to urban problems, and reducing energy dependency serve as the source of motivation.When the details of routine garbage collection are examined, it becomes clear that there is a xed collection route and period.This is no longer an effective way in today's world.Another solution is the low cost, emissions, need for fossil fuels and manpower required.Moreover, IoT-assisted garbage collection provides a service that protects public safety, public health, and environmental quality.
In this model, It is expected to reduce labor-intensive activities frequency.Furthermore, the proposed system that creates an instant alert for garbage bin load.A dynamic system that response based on the data collected from the eld is built.This will change scheduled collection service, decrease the need for more labor, and dramatically reduce service costs.In this model, the system is provided with LoRaWAN, which is an LPWAN protocol.LPWAN is more e cient in many ways from GSM-based solutions such as deployment cost and license.Based on Statistic's expectation in Fig. 1.1, the Number of LPWAN connections by technology worldwide from 2017 to 2023 will be dramatically increased.This is another indicator that LPWAN technologies will be more attractive.
In many IoT projects, regardless of the type of connection, the power requirement is always the main subject.Power consumption of an IoT product is a primer identi er; rather, it is suitable or not.The following Table 1.1 points out that LoraWan is thirty times more e cient in terms of power consumption for sleep current [2].

Internet Of Things
Kevin Ashton, who is a technology pioneer, called IoT term rstly in 1999.He described a system that the devices(objects) in this system connected through the Internet [3].Connected sensors and devices (things) through the Internet mean the Internet of Things.IoT applications have been used increasingly for past decades, such as home automation (smart home), industrial process control, SCADA systems, waste management, measuring meters [4].There are two fundamentals of IoT.These are remote connectivity itself and the bene ts of digitalized products and services for business.The IoT is an essential subject, and demand for it increases dramatically.Opportunities such as controlling devices are offering plenty of solutions for both people and business [5].Today, people live in coronavirus pandemic days and look for new devices to touch infected patients remotely and control the devices that support intensive care patients.This pandemic teaches people, companies, and governments to more interested in medical technologies also.IoT applications will improve business and quality of life.IoT will change the way people live and work.
IoT offers many applications and convenient for various sectors.In health care, doctors can remotely control the patient's condition and take necessary action from afar.Furthermore, for the manufacturing sector, IoT applications increase productivity.IoT makes precise tracking of the product manufacturing chain.It is also easy to measure the carbon emission for a plant.This may help to take action to reduce this emission in case of any regulation violation.[6].In most applications, IoT infrastructure is divided into some stages.These stages are listed brie y, Application Layer, Network Layer, and Edge Layer.These three-layered infrastructures are an accepted model usually in Edge Layer, where data is collected via sensors and devices.The network layer is the communication part that is necessary to post data to the endpoint (edge layer).The application layer is the last part and, in this layer, provide service and many applications to the users [7].

Smart Cities And Sustainability
The expectation in UN World Urbanization Prospects is renewed regularly, and estimating %70 of the world's total population will live in urban areas.The rising population and effective resource management smart city have become mandatory objects for cities [8].An evolving solution to deal with this scenario is the convergence of information and communication technologies by implementing the smart cities' concept.The smart cities concept is the pioneering solution for supplying higher living standards.To provide such higher living standards, coverage of Information and Communication technologies must be extended through every point of a city [9].
From the historical perspective, there are some different indicators when the smart city concept was rst used.
In the late 1990s, the main parts of the smart city concept, city, and ICT, started to discuss academic literature.
In 1997, more than 2000 cities had web pages (www), and today this is accepted as a sort of the rst example of the smart city concept [10].The smart city concept emerged from the development of ICT [11].Some other best practices represent milestones for the smart city concept.Some of them are Amsterdam, Copenhagen, Seoul, and New York City [12].
Global Data Thematic Research published research and listed the signi cant milestones in the smart city concept [13].According to the research rst evidence of the smart city, the concept was the big data project for Los Angeles in 1974.
The development of the smart city concept requires some other developments in areas such as ICT, IoT, and sensor networks.When All these parts are associated, the ideal system would be in service for people.This whole extensive system can be named as a cluster of some hardware and software.This cluster works intensively to understand the needs of people and respond in time.Not only people or resident of a city, but this cluster also support industries, city management, and government.[14].
ISO (International Standardization Organization) published a new standard in 2018 (ISO 37120:2018 Sustainable cities and communities-Indicators for city services and quality of life).This guidance standard will be leading the future smart city projects and support the decision-making process.Brie y standard suggest that; Cities need indicators to measure their performance.Indicators and test methods mentioned in this standard are for supporting city management to; Measure the performance of the city service and quality of life.
Compare measurements and create values based on these measurements.
Provide more data that help policymakers in the decision-making process.
Indicators included in ISO37120 are listed in this standard [15].

Wireless Transmission For Iot
Internet of things systems requires the transmission layer.Some alternative communication technologies are in stock for IoT systems.Some of them LoRaWan, SigFox, NB-IoT, 5G, wi-, ZigBee.One of them is LoraWan, and it offers many features for low-cost and long-range communications.Most IoT projects deploy LoraWan into their network [4].In this paper, a solution which is LoraWan based will be proposed.5. Essential Problems Should Be Addressed For Turkey: Sustainability, Greenhouse Gas Emission And Energy Dependency Rate.
Year by year, people intend to live in cities for better living conditions [18].United Nations expectation is that the %68 population will live in urban areas by 2050, and It means that the population in urban areas will increase from %55 to %68.United Nations 2050 expectation also shows that 2.5 billion people will be added to urban areas population, and a signi cant part of this increase will be taking place in Asia and Africa [19].
It also should be considered that people can easily nd a job in cities compared to job opportunities in rural areas.Furthermore, many jobs require sitting on the desk all day.On the contrary, people should do much more muscular activities while working in rural areas.Not only more job availability make cites more attractive.People can reach high-speed Internet, shopping centers, more public transportation facilities, and food in cities [18].These are the signi cant factors supporting the increasing trend of living in cities and the growing population.
Turkey has been experiencing environmental pressures due to population growth, industrialisation and rapid urbanisation.The following Table 2.1 below shows that the number of people living in rural and urban areas based on the years.It is not hard to consider that both population and the number of people living in urban areas increased dramatically.The number shown on the table that millions of people live in huge cities because of this, many chaotic problems occur.Air pollutions, management of cities, and usage of natural resources are some of them.Another energy resource is electricity that mainly produced by using fossil fuels, coal, and natural gas.In this case, there is more waste heat, so producing energy from fossil fuels is not an e cient way.Besides this e ciency problem, fossil fuels also release much more pollution into the air; this creates health issues for people [21].
Operation cost is expected to shrinkage dramatically based on new approach which decreases the need of labor force, operation equipment's (tracks) No need for data subscription or licensing cost to send the data.
The population of Istanbul, Turkey's largest city, is larger than that of 131 countries in the world, according to the United Nations Population Fund [25].A survey applied to Istanbul will be an insightful delivery for upcoming application and research.
At the time of the on-site research, there was no signi cant 868 Mhz LoraWan application in Istanbul or Turkey.The research results will show us that Lora devices can operate on 868 Mhz in Turkey.
Some computational metrics are examined to prove that reducing the waste collection load results in less demand for labor, fossil energy, and operating equipment, and avoids more carbon emissions.
The Internet of things infrastructure will be integrated into the municipality's current waste management service and anticipate nding solutions for the problems listed above that conventional waste collection The block diagram shown in the following Fig. 6.1 represents the physical links that connect components within the system.

Software and Programing
Arduino Uno Arduino Software, Mac OSX version 1.8.9, used for programming.The Arduino sketch uploaded to the Arduino is accessible from "https://github.com/eaktay/LoraWan.git".Details and essential points that should be considered to build a proper node in this code will be given in the next sections.To make this code working on the hardware above, many tests are done.When the literature is investigated, there was no similar design, so all circuits were perpetually tested for days and made in Turkey.The sample code is from the GitHub library [31], and it is con gured based on needs.It is shown in the following pictures that all parts are assembled nal stage of the node and the primary process of assembling.In Picture 6.After all necessary assembling processes are completed, all parts of the node implemented into the box, as shown in picture 6.5.
After the assembly of the node was completed, it was connected to the trash can for testing.In this scenario, an ordinary trash can on the street was used.It was meeting the standard that is European Committee for Standardization EN 840-2.In picture 6.6, this attachment is shown.The main purpose of this implementation is to keep the IoT node healthy during the opening and closing times of the damper.Another reason for this setup was to absorb the shock of closing the ap of the container.The ap weighs too much, which can speed up the closing motion and destroy the node, as shown in Fig. 6.7, which attaches the node to the top of the ap.
The reason for that to keep the node clean and make the accuracy more.Picture 6.8, 6.9, and 6.10 show the whole stand by bin with the node's implementation.QR code is added for providing more information on the web.

Management of the Operation and Hardening the System
After node is deployed in eld, the system is started, and data is collected from the nodes.In the previous it was mentioned that the code is uploaded to the Arduino Uno board.In this code, many indicators and parameters are con gured.First of all, the distance is 30 cm for the ultrasonic sensor distance data read from the node.This means that when the city residents put the solid waste in the bin and the height of this waste approaches the top, less than 30 cm, the node sends a message (data) and informs the central system that the bin will soon be full.How this works technically, ultrasonic sensors send ultrasound into the bin, and when the sound wave is re ected, the ultrasonic sensor measures the distance and sends this data to the card Arduino Uno.At this point, the process can be referred to as the edge layer.
The next step is the transmission phase, where the Arduino board sends the data to the central database.The Dragino gateway is introduced in the previous sections.The gateway receives the data from the node and transmits it to the next phase.In this project, The Things Network infrastructure is used to collect, store and process data from the eld.The Things Network is an open-source initiative that operates an open Internet of Things infrastructure supported by a global ecosystem of thousands of developers, IT integrators, hardware manufacturers, universities, and governments.To achieve data transfer from the endpoint to the central database, all devices must be con gured.It is used for the node side, and some parameters that Arduino uses to forward data are inserted.
First, the gateway is registered on the TTN network.The gateway is con gured through its GUI and the parameters are set to forward data to the TTN network.Once the gateway receives data from the node, it forwards all the data to the TTN network servers.While con guring the Arduino, the keys are inserted in the Arduino code such as access key, gateway ID, gateway key APPLICATION EUIS, Activation Method, Device EUI, Application EUI, Device Address, Network Session Key, App Session Key, which TTN provides.For all these settings, the following website was visited.Some of the screenshots of TNN web pages are shown below.
https://account.thethingsnetwork.org/users/login Picture 6.12 TTN registration page After logging into the TTN website, Picture 6.12 appears.On this page, a gateway must rst be set up.In this scenario, the dragino gateway is registered in the TTN.Via the maintenance interface of the gateway, it is not di cult to set up a gateway for communication with TTN.Once the gateway is registered in the TTN, the page shown in Picture 6.13 displays details of the gateway registration.
Picture 6.13 Registered Gateway Pro le When the gateway is registered, the infrastructure is also provided.Thanks to the communication between the gateway and TTN, it will be convenient to send data from the endpoint node to the central database of TTN.Picture 6.14 is the data monitoring screen.When the Arduino board collects data, it sends it to the TTN, and the data ow would be monitored on the following screen.
Picture 6.14 QR Code for More Information TTN allows the developer to integrate their system with TTN systems.In this application, the integration is set up to post data to the webserver to monitor it on the website.Picture 6.15 is the page of the HTTP integration con guration.
Picture 6.15 TTN HTTP Integration Con guration for Data Posting All the information that is needed should be de ned on this page.In this con guration on the node, gateway, and TTN, data is collected from the eld.Data does not mean everything independently.An alarm should be set and an ideal work ow for waste collection should be designed.When the data shows up on the TTN, it is forwarded to the web server via HTTP integration.TTN provides such functions.On the web server the location of the bin is stored in advance.
For regular garbage collection, the best route is created and the need to nd empty bins is avoided.To facilitate this process, an app is being developed for Firebase's IOS platform.Firebase is an application development platform from Google that provides powerful tools for creating a mobile app.Thanks to this application, the operation of the work would be easily done by using IOS map algorithm and either setting the location of the bin or creating the best route will not be a headache.The sample video on using the IOS app uploaded to the cloud is available at the following link https://www.dropbox.com/s/tjv821fra2qs53l/da5ba8fd-a392-4c47-b55b-e5178dc74bfb.mp4?dl=0 The following screenshots are the samples from application progress.
Picture 6.16 Login Screen Picture 6.17 New Node Adding Picture 6.18 Node List Picture 6.19 Route Planning When the IOS application is opened, the screen in picture 6.16 appears.After describing the credentials, the application searches for the location to add a new note, as shown in picture 6.17.Since the infrastructure of GPS is used, the location data is completely correct.In the following steps, meaningful information is added to determine the node, as shown in picture 6.18.The node identity information is inserted into the Arduino Uno code and uploaded to the node.When the node pushes data to the TTN, the load is realized in the node, then the collection process is queued based on the best route.The value of distance is set to 30 cm by default.
When the height of the garbage load reaches this value, the node sends data to the TTN because the node is full.More frequent reading and sending to the TTN network consume more energy, so the frequency is four hours a day.Different districts in Besiktas and Arnavutköy were selected to provide data for the system.For this purpose, a site visit is planned with the o cials of Besiktas and Arnavutköy Municipalities.Thanks to this visit, it is possible to estimate how this system would e ciently manage some cost and environmental issues.
The location of the bin and its load are recorded, and this data is then posted to a map, shown in picture 6.18.
When the IoT node is implemented at all garbage bins, these green bins will no longer need to be hit, saving money and reducing air pollution.All user service vehicles that serve the purpose of garbage collection use fossil oil, and as mentioned in the previous section, this causes air pollution.
This study shows that the LoraWan technology and protocol are applicable in Turkey.It is achieved to mount a pattern node and point-to-point on LPWAN network.Collecting data from the eld is achievable and this supports the idea that if the same nodes are implemented in a wide area, this will reduce the expenditure on the traditional garbage collection method.When all the information from the eld visits, observations and the proposed IoT system are taken into account, the proposed model will de nitely reduce the cost of waste management by at least 40-45%.This rate is estimated by operating costs such as fuel, employees and trucks.
Another fact is that if this new garbage collection system is used by most communities in Turkey, this will also maintain a clean environment.In addition, it is estimated that the initial savings of 40-45% in operation will result in less need for fossil energy.This will be an opportunity to reduce dependencies and positively affect the foreign trade de cit.

Picture 6.20 Sample Waste Collection Operation Map
Figure In picture 6.20 shows the study area.This area is called Gayrettepe.The eld was visited with municipality o cials to understand how the system for garbage collection works.During this visit, it was noted that some of the garbage bins were not full and should not be included in the collection queue.The number of full and empty bins provides an indication of the extent to which the proposed system creates economic and sustainable value for the environment.
One of the main purposes of the eld visits is to understand the operational process of garbage collection and to nd the weak points of the current garbage collection system.This eld visit provided valuable information such as where the sensor node should be placed, which bin locations should not be visited, and how to develop a well-designed garbage collection system.In some cases, the garbage collection system should be triggered due to environmental issues.That is, if some garbage bins are full before the regular time, these bins should be emptied to maintain a healthy and pleasant environment for city residents.
Authentication, trust, and integrity of the communication channel between IoT devices are the critical security parameters that modern solutions deal with.Although the IoT is up to date, it lacks the support of powerful devices and is not compatible enough to deal with the increasing heterogeneous entities [32].To harden the entire IOT infrastructure, some security parameters are mandatory.To make the entire system more secure, there are several issues that need to be considered during implementation and also during operation.Some of them are: PKI/digital certi cates, network security, API security, network access control, segmentation, security gateways, patch management, continuous software updates, training and consumer education.

Conclusions, Implications, And Future Directions
This article proposes a LoraWan-supported smart city waste management.In this article, the problems are clearly expressed.These are environmental problems, population, lack of ICT based systems, cost of operation.In this article, before offering the solution, the current situation in Turkey is considered in terms of greenhouse gas emission, cost of fossil fuel import which affects the country's budget, and cost of waste collection for local authorities.Several important issues are examined; the proposed solution will address all of them.Based on the eld visits and observations, traditional trash collection is no longer satisfactory.Given the questions: why does the garbage truck go to all the garbage cans that are not full?Why do garbage trucks have to travel more miles for daily garbage collection?Why is more fossil fuel needed to operate?Why are more people hired to handle the daily trash pickup?In order to create a sustainable environment, reduce the fossil fuel import budget and reduce the expenditure on garbage collection, a new approach is developed.
In this study, LoraWan wireless technology is the rst application in Turkey.The design of nodes, network con guration, application-level management and operational process are properly regulated.Instead of the current licensed spectrum and services, an unlicensed free ISM band is proposed.The innovative parts of this Figures Figure 1.1 LPWAN Connections by Technology Worldwide From 2017 to 2023, [1].

Table 1 .
The LoRa Alliance is an open, nonpro t association that has grown to more than 500 members since its inception in March 2015, becoming the most signi cant and fastest-growing alliance in the technology sector.Its members closely collaborate and share experiences to promote and drive the success of the LoRaWAN protocol as the leading open global standard for secure, carrier-grade IoT LPWAN connectivity.In the de nition of the LoRa Alliance, "The LoRaWAN speci cation is a Low Power, Wide Area (LPWA) networking protocol designed to wirelessly connect battery operated 'things' to the internet in regional, national or global networks, and targets essential Internet of Things (IoT) requirements such as bi-directional communication, end-to-end security, mobility and localization services."[16].
Long Range accessibility and low-power requirement make LPWA a more desired network communication method for IoT infrastructures.LPWA offers some advantages when it is compared to other alternative network technologies.LPWA provides e cient signal propagation in indoor places that the cellular system does not correctly work.LPWA uses MHZ frequency band, for Europe 867-869 MHz, North America 902-928 MHz, China 470-510 MHz, Korea 920-925 MHz, Japan 920-925 MHz, India 865-867 MHz LPWA meets the requirement for long-distance communication applications.If the sensor nodes are attached to the garbage bin, a city LPWA ts needs.In such waste management applications, the data rate is not high, and delaytolerant is acceptable, so LPWA is an ideal transmission method for this IoT system.The most crucial advantage of LPWA is saving more energy and connecting the endpoint node sensor directly to the gateway via star topology[17].Low Power; LPWA provides both mesh topology and star topology.If it is planned a long-range communication for large areas, mesh topology helps extend the coverage of LPWA.By this method, more 10 km coverage could be reached.For an endpoint device, it is expected to be live for a long time as ten years.Without dying battery, keep network live is thanks to a star topology.Every endpoint node connects straight to the gateway, and this brings more e ciency in terms of power need.Long-Range Communication: LPWA's better signal propagation enables the signals to reach indoor places, so end to end device connection rage changing from a few km to 10 kilometers depending on the environment (building and plants block signals and decrease the distance) Low Cost; In most scenario, LPWA uses unlicensed frequency band.In Turkey, LPWA works in 868 MHz in ISM Band.

Table 2 .
1 Number of people living in urban and rural areas in Turkey [20]

Table 2 .
2 shows that how much fossil energy resources that TURKEY needed in the past year.The numbers on the table demonstrate some realities.When people moved to cities from rural areas, and TURKEY's development increased year by year, energy needs were boosted too during the past years.These facts result in economic and environmental troubles.
operations cannot nd proper and modern solutions.For the eldwork, o cial research permission is received from the Beşiktaş Municipality "Beşiktaş has extraordinary historical heritage, and it is mostly called Istanbul city center and located on the European side of Istanbul.Many commercial companies and residential located in Besiktas.Besiktas is also serving as a hub for transportation to many directions in İstanbul.
" [26]to conduct the research study.Furthermore, Arnavutkoy Municipality also provided valuable support for some open area tests.In this research, the endpoint node is built by assembling the following hardware.General information about each hardware gets from the producer company and shared brie y below 6.1 Components of IOT end point and infrastructure Semtech SX1276 (137 MHz to 1020 MHz Long Range Low Power Transceiver): The SX1276/77/78/79 transceivers feature the LoRa® long range modem that provides ultra-long range spread spectrum communication and high interference immunity while minimizing current consumption [27].LG01-P IoT Gateway: The LG01-P is an open-source single channel LoRa Gateway.It lets bridge LoRa wireless network to an IP network via WiFi, Ethernet, Or 3G/4G cellular via optional LTE module.The LoRa wireless allows users to send data and reach extremely long ranges at low data-rates.It provides ultralong range spread spectrum communication and high interference immunity[28].ESP8266 Module Adapter: This module is mandatory as an adapter for Semtech sx1276.Sx1276 should be soldered to this module to work correctly with other peripherals.Other Subsidiary Equipment for Node Design: Breadboard, Antenna, USB Cable, 9V Battery, Battery Connector, Solid Core Jumper Wires, Jumper Wires, Plastic Project Box, Solder, Electric Soldering Iron, 1, the entire development environment is shown.The local development was made successfully, thanks to these products.Picture 6.2 is demonstrating how to attach the distance sensor to the node box.Ultrasonic sensor, Lora module, and Arduino board connection made, as shown in picture 6.3.Connecting the Lora module, the Arduino board is not comfortable without a supportive board shown in picture 6.4 Lora module should be soldered to this assistance board in advance.