The Smart Cyber Ecosystem for Sustainable Development. Группа авторов
Чтение книги онлайн.

Читать онлайн книгу The Smart Cyber Ecosystem for Sustainable Development - Группа авторов страница 16

СКАЧАТЬ Prerequisite Arduino micro-controller board, USB connector, LED, respective capacity of Registers, Bread board, Connecting wires Arduino IDE Process ✓ Using connecting wires, set LED on breadboard and connect it to Arduino Using USB connector, connects Arduino board to PC • Select Board and Port type • Write equivalent Sketch in Arduino IDE Verify sketch and upload it

      Sample Arduino “Sketch” for Blinking LED: void Setup( ) { pinMode(12, OUTPUT); // set arduino pin number 12 for digital output } void Loop( ) { DigitalWriter(12,HIGH); // Turn ON the LED Delay(500); // wait for 500 millisecond = 0.5 second DigitalWriter(12,LOW); //Turn OFF the LED Delay(500); // wait for 500 millisecond = 0.5 second }

      As shown in Figure 1.5 Raspberry Pi is a low-cost, single-board, palm-size computer that provides easy access. Raspberry Pi has higher processing capabilities and more features compared to Arduino [23]. So, such programming technology is better when we have more data for processing such as image and multimedia sensor data processing. To do so, we can download freely available Raspberry Pi–based operating systems which are GUI-based systems. For example, Raspbian and Noobs are officially supported OS for Raspberry Pi. Other operating systems that also support this technology are Windows 10 core, Snappy Ubuntu code, Ubuntu Mate, Pinet, and Risc OS. Supported programming languages for Raspberry Pi are C, C++, JAVA, Python, and Ruby. The following Raspberry device can act as a server as well as a node in IoT networking. So, we can create an interactive environment using such a network of connected devices.

      We can have an IoT-based system that can perform different tasks such as collecting data from connected sensors of the network, send such received data to a remote machine or server, process the data, and respond accordingly in the IoT network. For example, suppose we have a digital DHT (Digital Humidity Temperature) sensor that senses the data of the surrounding environment. Collected data is then transferred to server and saved on server for further processing and after processing such information is updated on screen based on responses available from the network.

      To do so, we require a digital humidity temperature sensor, register, jumper wires, and Raspberry Pi unit. As shown in Figure 1.6, DHT sensors have four pins numbered as 1, 2, 3, and 4. Pin 1 used for power supply of 3.3 to 5.0 V, pin 2 used for data, pin 3 is null, and pin 4 utilized for ground. So, connect pin 1 of DHT sensor to the 3.3V pin of Raspberry Pi, connect pin 2 of DHT sensor to any input pin of Raspberry Pi and connect pin 4 of DHT sensor to ground of Raspberry Pi. So, after establishing connection of DHT sensor with Raspberry Pi, reading data from sensor using “.read_retry” method consists in “Adafruit” library of DHT22 sensor. To transfer data to the server, we can establish a connection between client and server, send data from client to server and then save the data in a particular file at server end in the form of a log file. Data processing is done at server end that may include filtering and plotting of data. Due to lack of data, there may be a chance of incomplete or corrupted data so to overcome such data, and we need preprocessing activity such as cleansing and to do so we use filtering over here. To plot the 2D data at the server end, a Python library MATPLOTLIB can be utilized.

Photo depicts raspberry Pi 4.

      Figure 1.5 Raspberry Pi 4 [24].

      Figure 1.6 DHT sensor [29].

      In this way, using a DHT sensor with Raspberry Pi, we can monitor the value of humidity and temperature on screen with the help of GUI. Even we can extend/update the script and instruct the rotary motor as an actuator to actuate (start fan) when certain room temperature increases. So, these are some of the modest applications of IoT in real-world environments that can be implemented using Raspberry Pi.

      1.5.3 Python

      As a lightweight versatile scripting programming language, Python is very much popular and useful in IoT-based application development [25]. It provides some kind of relaxed environment, i.e., it does not follow strict rules. Python-Integrated Development Environment (IDE) provides several modules and libraries, using which one can establish connectivity with many hardware and also compatible with multiple OS such as windows, Linux, and MAC. Well-known Python IDEs are Spyder and PyCharm.

      To perform file operation in Python, we do not require any separate library, and it is an in-built function such as open(), read(), write(), and close(). Python supports various file formats to perform such operations like .Txt file and .CSV file. This feature makes data management easier using python programming language. If our data file is of the type of image, then we have a Python Image Library (PIL) to do the process with such a file. In this library, there are famous functions/methods like open(), show(), resize(), rotate(), print(), and convert() to do various tasks on such images that are contained in an image file.

      Thus, Python is a versatile object oriented programming language that provides an easy environment in open source community software for the development of IoT-based applications.

      With the collaboration and co-operation of other technology involved with IoT, it has vast scope in various IoT-based applications such as Smart Home, Smart Healthcare, Smart Transportation, Smart Asset Management, and Smart Farm [26]. Such applications will create a paradigm shift in the traditional lifestyle of human beings and that is why nowadays the popularity of IoT is much more than other existing technologies. Some of the well-known IoT applications are as given below.

      Smart Home

      Smart home as an IoT application contains features like integration of various IoT-enabled devices, provides securities amongst them, and enables networking using central controlled devices and its related security features that adapt a traditional home into technically enriched sophisticated home. Such IoT-enabled devices monitor some important aspects for home such as remote air conditioning, heating, and ventilation management using smart phones. It also performs the operation management by communicating with different IoT-enabled devices of home like IoT-enabled fan, tube light, oven, and washing machine.

      Smart Healthcare

      Such smart healthcare applications are also known as the Internet of Medical Things (IoMT). Its popular applications are “Remote Health Monitoring” and “Emergency Notifications System” [27]. There are many devices that can monitor the number of health parameters of human beings. IoT-enabled devices, by collaborating communication with medical manifesto, can monitor the heartbeat and blood pressure and, with proper medical surgery, can also act as pacemaker. “Smart Bed” is an instrumental bed which maintains a patient’s regular checkups without any human intervention (nurse). Moreover, such smart beds can also be connected using smart sensors that can acquire СКАЧАТЬ