Professional Documents
Culture Documents
https://www.mdpi.com/1424-8220/18/9/2796
https://www.thesandreckoner.co.uk/model-viewing-internet-things/ 1
The Road Map to Industry 4.0 Revolution
The integration of current technologies such as Sensors, Robotics, Internet of Things (IoT),
Internet of People, Internet of Services, Cyber Physical Systems (CPS), 3D Printing, AR/VR,
Wireless and Mobile Networks, Cloud Computing Platforms, Big Data Analytics and Mining,
Artificial Intelligence , Deep Learning, Machine Learning, and Information Management
Systems has led to develop Smart Environment such as Smart City.
New business model that is changing us in the way we behave, conduct ourselves,
interact, produce, transport and consume.
Impacting all disciplines, economies and industries, and even changing us.
The changes are historic in terms of their size, speed and scope, velocity, breadth & depth and
systems Impact: across and within, companies, industries, countries and society as a whole.
All stakeholders of governments, business, industry, academia, and global civil society – have a
responsibility to work together to better understand the emerging trends.
2
Physical
World
‘Domain’
3
Biological
World
‘Domain’
It took more than 10 years, at a cost of $2.7 billion, to complete the Human Genome Project. Today, a genome can be
sequenced in a few hours and for less than a thousand dollars.
Synthetic biology is the next step. It will provide us with the ability to customize organisms by writing DNA. Setting
aside the profound ethical issues this raises, these advances will not only have a profound and immediate impact on
medicine but also on agriculture and the production of biofuels.
The ability to edit biology can be applied to practically any cell type, enabling the creation of genetically modified
plants or animals, as well as modifying the cells of adult organisms including humans.
3D manufacturing will be combined with gene editing to produce living tissues for the purpose of tissue repair and
regeneration – a process called bioprinting
To return to the issue of genetic editing, that it is now far easier to manipulate with precision the human genome within
viable embryos means that we are likely to see the advent of designer babies in the future who possess particular traits or
who are resistant to a specific disease.
Needless to say, discussions about the opportunities and challenges of these capabilities are underway. Notably, in
December 2015, the National Academy of Sciences and National Academy of Medicine of the US, the Chinese
Academy of Sciences and the Royal Society of the UK convened an International Summit on Human Gene Editing.
Despite such deliberations, we are not yet prepared to confront the realities and consequences of the latest genetic
techniques even though they are coming. The social, medical, ethical and psychological challenges that they pose are
considerable and need to be resolved, or at the very least, properly addressed.
4
Digital
World
‘Domain’
Internet of Things (IoT), Internet of People , Internet of Service and Cyber Physical Systems at large
Integration Sensors and Actuators to Things to collect their status and surrounding environment
Uploaded through Wireless and Mobile Networks to Fog and Cloud Computing Layer
Performing Big Data Analytics and Mining using Artificial Intelligence, Deep Learning,
Machine Learning.
Visualization in terms of dashboards, charts, reports and graphics.
Communication and Cloud Computing Platforms.
All have led to develop Smart Environment such as Smart City Applications.
5
I3.0: Semi customize and variant product
Example: 18 product
variations
6
I 4.0 is about fully customized, variant, mass volumes,
data rich, enhanced service and just in time production
Example: 56,000 product variations
7
Industry 4.0 is about fully customized, variant, mass
volumes and just in time production
8
Just-In-Time Manufacturing
Industry 4.0
Industry 3.0 Mass Production AND Customization
Mass production Data Rich Product
9
Smart Street Lighting
10
What are the enabling technologies for industry 4.0
http://dazeinfo.com/2014/01/23/smartphone-users-growth-mobile-internet-2014-2017/
11
CISCO Concept
12
Example Smart Cereal Flakes Factory
13
Smart Cereal Flakes Factory
14
The Fourth Industrial Revolution
Comparison between Industry 3.0 and Industry 4.0 Revolutions
Three Biggest Market Revenues Employees
Companies1 Capitalization
Detroit-1990s $36 billion $250 billion 1.2 million
Silicon Valley -2010s $1.09 trillion $247 billion 137,000
https://www.cnbc.com/2019/01/16/fourth-industrial-revolution-explained-davos-2019.html
PUBLISHEDTHU, JAN 17 2019 1:17 AM ESTUPDATED TUE, JAN 22 2019 3:39 PM EST, Elizabeth Schulze@ESCHULZE9
16
https://www.futurithmic.com/2019/02/13/industry-4-0-could-create-millions-new-jobs/
Uber Revenue and Usage Statistics (2019)
Mansoor Iqbal, Updated: May 10, 2019
Users 700B
Drivers 30M
Revenue 50B
Valuation 200B
http://www.businessofapps.com/data/uber-statistics/#4 17
[1 Most Prone(loss job) 0.01 Least Prone (keep job)]
https://www.sciencedirect.com/science/article/pii/S0040162517311514?via%3Dihub20
Regardless of Their Brand Name…
They all are providing new applications to make our cities smarter:
https://www.mdpi.com/1999-5903/12/10/163
21
Smart Transportations
Much of the silicon content in cars comprises microcontrollers (MCUs), often several dozen per vehicle, that control
various aspects of the car's operating systems as well as safety equipment, comfort controls, location devices and
entertainment
A modern car contains several dozen subsystems that use MCUs with embedded non-volatile memory for firmware storage
and other purposes. (courtesy Xilinx)
23
24
25
What is an Embedded System?
•Tough question, really. There is no one answer. I asked at least a half dozen
industry experts and got as many answers.
•An embedded system is device used to control, monitor and/or assist the
operation of equipment, machinery or plant.
Application-specific
integrated circuit
27
Photon Cyber Enable Micro-Server
•Processors:
•Main processor: Tensilica Xtensa 32-bit LX6
microprocessor
•Cores: 2 or 1 (depending on variation)
All chips in the ESP32 series are dual-core except for ESP32-
S0WD, which is single-core.
•Clock frequency: up to 240 MHz
•Performance: up to 600 DMIPS
•Ultra low power co-processor: allows you to do
ADC conversions, computation, and level thresholds
while in deep sleep.
•Wireless connectivity:
•Wi-Fi: 802.11 b/g/n/e/i (802.11n @ 2.4 GHz up to
150 Mbit/s)
•Bluetooth: v4.2 BR/EDR and Bluetooth Low
Energy (BLE)
•Peripheral input/output: Rich peripheral interface with
DMA that includes capacitive touch, ADCs (analog-to-
digital converter), DACs (digital-to-analog converter), I²C
(Inter-Integrated Circuit), UART (universal asynchronous
receiver/transmitter), CAN 2.0 (Controller Area Network),
SPI (Serial Peripheral Interface), I²S (Integrated Inter-IC Dimensions in inches (mm) Weight
Sound), PWM (pulse width modulation), and more…. 0.71 x 0.98 x 0.11 (18x25.5x2.8) 3.63 grams
Price: $4
30
http://esp32.net/
Recent Computing Elements for Embedded Systems
RASPBERRY PI 3: It is credit card size computer
RASPBERRY PI 3 : The revolutionary $35 mini-PC
Faster, better, harder, stronger
SoC: Broadcom BCM2837 64-bit system-on-chip with :
CPU: 4X ARM Cortex-A53, 1.2GHz
GPU: Broadcom Video-Core IV
RAM: 1GB LPDDR2 (900MHz)
Networking: 10/100 Ethernet, 2.4GHz 802.11n wireless
Bluetooth: Bluetooth 4.1 Classic, Bluetooth Low Energy
Storage: microSD upto 32Gbytes
GPIO: 40-pin header, populated
Ports: HDMI, 3.5mm analogue audio-video jack, 4X USB 2.0,
Ethernet, Camera Serial Interface (CSI),
Display Serial Interface (DSI)
Addons:
8-Channels ATD.
Real-time clock
32
Technical Specifications System On Chip (SoC) processor, Introduced in March 2016
It is credit card size computer
SoC: Broadcom BCM2837 64-bit system-on-chip with four
ARM Cortex-A53 CPU cores clocked 1.2GHz
CPU: 4X ARM Cortex-A53, 1.2GHz HDMI
GPU: Broadcom Video-Core IV
RAM: 1GB LPDDR2 (900MHz)
Networking: 10/100 Ethernet,
2.4GHz 802.11n wireless
Bluetooth: Bluetooth 4.1 Classic,
Bluetooth Low Energy
Ethernet 10/100 LAN Port
https://www.raspberrypi.org/products/raspberry-pi-3-model-b/
Storage: microSD: The SD card bundled with the Raspbian
OS, which is a Linux based OS. It must be inserted into PS: 5VDC/2.5Amps
the SD Card slot.
For display, RPI can be connected to the LCD TVs or
desktop monitor that supports HDMI.
GPIO: 40-pin header, populated.
Analogue audio-video jack, 4X USB 2.0, Camera Serial
Interface (CSI),
Display Serial Interface (DSI),
The USB ports can be easily utilized for connecting USB
mouse and a USB keyboard.
8-Channels ATD.
Real-time clock (Once turned ON and WiFi is On, it will
get the systems real-time clock.
● https://www.raspberrypi.org/products/raspberry-pi-4-model-b/specifications/
● http://socialcompare.com/en/comparison/raspberrypi-models-comparison 34
• When the Pi was designed, they used a figure of 3mA per
GPIO pin in determining if the regulator could supply enough
current.
• 17 pins at a time at 3 mA each means the power regulator is
only rated for 50 mA
• Each 50 mA / 17 =~ 3 mA
• This doesn’t mean that the maximum current per GPIO is
3mA. The author of the same blog suggest that 16 mA be the
maximum pulled from any 1 pin, and that 50 mA as the
maximum from all pins.
35
Raspberry Pi Zero W: $10.00
Technical Specifications
The Raspberry Pi Zero W extends the Pi Zero
family. Launched at the end of February
2017, the Pi Zero W has all the functionality
of the original Pi Zero, but comes with added
connectivity, consisting of:
36
Operating System in Raspberry Pi 3
• The Raspberry Pi uses Linux kernel-based operating system.
• Raspbian, a Debian-based free operating system optimized for the
Raspberry Pi hardware is the official OS for raspberry pi.
• The easiest and quickest way to get started with Raspberry Pi.
Recommended for first time Pi users, the 32GB MicroSD card
comes pre-loaded with the official Raspberry Pi New Out of Box
Software (NOOBS) package featuring a choice of seven
recommended Raspberry Pi Operating Systems including:
• Raspbian
• Open ELEC
• OSMC (short for Open Source Media Center: is a Linux
distribution based on Debian
• Windows 10 IoT Core
• Arch Linux
• Pidora
32GB NOOBS Micro SD card
• RISC OS
• Multiple languages can be used to program in Raspberry Pi. Python, C, C+
+, Java, Scratch, and Ruby all come installed by default on the Raspberry Pi.
• Python is the official programming language of the Raspberry Pi, a Python
Integrated Development Environment (IDE) will be used for writing codes
in python.
37
Preparing the SD Card for OS setup in Pi3
38
Desktop Computer LibreOffice
You might not think it's really fair to compare the free LibreOffice and the paid Microsoft Office, but the two are a lot
closer in features than you might think. For one, LibreOffice is compatible with a lot more systems, including Windows,
OS X, and Linux, while Microsoft Office's newest version is restricted to just Windows 7 and Windows 8. Besides: it’s
not about which one is “better” or “more feature filled.” It’s about whether your work requires what Microsoft has to offer,
or if you can get by with something free and save a bit of money. Now, with LibreOffice reaching 4.1, we've decided it's
time to give it an in-depth comparison with Microsoft Office.
39
LAB Work
Python Programming Tutorial
Python 3 IDE
41
Python using IDLE
• Python is an interpreted, object-oriented,
high-level programming language with
dynamic semantics.
• Python has no compilation step and the edit-
test-debug cycle is incredibly fast.
• Python is used domains ranging from Desktop
application development to scientific and
numeric computing
• We will use Python IDLE 3 to program
python applications
• Python IDLE 2 and Python IDLE 3 come pre-
installed on Raspbian. If needed on any other
OS, type the following command in terminal
window:
– sudo apt-get install python3 or sudo apt-
get install python
42
Open IDLE 3
and click File -> New File
On clicking F5
the output is shown
43
Output:
Output:
44
Output:
Output: 45
While Loops: Used as a repeating if statement
Output:
46
For Loops: Typically used when number of iterations are known is
known before entering the loop
Output:
47
• Useful Functions
• X= input (“String to be displayed to user”) used to prompt the user to
enter inputs
• print (“ { } “. format (X )) used to output data to the terminal
Output:
48
Python Exercises
49
https://docs.python.org/2/library/math.html
Raspberry Pi
Digital I/O in Raspberry Pi
50
Raspberry Pi GPIOs
• Pins in Raspberry Pi, as shown in Figure below, are
used to perform digital input/output operations.
• Raspberry Pi 3 Model B has 40 pins. Of these 40 pins,
26 are GPIO pins and the others are power or ground
pins.
• These pins are a physical interface between the Pi and
the outside world. At the simplest level, you can think
of them as switches that you can turn on or off (input)
or that the Pi can turn on or off (output).
• 3maps outsourcing current/ Total Pins 50mamps at a
time. Power supply 5V max 2.5amps.
51
Raspberry Pi 3 model B : GPIO
Board mode Board mode
52
GPIOs Layout
53
RPi.GPIO Installation
If you are using the most popular Raspbian OS, the RPi.GPIO
library is already included in it and there is no need to install it.
54
Programming the RPi
•RPi.GPIO:
A module (library) for GPIO access to control
Raspberry Pi GPIO channels, allows you to
easily configure and read (input) –write
(output) pins on the Pi’s GPIO header within a
Python script.
•Wiring Pi :
A module (library) for GPIO access to control
Raspberry Pi GPIO channels, allows you to
easily configure and read (input) –write
(output) pins on the Pi’s GPIO header within a
shell script writing in C language Similar to
Arduino style programming.
55
Setting up Rpi.GPIO API
56
Pin Numbering Declaration
For the GPIO Pins to be usable, pin mode has to be configured first.
There are two modes of operation-
• GPIO.BOARD mode:- Board numbering scheme. It refers to the
pin numbers on header and the number goes from 1-40. Pin 22
in BOARD mode corresponds
Example “Pin 05” board mode
• GPIO.BCM mode :- Broadcom chip-specific pin numbers.
These are the numbers after "GPIO“
Example GPIO3 in BCM i.e.
“Pin 05” board mode = “GPIO3” in BCM
•The BOARD numbering system stays the same between board
revisions.
•It is recommended to use Board numbering to make the script more
meaningful and avoid revision checking.
57
Setting up pins as Input or Output
Input
GPIO.setup (PIN Num, GPIO.IN) GPIO.setup (PIN Num, GPIO.OUT)
Example: Example:
GPIO.setup (19, GPIO.IN) GPIO.setup (18, GPIO.OUT)
58
Setting up Pin Mode
More Examples:
To configure pin 7 (Board) as output and GPIO14 (BCM) as input
59
How to Read an Input:
• If a pin is configured as an input, GPIO.setup (18, GPIO.IN), you can use
the GPIO.input(pin) function to read its value (status) in BOARD Mode.
• The input() function will return either a True or False indicating whether the
pin is HIGH (ON) or LOW (OFF). You can use an if statement to test this.
• for example, the code to connect a switch to pin 17 and check if the switch is
ON or OFF:
NOTE: Make sure you indent your code properly using TAB rather than spaces
60
Digital Outputs:
61
Delays
• If you need to slow your Python script down, you can add delays. To
incorporate delays into your script, you’ll need to include another module: time
include time# to import the Time library
62
Example of using time.ctime and time.sleep method:
Output:
63
Time.ctime() Method- To access the current date and time
64
GPIO Output Basic Summary
65
Digital Buttons/Switches
• Types of digital inputs: A Single Pole
Single Throw (SPST) switch, DIP
switches, push buttons.
67
Practice Example #2 (Input/Output)
68
• Write a python program to flash 1
LED 3 times with an interval of 1
second: Assume the LED is
connected to PIN 11. You must use a
for loop
Output: 1 (3.3V)
(GND) 6
16 11
12
13
69
• Write a python program to consecutively turn ON/OFF 3 LEDs connected to PIN 11,12,13
five times with an interval of 1 second.
As mentioned before
True or 1
False or 0
Output:
70
Write a program in C to turn ON/OFF an LED
for 0.5 seconds connected to PIN 11 (on BOARD mode)
71
Pulse Width Modulation: PWM (analog output as well)
To start PWM:
p.start(dc)
# where dc is the duty cycle (0.0 <= dc <= 100.0)
Output:
Pulse each 2 seconds
73
GPIO PWM Examples
Frequency= 50Hz with incrementing/decrementing duty cycle
Brighten/dim an LED:
74
Passive Buzzer
https://www.sunfounder.com/learn/se
nsor-kit-v2-0-for-raspberry-pi-b- Pin 17
plus/lesson-10-buzzer-module-
sensor-kit-v2-0-for-b-plus.html 75
Understanding Sensors
What is an ultrasonic sensor?
An ultrasonic sensor is an instrument that measures the distance to an object using ultrasonic sound
waves.
An ultrasonic sensor uses a transducer to send and receive ultrasonic pulses that relay back information
about an object’s proximity.
High-frequency sound waves reflect from boundaries to produce distinct echo patterns.
76
In order to generate the ultrasound you need to set the Trig on a High State for 10 µs. That will send out
an 8 cycle sonic burst which will travel at the speed sound and it will be received in the Echo pin. The
Echo pin will output the time in microseconds the sound wave traveled.
Trig
Echo
77
Ultrasonic Ranging Module
78
https://www.sunfounder.com/learn/sensor-kit-v2-0-for-raspberry-pi-b-plus/lesson-25-ultrasonic-ranging-module-sensor-
kit-v2-0-for-b-plus.html
Ultrasonic Ranging Module
while True:
import Rpi.GPIO as GPIO TRIG = OUT =19 dis = distance() #read the distance
import time ECHO= IN = 20 print (“distance = %2.2f cm” %dis)
GPIO.setmode(GPIO.BCM)
TRIG = 19 #set ultrasonic sensor trig pin
GPIO.setup(TRIG, GPIO.OUT)
ECHO = 20 #set ultrasonic sensor echo pin
GPIO.setup(ECHO, GPIO.IN)
79
General Overview of interrupts
Regardless of the Processor in Being Used: HC12, PIC, Raspberry Pi, Arduino , Photon
Exceptions and Interrupt are used interchangeably.
To be more precise, you could say interrupts are subset of exceptions.
Exceptions: is an event, which occurs during the program execution:
It is any event that can alter the normal CPU Instruction execution flow.
Then, an internal event that handles abnormality during program executions.
Examples:
- Invalid instruction such divide by zero, single step execution (tracing),
- Illegal bus access such go to address that may not be the beginning of instruction address or
data address.
$2000 Jump $2010
- It is software trigger event
$2003 Jump $5000
$2010 Data storage area
$5000 Memory is not installed
Interrupt: is an event that can be triggered by external hardware which leads to stop the
program executing sequence and jump to and interrupt handler ( Interrupt Service Routine -
ISR). Such ISR can be system-ISR or user-ISR:
Examples:
- System-ISR; Hardware Interrupts Triggered by external signal: Reset, Printer is out off papers,
Print screen (Print Screen).
- User-ISR: Hardware Interrupts Triggered by GPIO: an action on an input of GPIO Pin will
cause the CPU to jump to ISR is defined and written by the user (Read ADC, Flash an output
GPIO….).
80
Exceptions and Interrupt
Overall Process Sequence
In both Types, once an expectation or an interrupt occurs, the normal
program execution sequence is suspended,
the CPU status registers, the program counters and other registers are
saved the stack area,
At the end of the ISR, restoring the CPU status registers and the
program counter from the stack,
81
Exceptions and Interrupt Overall Process Sequence
82
Raspberry PI Interrupt Handling
1. Polling forever 2.Polling for limited time 3.Interrupt without Polling
1. Polling a specific input 2. Interrupt every now and then: 3. Interrupt with no Polling:
until condition is met. Periodic Polling for limited time, Keep executing the program.
Once met, then go to the If an interrupt occurs, go for it, Once an interrupt occurs,
next instruction .i.e. hang in Else keep executing the program go for the Interrupt Service Routine
there until condition is met and check for an interrupt (ISR), execute and return to
after a specific time say x msec. where the program was interrupt .
Main Main
Main
Program Program
Program
83
GPIO Polling
Previously, you have used if statements and while loops to check for the status of the
Rpi GPIO inputs. Then execute certain statement or make an action on an output in
case any of these inputs change its status.
This is called polling techniques. An example of such programs is shown below:
if GPIO.input(channel):
print('Input was HIGH')
else:
print('Input was LOW')
#OR
while (GPIO.input(channel)):
print('Input was HIGH')
84
85
86
GPIO Interrupts
Each GPIO pin, when configured as a general-purpose input, can be configured as an interrupt driven
event. Interrupt can be activated as follows:
•Synchronous Rising/Falling edge:
The normal rising/falling edge detection has a small amount of synchronization built into
the detection. Every system clock cycle, the pin is sampled with the criteria for generation
of an interrupt being a stable transition within a 3-cycle window, i.e. a record of "1 0 0" for
falling or "0 1 1“ for rising.
•Asynchronous Rising/Falling edge:
Asynchronous detection bypasses this synchronization to enable the detection
of very narrow events.
Once an interrupt edge is detected, The CPU will start executing the related interrupt service routine
(function).
Asyn. Asyn.
Falling Edge Rising Edge
87
Syn. Falling Edge Syn. Rising Edge
GPIO.add_event_detect(channel, GPIO.Edge, callback=my_callback, bouncetime=x)
Where:
Channel is the GPIO input,
Edge can be RISINF or FALLING, or Both,
my_callback is the name of ISR function
x is the time needed to overcome the denounce effect in milliseconds.
88
Interrupt Driven Program
89
PIR Sensors Application
A PIR sensor is a digital sensor used to detect motion; the sensor radiates IR and reflects
the signals back to the senor using a set of special lenses. Based on the deference
between the signals read back from each lens it can detect whether an object is moving
in its range. As a result simple to use the sensor it should be powered up and then wait
1-2 seconds for the sensor to get a snapshot of the still room. If anything moves after
that period, the ‘alarm’ pin will go low. Connecting the pin to a digital I/O of a
microcontroller one can write programs to detect motion in the surrounding
environment. The alarm pin is an open collector meaning you will need a pull up
resistor on the alarm pin.
R = Power
W = Ground
B = Output
Phototransistor IR LED
90