[Mooc]IoT Course 1 Introduction to IoT et embedded system

Week 1 What is IoT?

Lesson 1: Definition of the IoT

Lecture 1.1 IoT Example: The Refrigerator

  • Basic functions
  • Add computational intelligence
  • Add a network connection

lecture 1.2 IoT Devices

  • 21st century car - computer-based control system enable fuel injection anti-lock braking, etc.
  • Internet access gives access to external computation and data ("the cloud")
    • 1970's logistical tagging - barcode
    • 21st century logistical tagging - intelligent RFID tags

lecture 1.3 IoT Devices vs Computers

  • IoT devices have a main function
  • Computers execute code
  • IoT vs Computers
    • computer are general-purpose
    • IoT are special-purpose

Lesson 2: Trends in the Adoption of the IoT

Lecture 2.1 Trends in the adoption of IoT

  • Convergence of several trends
  • Cost of Hardware has decreased
  • Hardware Size
  • Computational Ability
  • Internet Access

Lecture 2.2 IoT is Powerful and Pervasive

  • Interface to the cloud
  • Networking is Powerful
  • IoT is Pervasive
    • At home
    • At work
    • On your person
    • Everywhere else

Lesson 3: The Importance of the IoT in Society

Lecture 3.1 Social Benefits of IoT

  • Societal Benefits
    • IoT makes life easier
    • Independence from people
  • Link to the world

lecture 3.2 Risks, Privacy, and Security

  • Social isolation
  • Dependence on technology and infrastructure
  • Privacy and Security
    1. Observation by IoT devices is pervasive
    2. Data may be used to market to you
    • Purchasing an IoT device may give the manufacturer permission to use or sell your data
    • Data may be used by insurance agencies
    • Data may not be held in a secure way

Week 2 Embedded Systems

Honey, I Programmed the Blanket

Lesson 1: Features and Constraints of Embedded Systems

Lecture 1.1 What are embedded systems?

  • Computer-based systems that do not appear to be computers - complexity is hidden from the user
  • Much more common than desktops or laptops
  • They interact with users via simple interface
  • Efficiency Rules!
  • Tight Constraints
    • Manufacturing cost
    • Design cost
    • Performance
    • Power
    • Time-to-market
    • Very different from traditional software engineering

Lecture 1.2 More on embedded systems

  • Application Specificity
    • Embedded sys tend to be app-specific
    • Design is focused on one app
    • Higher design efficiency is possible
  • Hardware/Software Codesign
    • Hardware and software are often designed together
    • More work for designers

Lecture 1.3 Generic embedded systems structure

IoTW2L1.3.png
  • IP (Intellectual Property) Core
    • An integrated circuit that performs one function
    • Cheap in high volume
    • Very useful for common tasks
    • Must interact with the microcontroller
  • FPGA (Field Programmable Gate Array)
    • Hardware that can be reconfigured via RAM

Lesson 2: Components of Embedded Systems

Lecture 2.1 Components of Embedded Systems

Microcontrollers
  • Integrated circuit that executes a program
    • Microcontroller vs microprocessor
      1. slower
      2. less memory,fewer features
    • connected to other hardware components
    • Sends commands and receives data
    • Needs to be programmed
Programming Microcontrollers
  • Write code on a host machine
  • Programming the microcontroller
Use a Programmer
  • Programming hardware can be used to place program in microcontroller memory

Lecture 2.2 More on components of embedded systems

Using a Development Board
  1. General Purpose Processors

    • Used for any application
    • Many features included
  2. Digital signal Processors

    • Made to support DSP functions
    • Vector instructions
    • Cheaper but more limited
  3. Sensors

    • Provide simple information
    • More complicated data
  4. Actuators

    • Cause events to occur in the environment
    • Simple actuators
    • complex actuators

Lecture 2.3 Sensors and actuators

Lesson 3: Interacting with the Physical World

Lecture 3.1 Analogue/Digital conversion

  1. Analogue to Digital Conversion

    • Converts analogue data to digital data
    • used to interface with analogue sensors
  2. Digital to Analogue Conversion

    • Converts digital signals to analogue signals
    • Used to interface with analogue actuators

Lecture 3.2 Basic equipment

A development board with a microcontroller the center of most projects

  • Connectors: USB, Ethernet cable, jumper wires
  • Inputs: Potentiometer, Photoresistor, Keypad, Buttons
  • Outputs: LEDs
  • Others: Resistor, breadboard

Week 3 Hardware and Software

Lesson 1: Hardware Components

Lecture 1.1 Hardware and Software

IoT devices are a combination of hardware and software
Hardware and Software components must be designed together.
Datasheets give details of each hardware component

  • Physical size
  • Input/output pins
  • Electrical Parameters(max current, etc.)

Lecture 1.2 Integrated Circuits

  1. Size specifications for manufacturing
  2. Electrical and thermal parameters
Integrated Circuits(ICs)
  • A small electronic device made of a semiconductor material(Silicon,etc.)
  • Chip is protected by a package
  • Package has a set of pins to allow chip access

Lecture 1.3 Microcontroller Properties

Microcontroller Characteristics
Datapath Bitwidth
  • Number of bits in each register
  • Determines accuracy and data throughput
Input/output pins
  • Need enough pins to support your app
Performance
  • clock rates are slower than desktop
Other Microprocessor Features
  • Timers
    • Needed for real-time app
  • Analog-to-digital converters
    • Used to read input from analog sensors
  • Low-power modes
    • Power saving is key
  • Communication protocol support
    • Interface with other ICs
    • UART, I2C, SPI, etc

Lesson 2: Microcontrollers and Software

Lecture 2.1 Microcontroller Components

AVR ATmega2560
  • 8-bit microcontroller
  • Up to 16MHz
  • 256KB of flash memory
  • 4KB EEPROM, 8kKB SRAM
  • Peripherals
Microcontroller Components
  • Storage elements
    • Data stored in different components
    • Speed/Cost(area) tradeoff
  • Register: stores a single value
  • Several special-purpose registers, used internally
  • General-purpose registers, used by the program
Storage Elements
  • Register file: Stores many values

    • A set of registers; each has an address
    • Acts just like a memory
    • Extremely fast, expensive
  • Instruction operands are here

    add $r3, $r2, $r1

  • Can only read one or two registers at a time

  • May contain ~32 registers

Memories
  • Cache: Stores many values
    • Slower than a register file
    • Cheaper than a register file
    • Still fairly fast and expensive
  • Data cache holds data that the program operates on
  • Instruction cache holds program instructions
Main Memory
  • very big: Gigabytes (Gb)
  • Not in the CPU
  • Connected to the CPU via system bus
  • Memory access is slow

Lecture 2.2 Compilation and Interpretation

Software Translation
  • Machine language: CPU instructions represented in binary
  • Assembly language: CPU instructions with mnemonics
    • Easier to read
    • Like machine language
  • High-level language: commonly used language(C,C++,Java)
    • Easier to use

All software must be translated into the machine language of the microcontroller.

Compilation and Interpretation
  • Compilation: translate instructions once before running the code
    • C, C++, Java(partially)
    • Translation occurs only once, saves time
  • Interpretation: translate instructions while code is executed
    • Basic, Java(partially)
    • Translation occurs every execution
    • Translation can adapt to runtime situation

Lecture 2.3 Python vs. C/C++

  • Python is interpreted - a scripting language
  • Python is easier to work with, if speed is not primary

vs.

  • C and C++ are compiled
  • C and C++ are more common for performance
Software Tool Chain
IoTW3L2.3.png
  • Software written on a host
  • Transferred to the flash memory in the microcontroller
  • Tool chain is the set of tools needed to process the software

Lesson 3: Operating Systems

Lecture 3.1 Operating Systems

Structure
User
App
OS
Hardware
Operating System
  • Manages other programs
    • Windows, Linux, IOS, etc.
  • Allows many programs to be executed together
  • Incorporates a nice user interface
  • Needs processing power and memory
  • Slowing down the system, makes development easier

Lecture 3.2 Task Support

Multiple Tasks
  • Assume that one microcontroller is being used
  • At least four different tasks must be performed
    1. Send video data: continuous while a user is connected
    2. Service motion buttons: whenever button is pressed, may last seconds
    3. Detect obstacles: continuous at all times
    4. Auto brake: whenever obstacle is detected, may last seconds
  • Detect and auto brake cannot occur together
  • 3 tasks may need to occur concurrently
Process/Task Support
  • Main job of an OS is to support the Process(Task) Abstraction
  • A process is an instantiation of a program;
    it must have access to:
    • the CPU
    • memory
    • other resources
      • I/O, ADC, timers, network, etc.
  • OS must manage resources
    • Give processes fair access to the CPU
    • Give processes access to resources

Week 4 Networking and the Internet

Mobile networks prep for the Internet of Things
Security and the Internet of Things – are we repeating history?

Lesson 1: Networking Basics

Lecture 1.1 Why is Networking Needed?

  • To enhance many devices
    • Cars communicating to reduce traffic
    • Online game play
    • Access media libraries
  • To access data or computational power outsider of the device
Client-Server Transactions
IoTW4L1.1.png

Client-server model is very common

  • Single server, one or more clients
  • Server provides a service for clients
  • Server manages a resource
  • Server responds to requests from the client
Computer Networks: LAN

Hierarchical system of computer-based devices which communicate

  • Local Area Network(LAN) - spans a building or campus(Ethernet is most common)
Computer Networks: WAN

Wide Area Network(WAN) - Internet is best example

Computer Networks: MANET
  • Mobile Ad Hoc Network(MANET) - continually changing network built from wireless, mobile devices
    • Typically short-range
    • Most common for IoT devices

Lecture 1.2 WAN Structure

A small LAN
  • Ethernet is a common LAN protocol
  • Ethernet switch sends messages to the right input or output
A Larger LAN
  • Spans a building or campus
  • Smaller LANs connected by bridges which speak both LAN protocols
A Wide Area Network
  • Multiple LANs connected by routers

Lecture 1.3 Networking Components(Lab Tour)

Lesson 2: Internet Protocol

Lecture 2.1 Internet Structure

Internet Structure
  • Ad hoc interconnection of networks
    • Unpredictable structure
    • Can be changed by anyone at any time
  • Messages travel from source to destination by hopping through networks
Internet Protocol: Solution
  • Protocol software running on each host and router
  • Common communication rules for all networks
  • Implement protocol(set of rules)
    • governs how hosts and routers should cooperate when they transfer data from network to network
    • TCP/IP is the protocol for the global IP Internet

Lecture 2.2 Protocols

What does an Internet Protocol Do?
  • Provides a naming scheme
    • An internet protocol defines a uniform format for host addresses
    • Each host(and router) is assigned at least one of these unique internet addresses
Protocol Model
  • Rules that determine how computers will communicate
  • CB radio protocol
    • "Over" - I am done talking
    • "Roger" - Data received
  • Rules enable efficient communication
Network Protocols
  • Many networking tasks to transmit and receive data
    • Routing, flow control, arbitration
  • OSI divides these tasks between network abstraction layers
  • Each layer has its own responsibilities
  • Each layer uses different data
    • Routing requires network topology
    • Arbitration may use message priorities

Lecture 2.3 Protocol Stack

OSI Layer Concept
  • Message is received at each layer and decisions are made
  • Assume layer R performs routing, transmission
    • Message M is received by layer R
    • Layer R identifies a route for message M
    • Layer R ads routing information, creating M'
    • Layer R passes message M' to the next lower layer
Encapsulation
  • Communication tasks are confined to one protocol layer
  • Protocol stack is the implementation(usually software) of each protocol layer
Encapsulation: Transmission
  • Messages start at top layer and go down
  • Message decisions are made at each layer
  • Relevant information is added to the message at each layer(header or footer)
Encapsulation: Reception
  • Messages start at bottom later and go up
  • Relevant information is stripped at each layer
  • New decisions are made, if necessary

Lesson 3: Network Layers and MATNETS

Lecture 3.1 TCP/IP Application Layer

  • Transmission Control Protocol(TCP), Internet Protocol(IP)
  • Protocol stack used in the Internet
TCP/IP
Application
TCP/UDP
IP
Data Link
  • TCP/UDP used at Transport layer
    • App-to-app
  • IP used at network layer
    • Host-to-host
  • 4 layers total, unlike OSI's 7
Application Layer
  • Protocols that directly support applications
  • Information is application-specific
    • Simple Mail Transfer Protocol(SMTP): email
    • Hypertext Transfer Protocol (HTTP): web
    • Line Printer Daemon(LPD): printing

HTTP response message transmitted in response to a request for a web page (GET)

Lecture 3.2 MANETs

Mobile Ad Hoc Network (MANET)
  • Self-configuring network of mobil hosts/routers
  • Connected by wireless links
  • Often connected to a wired LAN via an Access Point
  • Common for IoT devices
IoTW4L3.2.png
MANET Issues: Power Budget
  • Mobil devices are power constrained
  • Standard LAN protocols must be modified
  • Battery is often the heaviest component
MANET Issues: Data Rate and Security
Data rate
  • Wireless bandwidth is lower than wired
  • Bandwidth costs power
Security
  • Power is not available for complex security
  • No encryption, anti-virus, etc.
Network Programming in Practice
  • We write code at the application level
  • Lower levels handled by library functions
  • Ex:
    • SendMessage() function creates a TCP/IP message and transmits it
    • ReceiveMessage receives a TCP/IP message and returns contents

Lecture 3.3 Packet Capture Demo


最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 214,504评论 6 496
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 91,434评论 3 389
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 160,089评论 0 349
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 57,378评论 1 288
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 66,472评论 6 386
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,506评论 1 292
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,519评论 3 413
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,292评论 0 270
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,738评论 1 307
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,022评论 2 329
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,194评论 1 342
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,873评论 5 338
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,536评论 3 322
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,162评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,413评论 1 268
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,075评论 2 365
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,080评论 2 352

推荐阅读更多精彩内容