INTRODUCTION
Introduction
Nwadays the Internet is one of the most important and the most used means of communicating.
The internet makes a big impact in many areas and also for all of the humanity Therefore, the internet can be considered one of the greatest creations in the history [1].
The next generation of the Internet will be the Internet of Things which can be acknowledged as a worldwide network of interconnected objects [2].
In this new model, any object has a unique ID and can join a common and known network which is the Internet [1].
The Internet of Things (IoT) revolutionizes information exchange by enabling seamless communication not just between people, but also among various devices This innovative approach enhances connectivity and interaction in our increasingly digital world.
The internet stands as one of humanity's most significant and transformative inventions, profoundly influencing our lives The Internet of Things (IoT) signifies a groundbreaking advancement that will leverage innovative applications to enhance connectivity and functionality.
Wireless communication has become a vital means of internet connectivity, driven by the growing global demand for wireless connections This surge in popularity has led to the rise of applications such as wireless sensor networking and the Internet of Things (IoT) Sensors, which are essential components of these technologies, play a crucial role in collecting and transmitting data.
2 download by : skknchat@gmail.com get information about the environments These can be used as a network to communicate with other devices.
A sensors network has many sensors devices distributed in a certain environment This kind of network can be applied for controlling, tracking and processing in different situations, for example, security monitoring [3].
The IoT thesis highlights a groundbreaking innovation in networking by utilizing sensing devices to gather and process valuable data This system enables the collection of vast amounts of information, presenting significant advancements for society.
Motivations
The internet, a global network of interconnected computers using TCP/IP, revolutionized long-distance communication and transformed how knowledge is shared and acquired It enhanced community awareness and significantly impacted the entertainment and media industries This remarkable advancement allowed individuals from diverse regions to connect, fostering opportunities for sharing, learning, and caring across the globe.
The "Internet of Things" is an innovative concept linked to the "Future Internet," envisioning a scenario where physical objects are integrated into the internet Each object is uniquely identified and accessible through the network, creating a seamless connection between the digital and physical worlds.
Imagine a smart home equipped with interconnected devices such as a smart TV, smartphone, lights, and heating system, all forming an IoT network linked to the internet via a Gateway device The homeowner can effortlessly manage these devices remotely using their smartphone or laptop from work or any location with internet access For instance, before leaving the office, the homeowner can check the temperature sensor readings and activate the heating system, ensuring a cozy welcome upon returning home.
To create a secure IoT network within your home, it is essential to integrate various smart devices that utilize technologies such as Bluetooth, ZigBee, ANT, or 6LoWPAN The primary challenge lies in preventing unauthorized access to ensure that only authorized users can control these devices.
These were the major motivations of the study, since the topic is of public interest today.
Goals
To implement an Internet of Things infrastructure using the communication protocol.
To identify the Internet of Things reference model;
To identify some protocols that are used in the Internet of Things;
To check the operating system used in the Internet of Things.
Research Questions
What is the Internet of things?
What are the protocols used in the Internet of Things?
What are operating systems used in the Internet of Things?
4 download by : skknchat@gmail.com
Structure of the thesis
The rest of the thesis is structured as follows:
Chapter 2: Presents the overview of the Internet of Things, including advantages and disadvantages of the internet of things;
Chapter 3: Presents some theories about M2M communication, M2M protocols stack and technical challenges, M2M standards and protocols, Architecture and components of M2M.
Chapter 4: Presents the case study testbed establishment, description the material used for the implementation and the final results.
In the end, it presents the conclusion, some recommendations for future work and references.
5 download by : skknchat@gmail.com
INTERNET OF THINGS OVERVIEW
Internet of Things vision
The Internet of Things (IoT) was first introduced by Kevin Ashton in 1999, marking a significant shift in how everyday objects connect to the internet By 2003, the global population reached approximately 6.3 billion, with only 500 million devices online, equating to just 0.08 devices per person At that time, the concept of IoT had not yet emerged, highlighting the limited connectivity of objects in comparison to today’s digital landscape.
The rise in smartphone and tablet usage has led to a significant increase in internet-connected devices, reaching approximately 12.5 billion in 2010 and raising the average number of devices per person to over 1.84 for the first time According to a study by Cisco's Internet Business Solutions Group, this trend is expected to continue, with the number of connected devices projected to grow in the coming years, further increasing the average devices per person.
In the emerging model of the internet, communication will extend beyond human interaction to include connections between people, objects, and machines This integration of the physical and digital worlds will be facilitated by unique identification methods, enabling seamless machine-to-machine communication, similar to the current structure of the Internet.
6 download by : skknchat@gmail.com
Figure 2.1: Internet of Things is "born" between 2008 and
2009 [3] 2.1.1 What is Internet of Things?
In 2005, ITU published an annual report of the Internet of Things, which extended the concept of the Internet of things and posed the foreground of
"Any Time, and Any Place, and Any Things Connection", “Ubiquitous networks” and
“Ubiquitous Computing”, except RFID technology, sensor technology, nanotechnology and smart things technology will be more widely applied [7].
The Internet of Things (IoT) is a dynamic global network that features self-configuring capabilities and relies on standard, interoperable communication protocols In this ecosystem, both physical and virtual entities possess unique identities, physical characteristics, and virtual personas These entities utilize intelligent interfaces and are seamlessly integrated into the broader information network.
Smart objects are defined as entities that possess a state and associated data, along with the capability to determine the nature, duration, and protocol of their connectivity.
RFID, Bluetooth Low Energy and NFC make it possible to use our phone as readers We can extract information from certain objects just by tapping it or
RFID and NFC tags are considered smart objects, as they lack embedded systems yet enable data transmission through readers These non-processor entities allow for the acquisition and migration of data over the internet, facilitating seamless connectivity and interaction with digital platforms.
Short-range low-energy sensor technology has enabled the development of smart objects, such as T-shirts equipped with smart tags By tapping a smartphone on these tags, consumers can access detailed information, including material quality, size, color variants, and dye details, which aids in informed purchasing decisions Additionally, this information can be used as a search query to find similar products, allowing users to compare price and quality across various options.
The Internet of Things (IoT) has become a major focus for startups in Silicon Valley, highlighting its vast potential across various hardware and software platforms However, finding a comprehensive list of IoT devices online can be challenging and often leads to frustration due to the sheer number of options available.
In this section, we have dedicated considerable time to research, culminating in an overview of the most common and popular technologies in the Internet of Things (IoT), highlighting the devices under discussion.
IoT devices can be categorized into two main types: wearable devices and embedded devices driven by microcontrollers or microprocessors For instance, compact embedded devices like the Arduino LilyPad can be easily customized for creating personalized wearable solutions In contrast, standard wearable hardware primarily offers software development opportunities for developers.
8 download by : skknchat@gmail.com
Here is a diagram of common peripheral hardware that one might have to learn while working with IoT hardware in embedded level.
Figure 2.2: Common IoT devices and Technologies [9]
You don't need to be a hardware expert to begin creating apps for popular wearable platforms For those interested in hardware, starting with an Embedded IoT platform is a great option Technologies such as Raspberry Pi, Arduino, or Galileo can serve as excellent foundations for IoT development.
Advantages and disadvantages of IoT
Some of the most important advantages of IoT are as follows [6]:
Transportation: IoT eases and simplifes the entire process by introducing a monitory sensor that helps to track distance and time locations and other contributing factors.
Inventory Management: IoT is used to tag radio frequency sensors to track the location of products in real time It has been instrumental in tracking the level of
9 download by : skknchat@gmail.com inventory and to stock it in advance, making alerts for unforeseen stoppages, automatically placing orders, etc.
Third-party web data aggregators utilize the Internet of Things (IoT) to enhance their understanding of key customers by tracking their activities on social media networks, allowing them to gain insights into customer preferences.
Integrating chip technology into health care systems could significantly benefit both individuals and society By implementing a chip in each person, hospitals would have the capability to continuously monitor patients' vital signs, enhancing overall health management and response times in emergencies.
Considering that IoT is still an emerging technology, it has its unfulflled drawbacks [6]:
Currently, there is no universal standard for the compatibility of tagging and monitoring equipment, necessitating agreement among manufacturers on protocols like Bluetooth or USB Additionally, the NSA spying revelations have raised concerns about privacy, as increased online information accessibility poses risks from government agencies, data aggregators, and hackers, leaving the public feeling uneasy.
The interconnectedness of smart devices in a home significantly increases the risk of widespread malware infections, potentially leading to severe system corruption or minor disruptions in functionality.
The Internet of Things (IoT) introduces increased complexity, which can lead to a higher likelihood of failures As the infrastructure for IoT continues to evolve, it will take time to address and mitigate these potential issues effectively.
Internet of Things platform
Platform: A platform could be a hardware plus software suite upon which other applications can operate Platform could comprise hardware above which Operating
10 download by : skknchat@gmail.com system can reside This Operating system will allow application to work above it by providing necessary execution environment to it [10].
In today's landscape, numerous IoT platforms are available for developing IoT solutions This thesis focuses on seven widely used platforms that are essential for building effective IoT applications.
Google Cloud Platform provides the infrastructure to handle streams of data fed from millions of intelligent devices.
Google stands out as a leading IoT platform due to its fast global network and robust Big Data tools Its flexible pay-as-you-go strategy, combined with support for various cloud services such as RiptideIO, BigQuery, Firebase, and PubSub, enhances its appeal Additionally, it offers seamless integration with Telit Wireless Solutions and enables connections between Arduino, Firebase, and Cassandra on the Google Cloud Platform, making it a comprehensive solution for IoT development.
Real-time stream processing by Google involves devices sending status information to App Engine, where a load balancer ensures balanced distribution among various app engines The compute engine then performs data computation and publishes the results, with multiple instances available for reliability and scalability Data is securely stored and backed up using cloud storage, while BigQuery enables rapid insertion of data into cloud database tables The final results can be presented to end users through various analysis and visualization techniques.
Run on Google's infrastructure; Scalability;
Compute, storage and services Higher performance;
11 download by : skknchat@gmail.com
Assurance of Google Grade security and compliance for your applications; Environment safe cloud.
Figure 2.3: Real Time Stream Processing- Google
IBM BlueMix is a platform as a service cloud which is developed by IBM.
IBM BlueMix cloud supports various programming languages, including Java, PHP, Python, Node.js, and Go Its integrated DevOps capabilities enable users to build, run, deploy, and manage applications efficiently.
The IoT Foundation, illustrated in Figure 2.4, integrated with the IBM BlueMix platform, offers robust access to IoT data and devices IBM BlueMix facilitates the rapid development of analytics applications, visualization dashboards, and mobile IoT solutions Users can create IoT applications using IBM BlueMix, which provides REST and secure APIs to link device data with these applications Serving as a central hub, the IBM IoT Foundation enables the setup and management of connected devices while employing the MQTT protocol for secure data transfer to the cloud.
12 download by : skknchat@gmail.com
ThingWorx is the pioneering software platform for creating and managing connected world applications, specifically designed to streamline the development of Machine-to-Machine (M2M) and Internet of Things (IoT) solutions By significantly reducing the time, cost, and risk associated with application development, ThingWorx accelerates the design, development, and deployment cycle, leading to faster time-to-market The ThingWorx Internet of Things Foundation is supported by a suite of advanced products and services, including ThingWorx Composer, Codeless Mashup Builder, Event-Driven Execution and 3D Storage, ThingWorx SQUEAL, and ThingWorx Edge MicroServer.
ThingWorx IoT platforms offer a robust device cloud that enables the connection of millions of devices with IoT applications These platforms ensure continuous communication through protocols such as REST, MQTT, and sockets Additionally, they feature system service integration, a 3D storage engine, and business functionalities, enhancing the overall IoT ecosystem.
The integration of system services with business systems such as ERP and CRM is facilitated by a logic framework This framework incorporates a 3D storage engine that supports big data analytics Additionally, a layer of REST APIs is implemented to enhance the utilization of social and cloud services Finally, the processed data is showcased through a range of visualization techniques.
Modern and Complete Platform provisioning; Faster deployment;
Integrate People, Systems and Machines;
Deploy in the way we Like to do it;
Let your Application evolve and grow Over
14 download by : skknchat@gmail.com
ThingSpeak is an open data application platform designed for developing Internet of Things (IoT) systems, enabling users to build applications that utilize data collected from sensors It serves as an ideal complement to existing enterprise systems, facilitating integration with various third-party platforms and technologies, including prominent IoT solutions like ioBridge and Arduino Additionally, ThingSpeak channels are utilized for sending and storing data efficiently.
Figure 2.6 illustrates the integration of ThingSpeak IoT with the Electric Imp platform, which facilitates WiFi device connectivity to cloud services Electric Imp offers access to its modules, streamlining the connection process through its cloud services This enables users to leverage ThingSpeak's data services for an enhanced IoT experience.
It provides real time collection of data storage;
Data analytics and Visualization using
Provides Geolocation data; Facilitates plugins.
15 download by : skknchat@gmail.com
Figure 2.6: Electric Imp and ThingSpeak IoT
Digital Service Cloud (DSC) is an open IoT platform designed for innovators, enabling them to maintain ownership of their customer relationships similar to how customers own their products It facilitates product start-ups and global tech brands by accelerating the time-to-market for new innovations With DSC's ready-made infrastructure, users can create customized IoT solutions through device connectivity and a plug-and-play dashboard The platform allows for effective monitoring and management of products throughout their lifecycle, connecting them to a vast network of millions of devices Featuring a UI-driven rules engine that requires no coding, DSC streams real-time data at a petabyte scale and operates on a secure tenant-based system, ensuring rapid application launches with user-friendly wizard-based app builders.
The Digital Service Cloud IoT Foundation enables consumer devices equipped with various sensors to connect seamlessly to cloud-based IoT applications, facilitating communication between the devices and the applications A range of networking and connectivity techniques is available to link these devices to the cloud The cloud environment offers robust device management and application development capabilities, while also supporting data analytics and visualization through advanced dashboards for end users.
16 download by : skknchat@gmail.com
Monitoring, maintenance and management of devices; Multi-channel support delivery;
Preventive support through support cloud; Users across diverse verticals.
Figure 2.7: Digital Service Cloud IoT foundation
Amazon Web Services (AWS) enables global Internet of Things (IoT) solutions by offering robust security, comprehensive services, and dedicated support With EC2, users can quickly access the necessary computing power, while AWS facilitates big data analytics and manages high-volume data efficiently Amazon Kinesis plays a crucial role in ingesting data from thousands of sensors, ensuring seamless data flow AWS prioritizes data security, safeguarding information both in transit and at rest Its flexible pay-as-you-go model, along with various pricing options like tiered pricing and Reserved Instances, makes it cost-effective for IoT applications Additionally, AWS supports on-demand infrastructure, providing scalable storage, computing capabilities, and global resources tailored to the needs of IoT systems.
The flexibility of IoT applications relies on various tools, programming languages, and data management resources, with ActiveMQ and Mosquitto servers playing a crucial role in managing and analyzing these applications Key components such as user identity, device analytics, and messaging notifications are essential for effective IoT solutions Amazon Web Services simplifies these processes through services like Amazon Cognito, Amazon Mobile Analytics, and Mobile Push, allowing developers to concentrate on enhancing the unique features of their applications while AWS handles the complex infrastructure tasks.
Amazon Kinesis enables the collection of high-throughput data from various devices and gateways, facilitating real-time analysis and storage in the cloud This capability allows applications to quickly access and utilize the data for swift decision-making, supporting data at any scale.
Data analytics and storage of high volume data;
On demand services like other platforms;
Figure 2.8: Data streaming from Gateway to cloud by Amazon Kinesis [10]
18 download by : skknchat@gmail.com
Azure is Microsoft’s cloud computing platform, a rising collection of integrated services analytics, database, computing, networking, mobile, storage and web for moving quicker, accomplishing more and saving money.
Transmission Technology
To successfully integrate IoT, it must be supported by innovative technologies, with RFID being a crucial enabler RFID facilitates the connection and communication with small objects through a uniquely identified system, enabling real-time tracking by providing information about the location and status of items The IoT can be categorized into three key processes: first, item signing and identifying, where RFID technology, a non-connecting Auto-ID system, utilizes radio frequencies to identify target items and gather relevant data RFID comprises three components: a tag containing a unique electronic code, a reader that can read and sometimes write tag information, and an antenna that transmits radio frequency signals between the tag and the reader Second, the process of information transmission can be classified into wired and wireless methods.
The Internet of Things (IoT) involves two key transmission processes: the wireless transfer of item identification information from collection devices to the Internet backbone network, and the wired communication between information processing centers and external devices The backbone encompasses various communication networks, including the Internet and telecom networks, facilitating the essential data flow At the intelligent processing center, collected data is pooled, converted, and analyzed to meet user-specific needs, enabling the triggering of relevant events This process transforms raw data into valuable insights, allowing for organized data responses tailored to individual service requirements.
2.4.2 Connectivity for the Internet of Things
The embedded systems can use a range of connectivity to connect with other devices or the internet, as show in figure 2.10.
21 download by : skknchat@gmail.com
The following are some communication technologies of smart devices:
Bluetooth is a vital short-range communication technology that plays a crucial role in computing and consumer products It is anticipated to be essential for wearable devices, often linking to the Internet of Things (IoT) through smartphones The introduction of Bluetooth Low Energy, also known as Bluetooth Smart, is particularly significant for IoT applications, as it maintains a similar range to traditional Bluetooth while greatly reducing power consumption.
Bluetooth Smart/BLE is primarily optimized for transferring small data packets rather than large files, making it ideal for personal devices Its significant advantage lies in its extensive integration across smartphones and various mobile devices According to the Bluetooth Special Interest Group (SIG), it is anticipated that over 90% of Bluetooth-enabled smartphones, including those running iOS, Android, and Windows, will be 'Smart Ready' by 2018 Devices utilizing Bluetooth Smart features adhere to the Bluetooth Core Specification.
22 download by : skknchat@gmail.com
Version 4.0 (or higher the latest is version 4.2 announced in late 2014) with a combined basic-data-rate and low-energy core confguration for an RF transceiver, baseband and protocol stack Importantly, version 4.2 via its Internet Protocol Support Profle will allow Bluetooth Smart sensors to access the Internet directly via 6LoWPAN connectivity (more on this below) This IP connectivity makes it possible to use existing IP infrastructure to manage Bluetooth Smart ‘edge’ devices. Bluetooth 4.2 core specifcation:
Data Rates: 1Mbps (Smart/BLE)
ZigBee, primarily utilized in industrial settings, operates on the IEEE802.15.4 protocol at 2.4GHz, making it ideal for applications requiring low data-rate exchanges over short distances, typically within 100 meters in homes or buildings Key ZigBee profiles, such as ZigBee PRO and ZigBee Remote Control (RF4CE), offer significant advantages in complex systems, including low power consumption, high security, robustness, and scalability for numerous nodes The recently launched ZigBee 3.0 unifies various ZigBee standards into a single framework, enhancing its applicability in wireless control and sensor networks for M2M and IoT applications For development, products like TI’s CC2538SF53RTQT ZigBee System-On-Chip IC and CC258 ZigBee Development Kit are available.
Standard: ZigBee 3.0 based on IEEE802.15.4;
23 download by : skknchat@gmail.com
WiFi connectivity is a popular option for developers due to its widespread presence in home LAN environments It benefits from an extensive existing infrastructure, providing fast data transfer rates and the capability to manage large volumes of data efficiently.
The prevalent WiFi standard in homes and businesses today is 802.11n, delivering impressive throughput of hundreds of megabits per second While this speed is suitable for file transfers, it may be excessively power-hungry for various IoT applications.
Standard: Based on 802.11n (most common usage in homes today); Frequencies: 2.4GHz and 5GHz bands;
Data Rates: 600 Mbps maximum, but 150-200Mbps is more typical, depending; on channel frequency used and number of antennas (latest 802.11-ac standard should offer 500Mbps to 1Gbps).
NFC (Near Field Communication) technology facilitates secure and convenient two-way interactions between electronic devices, particularly smartphones It empowers users to make contactless payments, access digital content, and connect various electronic devices By extending the functionality of contactless card technology, NFC allows devices to exchange information over distances of less than 4 cm.
24 download by : skknchat@gmail.com
6LowPAN is a crucial IP-based technology that serves as a network protocol, distinct from IoT application protocols like Bluetooth or ZigBee It defines encapsulation and header compression mechanisms, allowing flexibility across various frequency bands and physical layers, including Ethernet, WiFi, 802.15.4, and sub-1GHz ISM A significant feature of 6LowPAN is its integration with the IPv6 stack, which has become vital for the Internet of Things (IoT) As the successor to IPv4, IPv6 offers an astounding 5 x 10^28 unique addresses per person globally, enabling every embedded device to have its own IP address and connect seamlessly to the Internet Specifically designed for applications like home and building automation, IPv6 provides an efficient transport mechanism for creating complex control systems and facilitating cost-effective communication among devices through low-power wireless networks.
The 6LowPAN standard enables the transmission of IPv6 packets over IEEE802.15.4 networks, supporting open IP protocols such as TCP, UDP, HTTP, COAP, MQTT, and websockets This standard facilitates end-to-end addressable nodes, allowing routers to connect the network to IP Additionally, 6LowPAN features a robust, scalable, and self-healing mesh network, where mesh routers efficiently route data to other devices, while hosts can conserve energy by entering long sleep modes.
Frequency: (adapted and used over a variety of other networking media including Bluetooth Smart (2.4GHz) or ZigBee or low-power RF (sub-1GHz)
25 download by : skknchat@gmail.com
Z-Wave is a low-power RF communications technology that is primarily designed for home automation for products such as lamp controllers and sensors among many others Optimized for reliable and low-latency communication of small data packets with data rates up to 100kbit/s, it operates in the sub-1GHz band and is impervious to interference from WiFi and other wireless technologies in the 2.4-GHz range such as Bluetooth or ZigBee It supports full mesh networks without the need for a coordinator node and is very scalable, enabling control of up to 232 devices Z-Wave uses a simpler protocol than some others, which can enable faster and simpler development, but the only maker of chips is Sigma Designs compared to multiple sources for other wireless technologies such as ZigBee and others [19].
Standard: Z-Wave Alliance ZAD12837 / ITU-T G.9959
LoRaWAN is designed for wide-area network applications, focusing on low-power WANs essential for cost-effective, secure bi-directional communication in IoT, M2M, smart city, and industrial settings It optimizes power consumption while accommodating vast networks with millions of devices, offering data rates between 0.3 kbps and 50 kbps.
Range: 2-5km (urban environment), 15km (suburban environment)
26 download by : skknchat@gmail.com
ANT is a proprietary wireless sensor network (WSN) technology that utilizes a wireless communications protocol stack It allows semiconductor radios operating in the 2.4 GHz Industrial, Scientific, and Medical (ISM) band to communicate effectively By establishing standard rules for coexistence, data representation, signaling, authentication, and error detection, ANT ensures reliable and efficient wireless communication.
Radio frequency identification (RFID) utilizes electromagnetic fields for wireless object identification, typically involving an Active Reader Passive Tag (ARPT) system, where active readers interact with passive tags that store authentication data RFID technology can operate over short ranges of approximately 10 cm or extend up to 200 meters for long-range applications Interestingly, Léon Theremin developed RFID in 1945 as an espionage tool for the Soviet Union An alternative system, known as Active Reader Active Tag (ARAT), employs active tags that respond to signals from the active reader RFID operates on various frequency bands, including 120–150 kHz (10 cm), 3.56 MHz (10 cm-1 m), 433 MHz (1-100 m), 865-868 MHz (Europe), and 902-928 MHz (North America) for ranges between 1-12 m.
Established and widely used technology.
Tags need to be present as identifer and be handed over before;
27 download by : skknchat@gmail.com
Internet of Things Architecture
IoT architecture consists of different suite of technologies supporting IoT.
It serves to illustrate how various technologies relate to each other and to communicate the scalability, modularity and confguration of IoT deployments in different scenarios [22].
The functionality of each layer are described follow:
The lowest layer is made up of smart objects integrated with sensors The sensors enable the interconnection of the physical and digital worlds allowing real-time
The advancement of hardware miniaturization has led to the development of powerful sensors that can be embedded into smaller physical objects, enhancing their functionality and connectivity.
Sensors serve diverse functions by measuring various physical properties, including temperature, air quality, movement, and electricity They can also possess memory capabilities to record multiple measurements By converting physical properties into understandable signals, sensors facilitate data interpretation by instruments These devices are categorized based on their specific applications, such as environmental sensors, body sensors, home appliance sensors, and vehicle telematics sensors.
Most sensors connect to sensor aggregators, or gateways, via LAN options like Ethernet and WiFi, or PAN technologies such as ZigBee, Bluetooth, and Ultra-Wideband (UWB) For sensors that do not connect to aggregators, WAN options like GSM, GPRS, and LTE provide connectivity to backend servers and applications Sensors utilizing low power and low data rates typically form Wireless Sensor Networks (WSNs), which are increasingly popular due to their ability to support a greater number of sensor nodes while maintaining battery life and covering extensive areas.
The proliferation of tiny sensors will generate vast amounts of data, necessitating a reliable and high-performance wired or wireless network infrastructure for data transport Existing networks, which often operate on diverse protocols, have been utilized to support machine-to-machine (M2M) networks and their various applications.
To meet the growing demand for diverse IoT services and applications, including high-speed transactional services and context-aware applications, it is essential for multiple networks utilizing various technologies and access protocols to operate cohesively in a heterogeneous configuration.
29 download by : skknchat@gmail.com private, public or hybrid models and are built to support the communication requirements for latency, bandwidth or security [22].
A converged network infrastructure can effectively address fragmentation by unifying diverse networks into a single platform This network layer abstraction enables multiple organizations to independently share and utilize the same network, ensuring their data is routed securely while maintaining privacy and performance standards Consequently, each organization can operate as if they have their own private network resources.
This layer is used for managing the IoT services Management Service layer is responsible for Securing Analysis of IoT devices, Analysis of Information (Stream Analytics, Data Analytics), Device Management [23].
Effective data management is essential for transforming vast amounts of raw data gathered by sensor devices into valuable insights This process occurs within this specific layer, ensuring the extraction of necessary information from the collected data.
In urgent situations, a specific layer is essential for providing immediate responses by abstracting data, extracting relevant information, and managing data flow This layer plays a crucial role in data mining, text mining, and service analytics, ensuring efficient handling of critical information.
The management service layer encompasses the Operational Support Service (OSS), which features Device Modeling, Device Configuration, and Management, among other functions Additionally, it includes the Billing Support System (BSS), designed to facilitate billing and reporting processes.
Figure 2.11 illustrates the components of IoT/M2M Application Services, highlighting the critical role of the Analytics Platform Data stands out as the most vital element, while Security measures encompass Access Controls, Encryption, and Identity Access to ensure comprehensive protection.
30 download by : skknchat@gmail.com
Management etc.; and then we have the Business Rule Management (BRM) and Business Process Management (BPM) [23].
Application layer forms the topmost layer of IoT architecture which are responsible for effective utilization of the data collected Various IoT applications include Home Automation, E-health, E-Government etc [23].
Figure 2.11 illustrates two primary categories of IoT applications: Horizontal Market applications, such as Fleet Management and Supply Chain, and Sector-specific applications, including Energy, Healthcare, and Transportation.
Application
The Internet of Things (IoT) holds significant potential for societal, environmental, and economic transformation by providing accurate information regarding the status, location, and identity of various entities within our environment This data facilitates smarter decision-making and enables timely actions across multiple domains, including logistics, transportation, asset tracking, smart homes, infrastructure, energy, defense, and agriculture Ultimately, IoT is poised to profoundly influence every aspect of society.
The Internet of Things (IoT) plays a crucial role in every stage of the value chain, with seven primary value drivers identified The first four drivers focus on value derived from machine-to-machine (M2M) communication, while the remaining three emphasize value creation through user integration According to Fleisch, these drivers highlight the diverse ways IoT enhances operational efficiency and user engagement.
The simplified manual proximity trigger allows objects to communicate their identity when placed within a sensor's detection range Once the identity is recognized, it can initiate a specific action or transaction.
31 download by : skknchat@gmail.com
An automatic proximity trigger activates an action when the physical distance between two objects falls below a certain threshold By identifying these objects and combining their locations with specific actions, processes can be optimized for improved efficiency.
Automatic sensor triggering allows smart devices to gather data from various sensors such as temperature, acceleration, orientation, vibration, and humidity These devices monitor their conditions and surroundings, transmitting information that facilitates quick and informed global decision-making.
Automatic product security – a thing can provide derived security (information) based on the interaction between the thing and its cyberspace representation (e.g. a QR-code containing a specifc URL pointing to relevant information).
User feedback can be enhanced through straightforward mechanisms that allow individuals in the environment to receive immediate responses Commonly, these feedback systems utilize audio signals, such as beeps, or visual indicators, like flashing lights, to convey important information effectively.
User feedback plays a crucial role in enhancing services, particularly when connected through gateway devices like smartphones A prime example of this is augmented product information, which leverages extensive user insights to deliver richer, more personalized experiences.
The integration of real-world experiences and cyberspace can significantly influence behavior modification, particularly in driving habits For instance, vehicle sensors that transmit driving patterns to external agencies may lead to enhanced awareness and adjustments in how individuals drive.
Figure 2.12 shows some applications of the internet of things.
32 download by : skknchat@gmail.com
Operating System for the Internet of Things
Raspbian OS Raspbian OS is a Debian [Linux] based operating system for the Raspberry Pi developed and maintained independent of the Foundation.
Risc OS This was an OS designed in Cambridge, England by
Acorn in 1987 The team who developed the ARM microprocessor was part of the team building the Risc
OS The OS is now owned by Castle Technology Ltd and the source is managed by Risc OS Open Limited [ROOL]
Plan 9 Plan 9 OS comes as a bundle of Operating system and software’s The software is written for Plan 9 and is not ported from Unix or Linux Most of the services like the window system, compiler, fle server and network services were freshly written for the Plan 9 Operating system
Android The popular mobile OS android can also be run on the
33 download by : skknchat@gmail.com
Contiki is an open-source, portable, and multi-tasking operating system specifically designed for memory-efficient networked embedded systems and wireless sensor networks It has been utilized in diverse applications, including road tunnel fire monitoring, intrusion detection, wildlife monitoring, and surveillance networks Tailored for microcontrollers with limited memory, a standard Contiki setup typically features 2 kilobytes of RAM and 40 kilobytes of ROM.
RIOT RIOT OS is an operating system for Internet of Things devices It is based on a microkernel and designed for: energy effciency, hardware independent development, a high degree of modularity.
Table 1: Operating system for IoT
This chapter offers a comprehensive overview of the Internet of Things (IoT), covering its applications, concepts, platforms, communication technologies, and operating systems The IoT revolutionizes device control, enabling users to manage devices remotely via the Internet By utilizing various communication technologies to interconnect devices, a deeper understanding of how IoT functions is essential for effectively building a robust IoT ecosystem.
34 download by : skknchat@gmail.com
Chapter conclusion
This chapter offers a comprehensive overview of the Internet of Things (IoT), covering its applications, concepts, platforms, communication technologies, and operating systems The IoT revolutionizes device control, enabling users to manage devices remotely via the Internet By utilizing various communication technologies, IoT connects devices seamlessly Understanding the workings of IoT is essential for effectively building a robust IoT ecosystem.
34 download by : skknchat@gmail.com
MACHINE TO MACHINE COMMUNICATION
What is M2M?
M2M communications encompasses technologies that enable mechanical and electronic devices to connect and automate data transmission via wireless networks A crucial element of M2M is a compact hardware module integrated into larger devices like sensors, monitoring systems, automobiles, air conditioners, surveillance cameras, or alarm systems, facilitating communication within the network This small module functions similarly to the communication radios or transceiver circuits found in cell phones and smart devices.
M2M technology enables devices to communicate autonomously over wired or wireless networks, eliminating the need for human intervention It utilizes components such as sensors, actuators, microcontroller units (MCUs), and RF transceivers to gather data from devices or events This data is then transmitted through various communication networks, including GSM, GPRS, powerline, or satellite, to application software that converts the information into actionable insights The fundamental stages of M2M technology are depicted in Figure 3.1.
35 download by : skknchat@gmail.com
Figure 3.1: Three basic stages of M2M technology [26]
Traditionally, M2M solutions have been developed as standalone systems focused on enhancing specific processes, often neglecting the potential for future integration within a broader business framework.
M2M solutions are evolving beyond mere monitoring of remote assets; they now collect real-time data from a vast array of connected devices, including tractors, medical equipment, vending machines, and storage tanks This data is transformed into actionable insights that facilitate quick decision-making, automated processes, and strategic analytics The main focus of M2M solutions has shifted towards enabling new services, moving beyond the traditional goals of enhancing operational efficiency and reducing costs.
A platform is considered to be a group of technologies that are used as a base upon which applications, processes or other technologies are developed or delivered.
36 download by : skknchat@gmail.com
Developing a platform is a multifaceted endeavor that primarily aims to enhance and streamline the user experience M2M platforms have revolutionized the M2M market by improving accessibility to device data for application developers They provide clearly defined software interfaces and readily available APIs, enabling seamless integration of information sources and control parameters into applications.
Over the past decade, the M2M platform space has developed rapidly, and now includes the following broad platform functions [27]:
Connectivity support involves essential tasks for configuring and maintaining machine-to-machine connections, particularly in mobile environments Key activities include connection provisioning, monitoring usage, and providing support for fault resolution.
Service Enablement offers robust solution support, comprehensive reporting, and a software environment with APIs that streamline solution development Combined with Connectivity Support, these functions form the foundational 'horizontal' elements of the M2M platforms industry.
Device management is primarily associated with individual device manufacturers but can also accommodate various device types and vendors across multiple networks These platforms are designed to enhance the sales of devices and device-centric solutions, often necessitating specialized support for functions like reporting and management.
Application Support: it is characterized by the provision of tailored solutions, encompassing connected devices potentially of multiple types, connected
37 download by : skknchat@gmail.com with multiple technologies, and connected to the networks of multiple CSPs (Communication Service Providers).
A solution provider is primarily seen as an enabler for large system development initiatives rather than a standalone offering Typically, M2M platforms are utilized by systems integrators to facilitate turnkey and client-specific solutions.
Despite overlapping functionalities among various platform implementations, which complicate the M2M delivery ecosystem, the primary objective remains consistent: to ensure that data collected from machines and sensors is effectively utilized to enhance the business operations of the investing company.
M2M standards and protocols
Connecting Machine-to-Machine (M2M) services necessitates a diverse array of technologies and standards, paving the way for future research in the Internet of Things (IoT) To address this, organizations such as ITU, ETSI, and TIA are collaborating to create networks that facilitate communication across different protocols The OneM2M initiative aims to establish a unified M2M architecture, complete with specifications for implementing standard APIs.
IEEE (Institute of Electrical and Electronics Engineers)
IETF (Internet Engineering Task Force)
Focus group on M2M service layer
ETSI (European Telecommunications Standards Institute) - EU
38 download by : skknchat@gmail.com
TIA (Telecommunications Industry Association) – USA
OASIS (Advancing Open Standards for the Information Society)
NIST (National Institute of Standards and Technology)
The table below shows some communication protocols
CoAP is a lightweight software protocol designed for simple electronic devices, enabling interactive communication over the Internet It is specifically aimed at low-power sensors, switches, and valves that require remote control or monitoring via standard Internet networks.
CoAP, or Constrained Application Protocol, is an application layer protocol tailored for resource-constrained internet devices like Wireless Sensor Network (WSN) nodes It facilitates seamless integration with the web by easily translating to HTTP, while also addressing specific needs such as multicast support, minimal overhead, and simplicity.
39 download by : skknchat@gmail.com
"Representational State Transfer (REST) is a style of software architecture for distributed systems such as the World Wide Web REST has emerged as a predominant web API design model”.
MQTT is an open messaging protocol designed for machine-to-machine (M2M) communications, facilitating the transmission of telemetry data as messages from widespread devices It effectively operates over high-latency or constrained networks, delivering this data to a server or a small message broker.
The Extensible Messaging and Presence Protocol (XMPP) is an open technology designed for real-time communication, enabling various applications such as instant messaging, presence updates, multi-party chat, voice and video calls, collaboration tools, lightweight middleware, content syndication, and the routing of XML data.
The User Datagram Protocol (UDP) is a fundamental transport layer protocol for client/server network applications utilizing Internet Protocol (IP) As one of the oldest network protocols, UDP serves as the primary alternative to Transmission Control Protocol (TCP), providing a connectionless communication method.
1980 UDP is often used in applications specially tuned for real-time performance.
AMQP is an open standard application layer protocol designed for message-oriented middleware, characterized by key features such as message orientation, queuing, and routing, which encompasses both point-to-point and publish-and-subscribe methods Additionally, it ensures reliability and security in message transmission.
40 download by : skknchat@gmail.com
MQTT, or Message Queue Telemetry Transport, is a lightweight network protocol designed for efficient message publishing and subscribing between devices Created by Dr Andy Stanford-Clark of IBM and Arlen Nipper of Arcom, MQTT aims to optimize bandwidth usage and minimize battery consumption Operating on the TCP/IP protocol, it is particularly well-suited for constrained environments, low-bandwidth networks, and devices with limited processing power and memory, as well as high latency conditions.
The MQTT protocol provides publish-and-subscribe messaging from clients to a broker [28].
An MQTT client can be any device, ranging from a microcontroller to a server, equipped with an MQTT library that connects to an MQTT broker over various networks These clients are capable of subscribing to and publishing messages on specific topics, which serve as routing information for the broker An MQTT client application plays a crucial role in gathering data from telemetry devices, establishing a connection to the server, and transmitting the collected information To develop an MQTT client, it is essential to utilize an MQTT library, which is available for a wide range of devices and frameworks.
Brokers play a crucial role in managing communications by receiving messages from publisher clients, filtering the content, and determining which subscribers would be interested They then forward the relevant messages to all clients who have subscribed to that specific topic.
M2M protocol stack and technical challenges
As Figure 3.2 illustrates, the protocol stack for the M2M communication includes various standardized protocols at transport, network and data link layers, where
41 download by : skknchat@gmail.com each layer is contributing to addressing at least one challenge in the M2M communication, such as security and reliability [29].
M2M systems predominantly employ standardized, IP-compatible open protocols to ensure broad deployability, despite the higher memory requirements associated with IP-based protocols This approach is increasingly favored in large-scale M2M deployments Recent advancements have introduced various protocols, such as CoAP and MQTT, designed to meet the needs of resource-constrained devices However, comprehensive guidelines for protocol stack deployment in future M2M services remain lacking The OneM2M protocol working group has established standard API mappings to several transport protocols to address diverse use cases In addition to the widely used HTTP, specifications have been defined to integrate CoAP/UDP and MQTT/TCP, facilitating the connection of constrained devices within the IoT ecosystem.
Figure 3.2: M2M Protocol Stack and Technical
Challenges [29] 3.4 Architecture and components of M2M
The various components and elements of an M2M system are briefly described below [30]:
42 download by : skknchat@gmail.com
M2M devices are capable of autonomously transmitting data or responding to data requests, serving as endpoints in M2M applications These devices typically connect directly to an operator's network or utilize WPAN technologies like ZigBee or Bluetooth for interconnection Gateways play a crucial role in managing these devices, handling routing and addressing, while devices connected through gateways are generally outside the operator's direct responsibility In contrast, devices with embedded SIMs or fixed line access are directly linked to the operator's network, placing accountability and service level agreements (SLAs) under the network operator's purview This is particularly important for devices utilizing Trusted Platform Modules (TPM), which must be secure and reliable Additionally, M2M Area Networks facilitate connectivity between M2M devices and gateways, such as in personal area networks.
M2M Gateways are essential equipment that facilitate the interworking and interconnection of M2M devices with communication networks Acting as endpoints for operators, these gateways and routers connect sensors and devices that cannot connect directly to the network Their primary functions include enabling external access to devices within the capillary network and vice versa, supported by access enablers like identification, addressing, and accounting from the operator’s platform This creates a distributed system where both the platform and gateway work together, implementing generic capabilities on the gateway side Additionally, a distinct control flow between the gateway and the operator’s platform is established, separate from the data channel used for transferring M2M application data.
Mapping bulky internet protocols to lightweight versions is crucial for low-power sensor networks However, the relevance of this application may diminish due to the availability of IPv6 implementations for sensor networks, enabling an all-IP approach.
M2M Communication Networks (Network Domain): It covers the communications between the M2M Gateway(s) and M2M application(s), e.g. XDSL, LTE, WiMAX, and WLAN.
M2M applications operate through a middleware layer that processes data via various application services, leveraging the operator's infrastructural assets like access enablers These applications can cater to end users, providing specific M2M solutions, or serve other application providers by offering refined building blocks for developing advanced M2M services Examples include customer care functionalities and sophisticated billing systems While these service enablers may be designed by application providers, they can also be delivered by the operator through their platform.
44 download by : skknchat@gmail.com
Figure 3.4 shows the M2M system with examples of various components and applications.
Figure 3.4: Examples of components of M2M system [30] 3.5 Chapter conclusion
This chapter provides a general overview of some protocols and networking standards that are important for creating one M2M communication.
45 download by : skknchat@gmail.com
The growing number of interconnected machines is set to surpass the global population, highlighting the necessity of comprehending machine-to-machine (M2M) interactions This chapter delves into the fundamental concepts of M2M, including its standards and protocols, as well as the basic architecture and protocol stack associated with M2M communications.
In the coming years, collaborative efforts among standards developing organizations are expected to yield a comprehensive framework for Machine-to-Machine (M2M) communications, enabling support for a wide range of heterogeneous devices.
46 download by : skknchat@gmail.com
Chapter conclusion
In this chapter, we develop a case study ecosystem to manage the lighting in a house with three distinct areas: the first floor, stairs, and second floor The functions of the lighting system are outlined to ensure effective control and optimization of illumination throughout the home.
1 Sensors are installed at each floor and staircases to sense the motion of persons Each time a motion is detected at a sensor, the light is turn on locally at that point.
2 When a person passes by a sensor, for example, in the frst floor, and pass by the next sensor in the staircase connecting the frst and second floor after a while, the light bulb in the second floor should be turn on before the one reaches the second foor.
Function (1) lights up the bulb at the needed area for a person Function
The system intelligently manages floor lighting by activating it before a person arrives, utilizing movement detection from the first to the second floor, ensuring optimal visibility without prior person detection.
Figure 4.1: House design with distribution of the smart devices in each area
47 download by : skknchat@gmail.com
CASE STUDY TESTBED ESTABLISHMENT AND RESULTS
IoT system
Figure 4.2 illustrates the Internet of Things system, the smart device sends data via Bluetooth to the Gateway, and the gateway then sends to the cloud through MQTT protocol.
Figure 4.2: Structure of the Internet of Things system 4.1.1 Smart device
A smart device is an electronic gadget that connects to various devices or networks through wireless protocols like Bluetooth, NFC, WiFi, and 3G, enabling it to function interactively and autonomously In this project, we utilize the Arduino Uno R3 along with a motion sensor (PIR) to create our smart devices.
48 download by : skknchat@gmail.com
Arduino Uno reads the signal from PIR sensor every second and sends to Gateway via Bluetooth.
Receive command “turn on” or “turn off” from the Gateway to control the light of the second floor through the cloud. a) Arduino
The Arduino platform combines hardware and software on a single board, designed to simplify the creation of interactive objects and environments This affordable platform features both analog and digital input/output capabilities, along with various specific components that enable interaction with simple and intelligent devices.
Generally, these models use processors mega AVR, of Atmel corporation
The 2014 microcontroller operates at a voltage of 5V and provides a current of 40mA per pin, with a maximum wire length of 150m using 20 AWG It features 32KB of flash memory, 2KB of SRAM, 1KB of EEPROM, and a clock speed of 16MHz The boards are programmable through Arduino libraries, utilizing a simplified C language abstraction, allowing users without experience in microcontrollers or programming to easily write applications and transfer them to the board using an integrated development environment.
The Arduino IDE facilitates the automatic transmission and execution of programs on the board, utilizing the Arduino library The board features both analog and digital inputs and outputs Digital output involves converting program code into HIGH (1) or LOW (0), corresponding to constant signals of 5V or 0V Digital input interprets these voltage levels to determine HIGH or LOW states Analog readings measure voltage between 0V and 5V through an analog-to-digital converter (ADC), translating values from 0 to 1023 with a sensitivity/error of 4.9mV Additionally, analog output employs pulse width modulation (PWM) to convert code values ranging from 0 to 255 into signals for the pins, effectively simulating varying voltage levels.
The article discusses how analog signals in analog devices can be manipulated using digital methods, specifically by altering the timing of the signal between 5V and 0V This timing, which must vary between 0V and 5V over a duration of 2 milliseconds, is referred to as the duty cycle.
When a programmer inputs a value of 0 for analog writing in their code, the resulting pulse at the pin maintains a 0% duty cycle at 5V This means that an analog device would react as if it were consistently receiving 0V throughout the entire duration.
When a programmer sends a value of 64 in their code, the resulting pulse at the pin maintains a 25% duty cycle at 5V, effectively simulating a constant 0V for an analog device Conversely, sending a value of 127 results in a 50% duty cycle at 5V, which mimics a steady 2.5V output for the same analog device.
When a programmer inputs a value of 191 in analog writing code, it generates a pulse at the pin that maintains a 75% duty cycle at 5V This effectively simulates the continuous stimulation of an analog device as if it were receiving a steady 3.75V signal.
When a programmer inputs a value of 225 in analog writing code, the pulse generated at the pin maintains a 100% duty cycle at 5V This means that an analog device would respond similarly if it consistently received 0.5V throughout the entire duration This relationship is illustrated in Figure 4.3, which depicts Duty Cycle PWM.
50 download by : skknchat@gmail.com
Many manufacturers produce low-cost components designed for compatibility with Arduino's digital and analog inputs and outputs Common components include sensors for measuring air temperature, humidity, soil moisture, pressure, distance, luminosity, fumes, human touch, RFID for firewood management, gyroscopes, infrared, accelerometers, alcohol detection, sound detection, GPS, metal detection, motion detection, color identification, and visible light One notable component is the Passive Infrared (PIR) motion sensor.
PIR sensors, which detect body heat when someone approaches, are compact, energy-efficient, affordable, and user-friendly These attributes make them widely utilized in various applications, including gadgets, home appliances, businesses, and industrial settings When motion is detected, PIR sensors provide a digital output, enhancing their functionality in security and automation systems.
51 download by : skknchat@gmail.com consists of pyro-electric sensor that detects the infrared radiation emitted from humans.
Figure 4.4: PIR sensor Technical parameters
Delay Time: adjustable (0.3 seconds to 18 seconds)
Sensing range: less than 120 degrees angle, 7 meters
A gateway is a network point that acts as an entrance to another network.
On the Internet, a node or stopping point can be either a gateway node or a host (end-point) node [32] we use Raspberry Pi 3 model B as Gateway.
Gateway receives data from the smart device via Bluetooth and sends the data to the cloud through MQTT protocol.
Receive command “turn on” or “turn off” from the cloud and send to a smart device of the second floor.
52 download by : skknchat@gmail.com
If we intend to extend the network, extended smart devices should be edited the python code in Gateway and the javascript code in the cloud.
Introduced in 2006, the Raspberry Pi is a credit card-sized microcontroller designed to facilitate education in programming and support various electronic projects, including home automation, scientific experiments, and music applications Operating on free systems like Debian or Fedora, it utilizes an SD card for storage When connected to a keyboard, mouse, and monitor via USB, the Raspberry Pi functions as a standard Linux computer It supports application development in programming languages such as Python, C, C++, Java, and Ruby, and allows for the installation of additional software compiled for the ARMv6 platform.
The Raspberry Pi, like Arduino, can connect its GPIOs to various circuits from different manufacturers, enabling environmental control and sensing Both platforms are compact and affordable, with Arduino being the smallest and most cost-effective option available.
The main differential of Raspberry pi is in its capacity of process, storage, its applications are bigger than Arduino.
Some Pi 3 Model B Technical Specifcations
4 pole Stereo output and Composite video port; Full size HDMI output;
CSI camera port for connecting the Raspberry Pi camera;
DSI display port for connecting the Raspberry Pi touch screen display;
Micro SD port for loading your operating system and storing data;
Upgraded switched Micro USB power source (now supports up to 2.5 Amps);
53 download by : skknchat@gmail.com
The same form factor as the Pi 2 Model B, the only difference is the location of the onboard LEDs.
A cloud server is a virtual server that operates on a cloud computing platform, providing similar functionalities to traditional servers while being accessible remotely via the Internet Key technologies utilized in the cloud include MongoDB, Mosquitto broker, and Node-Red, with Amazon EC2 serving as the cloud server provider.
The system collects and compares data from the first floor and the stairs, subsequently sending commands to either "turn on" or "turn off" the LED on the second floor Additionally, all received data is stored in a MongoDB database for future reference.
Hardware selection
Description of the experience
After the selection of the material, the operating system Raspbian was installed into the raspberry pi 3 as shown in figure 4.6.
55 download by : skknchat@gmail.com
Figure 4.6: Raspberry Pi interface after installing Rasbian OS
After installing the operating system on the Raspberry Pi 3, connect Pin 1 of the motion sensor to the 5V DC voltage terminal of the Arduino, and connect Pin 3 to the ground (GND) pin of the Arduino.
2, the output, connects to the digital pin D2.
The PIR motion sensor receives the necessary 5V power from the Arduino through connections at pins 1 and 3, enabling it to function effectively.
The Arduino receives output from the motion sensor via pin 2 When no motion is detected, the output remains LOW, resulting in no voltage signal to the Arduino Conversely, when motion is detected, the output becomes HIGH, sending a voltage signal that can activate another device, such as an LED, in the circuit.
To connect the LED, attach the anode to pin 13 and the cathode to the ground of the board This setup eliminates the need for an external resistor, as pin 13 is equipped with built-in resistance to limit the current flowing to the LED.
56 download by : skknchat@gmail.com to limit current flow Figure 4.7 shows the connections between Arduino with PIR Motion sensor and LED.
Figure 4.7: Connection diagram of Arduino LED and Motion sensor [38]
After connect the motion sensor and LED with Arduino, we connect Arduino with Bluetooth module, as shown in table 3.
Table 3: Connection between Bluetooth module and Arduino
57 download by : skknchat@gmail.com
After establishing all necessary connections, we uploaded the Arduino code for the kit located on the first floor and in the stairwell The complete Arduino code for the second floor is available in Appendix A.
The code initializes a SoftwareSerial object named BTSerial on pins 10 and 11 for RX and TX communication It defines several static structures and variables to manage motion detection and input signals In the setup function, it configures pin 13 as an output for an LED and sets its initial state to LOW.
/ put your setup code here, to run once: Serial.begin(9600);
Serial.println("Start"); BTSerial.begin(38400); PT_INIT(&pt1); // initialise the two PT_INIT(&pt2);
58 download by : skknchat@gmail.com
} void SensorMotion(void); void action(); void loop() {
/ put your main code here, to run repeatedly: protothread2(&pt2, 1000); protothread1(&pt1, 1000); protothread3(&pt3, 1000);
} int protothread1(struct pt *pt, int interval) { static unsigned long timestamp = 0; PT_BEGIN(pt); while(1) {
PT_WAIT_UNTIL(pt, millis() - timestamp > interval
); timestamp = millis(); // take a new timestamp getDataFromSensor();
} int protothread2(struct pt *pt, int interval)
59 download by : skknchat@gmail.com
PT_WAIT_UNTIL(pt, millis() - timestamp > interval ); timestamp = millis(); act();
} int protothread3(struct pt *pt, int interval) { static unsigned long timestamp = 0; PT_BEGIN(pt); while(1) {
PT_WAIT_UNTIL(pt, millis() - timestamp > interval ); timestamp = millis(); action();
{ int value = digitalRead(inputPin); if (value == 1) { k;
60 download by : skknchat@gmail.com
BTSerial.print("1"); digitalWrite(led, HIGH);
Serial.println("0"); digitalWrite(led, LOW);
Serial.println(ch); if (ch=="ON"){
61 download by : skknchat@gmail.com digitalWrite(led, HIGH);
After uploading the Arduino codes, the Raspberry Pi 3 was programmed using Python The code incorporates various libraries, including threading, bluetooth, and MQTT, to manage multiple tasks and handle communication efficiently Key components include global variables for message handling and encryption, as well as a structure for controlling message flow and system status.
62 download by : skknchat@gmail.com status = '' global sockActuator global q
# This function scan bluetooth devices around Pi and return a tupple
To initiate the process, first call the function to discover nearby Bluetooth devices by executing `bluetooth.discover_devices(duration=3, lookup_names=True)`, which will return a list of devices Next, set up a queue and initialize several dictionaries and lists, including `q=Queue()`, `pkt={}`, `packet={}`, `sock={}`, and `myThread=[]` Configure the MQTT topics with `in_topic="Ofico/controls/in/#"` and `out_topic="Ofco1/controls/#"` Create an MQTT client instance and set the username and password using `client.username_pw_set("ioteam", "ioteam")` Additionally, create another MQTT client for control commands, set its credentials, and connect it to the MQTT broker at the IP address "52.77.88.152" on port 1883 with a keep-alive interval of 60 seconds.
#client_control.connect("192.168.1.104", 1883, 60) def on_publish(client, userdata, mid): print("Published: ",mid)
63 download by : skknchat@gmail.com def on_connect(client, userdata, rc): print("Connected with result code
The code snippet demonstrates the use of the MQTT protocol for message publishing and subscribing It initializes two MQTT clients, one for publishing and another for subscribing, with authentication credentials The subscriber listens for messages on a specified topic and processes incoming messages through the `on_message` callback function, which adds the message payload to a queue and prints it Additionally, a control message is handled by a separate `on_messageControl` function, updating a global variable with the received payload The client connects to a broker at the specified IP address and port.
#client_pub.connect("192.168.1.104", 1883, 60) client_pub.on_connect = on_connect client_pub.on_publish = on_publish client_sub.username_pw_set("ioteam","ioteam") client_sub.connect("52.77.88.152", 1883, 60)
#client_sub.connect("192.168.1.104", 1883, 60) client_sub.on_connect = on_connect client_sub.on_message = on_message client_control.on_message = on_messageControl
The code snippet involves a threading lock to manage concurrent access to a shared resource The `sub_command` function initiates an infinite loop for the client subscriber, while the `analyse_data` function acquires the lock to safely process data from a queue, splits it using a delimiter, and then puts the processed result back into the queue before releasing the lock The `pub_request` function is also defined but not detailed in the provided content.
#while 1 : client_pub.publish(in_topic,"request")
The provided code snippet demonstrates the implementation of a threaded example using Python's `threading` module It defines a class `exampleThread` that inherits from `Thread`, initializing with a thread ID, name, and target address The `run` method establishes a Bluetooth socket for the thread, allowing for concurrent operations This approach utilizes a reentrant lock to ensure thread safety during execution.
The code snippet demonstrates a Bluetooth connection using RFCOMM, where a socket is established with a target address It continuously receives data in 4-byte packets, appending them to a message list The received packet is then printed along with the target address Additionally, a client connects to a specified IP address and port for further communication.
To connect to the MQTT broker at IP address 192.168.1.104 on port 1883, use the command `client.connect("192.168.1.104", 1883, 60)` Publish messages to the MQTT topic "Ofico/" with the payload consisting of the target address and the last element of the packet for the specified thread ID The message format includes the MAC address and sensor status, constructed from the control message list If the target address matches "20:15:04:09:09:10," the appropriate actions will be executed.
#~ msg = ''.join(controlMesg) print msg
To initiate the download process, send a message using the specified socket if the message is not empty Release the lock and pause for one second Define a list of MAC addresses and iterate through it to compare with nearby devices If a match is found, append the device to the results list Print the results, and for each matched device, create a new thread with the device's topic name and MAC address Subscribe to the output topic and start the client control loop Finally, start each thread to handle the processing concurrently.
67 download by : skknchat@gmail.com
4.3.1 Protocol for the connection between Smart Device Gateway
When running the python code, frstly it receives the signal of smart devices via Bluetooth modules as shown in figure 4.8.
Figure 4.8: Bluetooth connection between smart devices with Gateway 4.3.2 Architecture
An ecosystem was developed based on the understanding of various IoT platforms, as illustrated in Figure 4.9 In this setup, Arduino and Raspberry Pi communicate using Bluetooth, while the Raspberry Pi connects to the cloud through the MQTT protocol.
In the Cloud, we have Nde-Red, MongoDB and Mosquitto broker.
68 download by : skknchat@gmail.com
Figure 4.9: IoT ecosystem 4.3.3 Operation Modes
Results
While executing Python code on a Raspberry Pi, we monitored the data transmitted by a PIR sensor The results, illustrated in Figure 4.10, indicate that three devices are actively sending data: one device located on the first floor (UI: '20:15:04:08:35:23') and two devices positioned in the stairwell area (UI: '20:15:04:09:09:14') and on the second floor (UI: '20:15:04:09:09:10').
20:15:04:08:35:23-1 meaning that the sensor detects movement in the frst foor and the LED light turns on;
20:15:04:09:09:14-1 meaning that the sensor detects movement in the stairs and the LED light turns on;
The sensor detects movement on the second floor, triggering the LED light to turn on, while simultaneously, the cloud system recognizes that the LEDs on the first floor and the stairs are also illuminated.
20:15:04:08:35:23-0 meaning that the sensor does not detect movement in the frst foor and the LED remains off;
20:15:04:09:09:14-0 meaning that the sensor does not detect movement in the stairs area and the LED remains off;
The timestamp 20:15:04:09:09:10-0 indicates that the sensor has not detected any movement on the second floor, and the cloud system confirms that the LED lights on both the first floor and the staircase are turned off.
ON meaning that the cloud detects that in the frst foor and stairs the LED turns on, so it sends “turn on” to the LED of the second floor;
123ON meaning that all LEDs are “turns on”.
70 download by : skknchat@gmail.com
When a Gateway receives data sensors sends to the cloud through
The MQTT protocol, integrated with the cloud, utilizes Node-RED to receive data from the MQTT broker, which is then stored in a MongoDB database Figure 4.11 illustrates the implementation of Node-RED in our system.
71 download by : skknchat@gmail.com
In the cloud environment, we implement a code that activates the second-floor LED when the LEDs on the first floor and stairs are turned on This functionality is achieved through JavaScript code within the Node-RED function block, specifically using the variable "f." The code processes incoming messages by splitting the payload, extracting the MAC address and value, and checking if the MAC address matches "20:15:04:08:35:23."
{ context.global.floor1 Number(messArr[1]);
{ context.global.stair = Number(messArr[1]);
72 download by : skknchat@gmail.com if ((context.global.foor1 === 1)&&(context.global.stair === 1)){ context.global.foor2 = "ON";
} else { context.global.floor2 = "OFF";
To access the RockMongo interface, simply enter the server's IP address in your browser's URL address bar, which will display the interface as shown in figure 4.12.
Figure 4.12: Login for access the interface RockMongo
The data sensor is stored in MongoDB using the MQTT communication protocol, as illustrated in Figure 4.13 The stored information is organized by the unique identifier of the Bluetooth module, with sensor data represented as either 1 or 0 A value of 1 indicates motion detection by the PIR sensor, while a value of 0 signifies no motion detected.
73 download by : skknchat@gmail.com
Figure 4.13: Interface RockMongo (management software MongoDB)
Figure 4.14 illustrates Testbed for the Usecase Ecosystem where we can check in fgure three smart devices connected the power in each area, the Gateway and the LEDs.
74 download by : skknchat@gmail.com
Figure 4.14: Testbed for the Usecase Ecosystem
75 download by : skknchat@gmail.com
In conclusion, this thesis highlights the significant potential of the Internet of Things (IoT) in creating applications that offer numerous benefits, extending beyond network sectors to positively impact humanity as a whole.
The Internet of Things (IoT) drives significant advancements and discoveries in society by generating vast amounts of data for processing and enhancing data communication capabilities As data generation increases, so does the potential for knowledge and insights However, this thesis highlights a notable gap in research regarding the national origin of IoT studies, indicating a scarcity of information in this area In contrast, extensive documentation and research on IoT have been developed in countries like China, the United States, and various European nations Ultimately, this thesis successfully achieves its primary objective of implementing an IoT infrastructure utilizing a specific communication protocol.
During our practical work implementation, we encountered numerous challenges related to Internet connectivity, which hindered our success To overcome these issues, we recommend using a high-speed Internet connection Additionally, it is essential to study the relevant theories beforehand to gain a deeper understanding of the Internet of Things (IoT) This knowledge is crucial, as advocates of IoT envision a future where we are interconnected with virtually every conceivable object.
76 download by : skknchat@gmail.com
[1] D Evans.(2011), "The Internet of things-How the Next Evolution of the Internet Is Changing Everything," Cisco Internet Business Solutions Group.
[2] L TAN and N WANG.(2010), "Future Internet: The Internet of Things.," computer science and Tecnology Department East China Nrmal university, Shanghai.
[3] A A LOUREIRO.(2003), "WSN", Minas Gerais: Departamento de Ciencias da Computacão da Universidade Federal de Minas Gerais, Belo Horizonte.
[4] Y JIANG, L ZHANG and L WANG (2013), "Wireless Sensor Networks and the Internet of Things International Journal of Distributed Sensor Networks Research Center for Mobile Computing," Tsinghua University, Institute of Microelectronics, China.
[5] L Coertzee and J Eksteen (2011), "The Internet of Things - promise for the future? An introduction," in IST- Africa conference Proceedings.
[6] R.Arpita and et al (April 2015), international Journal of Engineering Studies and technical Approach, vol 01.
[7] H.-X ZHAO (2010), "Internet of Things key technology Analysis and Discussion [J] Western Technology," China.
[8] V Ovidiu and P Friess (2014), "Internet of things-From research and Innovation to market Deployment", River pbublishers, pp 11-19.
[9] [Online] Available: http://www.codeproject.com/Articles/832492/Stage- Introduction-to-the-Internet-of-Things [Accessed 20 08 2015].
[10] N Bhumi and C Tushar (December 2015), "study of various internet of things platforms," International Journal of Computer Science & Engineering Survey (IJCSES, vol 6.
77 download by : skknchat@gmail.com
[11] [Online]Available:https://cloud.google.com/solutions/architecture/streampro cessing [Accessed 15 05 2016].
[12] [Online] Available: https://internetofthings.ibmcloud.com [Accessed
[13] [Online].Available:http://www10.mcadcafe.com/blogs/jeffrowe/2015/05/14/ ptc-thingworx-converges-on-iot/ [Accessed 20 04 2016].
[14] [Online] Available: http://community.thingspeak.com/2014/05/connecting- electric-imp-to-thingspeak-iot-data-services/ [Accessed 21 04 2016].
[15] [Online] Available: https://www.linkedin.com/pulse/microsoft-azure-iot- complete-cloud-platform-your-modern-pvt-ltd- [Accessed 10 05 2016].
[16] C Qu, "Development trend and Prospect of the Internet of Things information construction," 2009.
[17] [Online].Available:http://www.rs-online.com/designspark/electronics/ knowledge-item/eleven-internet-of-things-iot-protocols-you-need-to-know-about [Accessed
[18] [Online] Available: http://www.codeproject.com/Articles/833234/Internet- of-things-Overview [Accessed 28 02 2016].
[19] [Online] Available: http://postscapes.com/internet-of-things- protocols [Accessed 22 04 2016].
[20] R Stefanov (2013), "Security and trust in IoT/M2M – Cloud based platform," Aalborg University.
[21] I T Union (2005), " The Internet of Things Executive Summary," ITU Internet Reports , Geneva.
[22] [Online].Available:https://www.ida.gov.sg/~/media/Files/Infocomm%20Lan
78 download by : skknchat@gmail.com dscape/Technology/TechnologyRoadmap/InternetOfThings.pdf [Accessed 20 04 2016].
[23] [Online] Available: https://opentechdiary.wordpress.com/tag/internet- of-things/ [Accessed 26 02 2016].
[24] S KALYONCU (2013), "Wireless Solutions and Authentication
Mechanisms for Contiki Based Internet of Things Networks,".
[25] A.-Q A.S and e al (December 2015), "inter Journal of Engineering Research and Applications", vol 05.
[26] [Online] Available: http://www.ecnmag.com/article/2012/11/machine- machine-communications-%E2%80%93-facebook-smart-devices [Accessed 01 05 2016].
[27] ITU (2014), "ITU-T Focus Group on M2M Service Layer: M2M service layer: APIs and protocols overview".
[28] [Online].Available:http://dspace.howest.be/bitstream/10046/1184/1/LanderA rnoys.pdf [Accessed 02 06 2016].
[29] E Asma, R Steinke and T Magedanz (2016), "AdM2M: Adaptable Machine-to-Machine Transport Framework," Technical University Berlin, Berlin.
[30] [Online].Available:http://tec.gov.in/pdf/Studypaper/White%20Paper%20on
%20Machine-to-Machine%20(M2M)Communication.pdf [Accessed 20 05 2016].
[31] [Online] Available: http://nerduino.blogspot.com/2013/04/o-que-e- pwm.html [Accessed 18 05 2016].
//internetofthingsagenda.techtarget.com/definition/gateway [Accessed 08 07
79 download by : skknchat@gmail.com
[33] [Online] Available: http://www.ecnmag.com/article/2012/11/machine- machine-communications-%E2%80%93-facebook-smart-devices [Accessed 01
[34] [Online] Available: https://www.techopedia.com/defnition/29019/cloud- server [Accessed 08 07 2016].
[35] [Online].Available: https://www.techopedia.com/definition/30340/mongodb [Accessed 08 07 2016].
[36] [Online] Available: https://github.com/mqtt/mqtt.github.io/wiki/Mosquitto- Message-Broker [Accessed 9 07 2016].
[37] [Online] Available: https://www.e-education.psu.edu/geog865/node/261 [Accessed 08 07 2016].
[38] [Online].Available:http://www.learningaboutelectronics.com/Articles/Ardui no-motion-sensor-light-circuit.php [Accessed 20 05 2016].
80 download by : skknchat@gmail.com
Appendix A: Arduino code for the Second Floor
In the setup function of the code, the LED on pin 13 is configured as an output and initially set to a low state The program defines a static structure with three instances (pt1, pt2, pt3) and initializes a boolean variable for conditions It also sets the input pin to 2, declares a character for data checking, and introduces a boolean variable to detect motion, along with integer variables for value and a counter.
/ put your setup code here, to run once: Serial.begin(9600);
Serial.println("Start"); BTSerial.begin(38400); PT_INIT(&pt1); // initialise the two PT_INIT(&pt2);
81 download by : skknchat@gmail.com void SensorMotion(void); void action(); void loop() {
/ put your main code here, to run repeatedly: protothread2(&pt2, 1000); protothread1(&pt1, 1000); protothread3(&pt3, 1000);
} int protothread1(struct pt *pt, int interval) { static unsigned long timestamp = 0; PT_BEGIN(pt); while(1) {
PT_WAIT_UNTIL(pt, millis() - timestamp > interval
); timestamp = millis(); // take a new timestamp getDataFromSensor();
} int protothread2(struct pt *pt, int interval) { static unsigned long timestamp = 0; PT_BEGIN(pt); while(1) {
82 download by : skknchat@gmail.com
PT_WAIT_UNTIL(pt, millis() - timestamp > interval ); timestamp = millis(); act();
} int protothread3(struct pt *pt, int interval) { static unsigned long timestamp = 0; PT_BEGIN(pt); while(1) {
PT_WAIT_UNTIL(pt, millis() - timestamp > interval ); timestamp = millis(); action();
{ int value = digitalRead(inputPin); if (value == 1) { k;
83 download by : skknchat@gmail.com void act()
BTSerial.print("1"); digitalWrite(led, HIGH);
Serial.println("0"); digitalWrite(led, LOW);
Serial.println(ch); if (ch=="ON"){ if (k