Lesson Introduction to CupCarbon - Internet of Things - ثاني ثانوي

308 8. IoT Wireless Sensor Network Simulation In this unit, you will learn the loT technologies that are used in smart industry and manufacturing. Students will use CupCarbon to create and simulate sensor networks. Finally, you will create a Fire Surveillance and Notification prototype and a Smart Industry and Automation prototype. Learning Objectives In this unit, you will learn to: > Recognise loT technologies in manufacturing. > Define the use of the Industrial Automation and Control Systems in the connected factory. > Create and visualize IoT networks using CupCarbon. > Simulate an IoT network using CupCarbon. > Create Python scripts to program the nodes of a network. > Create a Fire Surveillance and Notification loT prototype. > Create a Smart Industry and Automation loT prototype. Tosis > CupCarbon

Lesson 1 Introduction to CupCarbon

Lesson 1 Introduction to CupCarbon Link to dielecom www.len edux Smart Industry loT technologies affect all areas of life and industry is no different. Cost minimization and efficiency improvement have always been vital, but as industrial models evolve and competition rises, the emphasis is turning to innovation and enhanced business models. After decades of squeezing costs out of manufacturing processes and the supply chain, businesses are beginning to realize that additional cost reduction may hinder customer service and production quality. Several loT-related technologies are at the core of the digital disruption in manufacturing: وزارة التعليم Data-Driven Manufacturing Big data is transforming the industry. Manufacturers can have access to all machine-generated data to monitor quality control in real-time, enhance Overall Equipment Effectiveness (OEE), and decrease unscheduled downtime. OEE is a well recognized indicator of industrial productivity. Additionally, manufacturers are researching methods to use this data to facilitate quick retooling in response to market shifts and other demands. Operational Technology (OT) and Information Technology (IT) Convergence In the context of the Internet of Things (IoT) in a manufacturing environment, operational technology consists of Programmable Logic Controllers (PLCs), computers, and other technology that is frequently similar to IT technology but is controlled and owned by business operations outside of IT. IP networking enables deeper machine and factory integration, and the distinction between factory and business networks is disappearing. Manufacturers are seeking methods to integrate their processes under a unified networking infrastructure, pushing beyond traditional silos. Improved Technology with Lower Costs Connectivity, monitoring, and optimization of machines are becoming scalable, automated, and platform-based as a result of the emergence of new technologies. In this advanced stage of technology, machines may be considered part of a fully interconnected network system, as opposed to isolated systems. The convergence of computation, networking and security reduces the cost of connecting devices. Enhanced Efficiency and Safety Factories, especially in the food and beverage sector, are seeking ways to achieve zero-touch processes, to automate manual activities. IoT, along with robotics and image processing can enable a modern factory to improve efficiency and safety. 2173-146 100

Lesson 1 Introduction to CupCarbon

An Architecture for the Connected Factory Companies are beginning to integrate their Industrial Automation and Control Systems (IACS) with IT applications and analytics tools to deliver operational and business-beneficial control and analytics capabilities. IACS are used either to control basic processes or to monitor that safety measures are employed when an abnormal condition occurs. The objectives of IACS are quality and efficiency in production while maintaining a high level of integrity and reliability. Modbus/TCP In the industrial sector, Modbus is most frequently employed for master/slave administration. Modbus has been converted to current communications protocols, such as Ethernet and TCP/IP, similar to other automation control technologies. Modbus is widely used because the protocol is an open, documented standard that is well-established worldwide. The Modbus master/slave arrangement is well-suited to the connection- oriented nature of TCP, however this way of communication is often less versatile. Slane Loop control sensor Server Network Master Slave Power control sensor Eigum & Mudhus network promenl Slave Flow control sensor Connected Factory Challenges The manufacturing industry has been one of the primary targets of cybercriminals. The convergence of factory and business networks opens security holes to factory processes that were traditionally isolated. Frequently, the solution has been simply to isolate the factory floor network from the IT corporate network. However a network disconnected from higher-layer processes will have limited capabilities and loT-enabled business enhancements. In addition, several potential risks emerge from laptops and workstations on the plant floor that are physically available to contractors or workers with unrestricted access.

Lesson 1 Introduction to CupCarbon

Edge Computing in the Connected Factory The machines on the factory floor can generate vast quantities of data. Many factories have addressed this issue by deploying computers to capture this data. Collecting data from computers on the factory floor has created maintenance and security issues, as each computer requires operating system patches and upgrades. Hardware failures are also prevalent, as equipment is frequently not designed to withstand factory conditions. Clearly, this method makes it extremely challenging for manufacturing operations to efficiently gather, process, and respond to data. Such an approach is a huge hindrance to the visibility and potential commercial benefits that industrial data analytics might provide. New developments in computation capability at the network's edge are aiding in the resolution of these issues. With machine-embedded and near-machine edge computing devices that incorporate switching, routing, and security in a single durable form factor, manufacturers are beginning to recognize the advantages of linking machines and edge computing services. Oil and Gas Industry Oil and gas are two of the most important resources utilized by modern society. From transportation infrastructure to the supply of plastics, almost every element of modern life depends on the availability of these commodities. Today, oil and gas firms are primarily concerned with reducing costs, increasing efficiency and speed, and maximizing returns on current investments. Controlling production costs and enhancing the overall health and safety of hazardous settings are among the most critical Key Performance Indicators (KPIs) of the sector. Similarly to other sectors, oll and gas firms use the Internet of Things for a number of purposes, including the following: • Monitoring the state or behavior of industrial equipment for visibility and control. ⚫ Maximizing process and resource utilization. • Improving business decision making. Tigure 2: Oll productiommon comm Industry Key Challenges as Digitization Drivers The Internet of Things (IoT) and digitization-the process of utilizing breakthroughs in information technology to develop new solutions and technologies for operations, work processes, and methods-are paving the way for previously impossible efficiency gains and new business models. Advanced modeling and analytics. ■ Big data. ⚫IT/QT convergence. Smart machines. Mobility and cloud. Performance management. 2173-1445 Example The Uthmaniyah Gas Plant is one of KSA's largest gas processing plants. IoT and Al solutions enhance productivity and facility reliability. Drones and smart objects monitor gas pipeline refinery equipment and use data analysis methods to optimize their usage. Thousands of loT-enabled sensors monitor the Khurais oil field to predict the oil's state in the wells. These methods reduce energy usage and maintenance expenses. 311

Lesson 1 Introduction to CupCarbon

What CupCarbon is CupCarbon is a Smart City and Internet of Things Wireless Sensor Network simulator. It can be used to design, create and visualize IoT networks consisting of nodes, devices and events, among others. It provides a plethora of tools in order to configure the networks created, test and optimize them. Popular protocols you have been taught are included such as Zigbee, Wi-Fi and LoRa, plus with OpenStreetMap used as an interface so the simulations can take place anywhere, even CupCarbon in your neighborhood! After successfully creating your desired network, CupCarbon can supply code for your physical Arduino microcontrollers, so you can try it out on real hardware. The nodes communicate with each other with scripts. The simulator uses its own programming language, SenScript and also supports Python. In this unit, you will program the nodes with Python. S LIN A عليم J1123-1465 Figure 3: A CupCarbon project 712

Lesson 1 Introduction to CupCarbon

To download and run CupCarbon: > Open your browser and download the file from http://binary-academy.com/dnld/KSA/IOT2/BinaryCupCarbon.zip > Open the File Explorer and find the downloaded file in Downloads. > Right click on the file and choose Extract All.... > Choose your Desktop as a destination for the extraction and click Extract. > Find the extracted folder in you Desktop and open in. > Double-click CupCarbon.jar to start CupCarbon. Quic Download THPC Desine 1 This PC Downloads Oncuments Town 2 Pictures Videos Dewal Bally Open Openin Share with Skype Extract All Filco Start 3 Stan with Microsoft Defender. Share Open with Gy access to > Restore previous versions Send to Cul Copy ct Dem Revame Make sure to have JAVA Installed on your entranter so that QuyCarbon can run property. Everact Compressed (Tippel Fenders Selena Degina and ExFles Au will dif Show tracted lies when complace 5 MineryCupCabon 4 Ohive Perera CC6 Til PC Documente Figure 2. Duwlating CupCarton 313

Lesson 1 Introduction to CupCarbon

The CupCarbon Windows When you open the program you will notice two windows: the Main Window containing the Map and the Console. Menu Bar Parameter Menu Toolbar State Bar Мар Tigure 5-CupCarbon Man Window The Console is used for printing messages created by the simulation, and also for providing error messages to help the user debug erroneous scripts. Console Console وزارة التعليم 2003-8 Figure 5: CumCartion Console 0

Lesson 1 Introduction to CupCarbon

Getting started In this lesson, you are going to create a simple simulation of an loT node printing messages in order to familiarize yourself with the CupCarbon environment. First, you must create a new project: To create a new project: > Click on the New Project button on the Toolbar. > Choose your desired location for the project to be stored, type "My First CupCarbon Simulation" in the field File name and click on Save. CupCarbon IoT 5.0 Project Edit Add Display Selection Solver Simulation Map Personal Help 1 work Information ▷ Devices & Onjects ▸ Device Parameters ▸ Radio Patemiters ▸ Marker Parameters ▸ Simulation Parametr Neil Cup Carty Project Talk Quick acom File My Chy Catory S 2 وزارة التعليم 2173-19 Figure 87 Creating a new project 3 314

Lesson 1 Introduction to CupCarbon

716 J Placing a node On the toolbar you can find the various objects you are going to use in your projects, that either produce signals and communicate with each other or trigger events. One such object is the loT Node which can be placed on the map and it can be given a Script file to run. Nodes are the fundamental building blocks of CupCarbon. They display their ID number and have two circles around them: the inner is the sensor radius used for detecting sensors and the outer circle is used for detecting radio devices, like other nodes. To place a node: > Click on the loT Node button on the Toolbar > Click on the Map to place the node. > Click on the All button from the State Bar > Press Esc. 1 3 2 figure 88: Placing a node Creating a script Now you will create a simple script that will be printing two messages in alternation on the node itself. The Python code you will use is the following: se proper Make sure Indehtatida of the loop for the script to run properly import time while node.loop(): node.print("hello") time.sleep(1) node.print("world") time.sleep(1) 2173-1865

Lesson 1 Introduction to CupCarbon

First you must include the python time library, as you will be using the sleep function included to delay the prints. The actual instructions for the node have to be encapsulated inside the while node.loop().. The node can print on itself by using node.print() and it can "sleep"-do nothing- by using time.sleep(). The print() function takes as a parameter the message to be printed in string forme.g. node.print("hello world") and the sleep() function takes as a parameter a positive number, for as many seconds as you want the node to by delayed e.g. with time.sleep(3) the node will sleep for 3 seconds. In your program, the node will print "hello", sleep for 1 second, print "world", sleep again for 1 second and then start from the top again, It will continue to run forever, unless you stop the simulation. To create a script: > Click on the Python button on the Toolbar. > Type the Python code into the field. > Type hello in the File name field. > Click Save. > Close the Python Editor window. CupCerbon lot 5.0 [C\CupCarbon Projects\My Firs Project Edil And Display Selection Saver N 1 Pythian Editor 3 import time while node.loop(): node print ("hello") time sleep (1) node.print("world") time, aloup (1) مراية سليم 173-1445 2 > Man 4 × 5 Figure 8.9. Python aditor 17

Lesson 1 Introduction to CupCarbon

To insert the script and run the simulation: > Click on the node. > Click on the Device Parameters tab on the Parameter Menu. 2 > Click on the Script file box. > From the drop down menu, choose the hello.py script and click on the button on the right to insert the script into the node. > Click on the Save Project button on the Toolbar. > On the Toolbar, click on the Run IoT Simulation button. CupCarbon IoT 5.0 CACupCarbon Projects My First CupCarbon Simulation My First CupCarbon Simulation.cup) Project Edit Display Smection Solver Simutation Map Parsons Help D& Device 2 3 SCHO 217; 11)* 176 I 14.77 S 0.0 200 Sang Cana Sensing Unir 20 9800 1.08-1 B ALD وزارة التعليم ར - ན ན ་ - - - - ན ‧ ན ད ན 4 6 Click to Stop lot Simulation. to step the simulation. 1 gure 8.10 Inserting the script and running the simulaten

Lesson 1 Introduction to CupCarbon

As expected, the node alternates between printing the strings "hello" and "world" for 1 second each. درارة التعليم כסון Figure The states of the simillation

Lesson 1 Introduction to CupCarbon

Exercises 1 Read the sentences and tick True or False. 1. Data monitoring cannot be used to enhance overall equipment effectiveness. 2. OT and IT departments can merge all manufacturing sectors under a single networking domain. 3. Connecting the devices of a factory under a single network can reduce costs. 4. Zero-touch automated processes in a food and beverage factory can improve the quality of the final product 5. PC workstations on factory floors do not create security risks. 6. Devices in a factory that are not connected to an edge network can lose valuable data if they malfunction. 7. IoT systems in the oil and gas industries can prevent hazardous scenarios for workers 8. CupCarbon can simulate the connection protocol Zigbee for smart objects. 9. CupCarbon nodes can be programmed exclusively with Python. 10. CupCarbon can produce sketches for physical microcontrollers such as Arduino. True False 2 Classify the main loT technologies that disrupt traditional manufacturing operations. وزارة التعليم 11-1445

Lesson 1 Introduction to CupCarbon

3 Analyze how factories connected to loT systems are vulnerable to cyberattacks. 4 Describe how edge computing on connected factories can improve their efficiency and production capabilities. وزارة التعليم

Lesson 1 Introduction to CupCarbon

5 State how smart Industry loT solutions can be used to optimize processes in the oil and gas industry. 6 In CupCarbon, create a node and a Python script for it. This script will have a loop that will make the node print the message "A" for 1 second, "B" for 2 seconds, and "C" for 3 seconds. Program the node and run the simulation. 7 in CupCartfan create two nodes and a Python for each one. Each script will display a repeated "blink" message. Each node will send the message when the other is inactive. Praghan the nodes and run the simulation. 1-15

Lesson 1 Introduction to CupCarbon