0% found this document useful (1 vote)
1K views

Introduction To The Internet of Things and Embedded Systems

Uploaded by

DEEPIKA
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
1K views

Introduction To The Internet of Things and Embedded Systems

Uploaded by

DEEPIKA
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 103

https://forescout-wpengine.netdna-ssl.

com/wp-content/uploads/2018/07/2018-SANS-Industrial-IoT-Security-
Survey.pdf
https://www.nytimes.com/2018/10/10/technology/future-internet-of-things.html
Bojanova, I. (2015, March 31). What Makes Up the Internet of Things?  Computing Now, IEEEComputer
Society
http://www.computerworld.com/article/2886316/mobile-networks-prep-for-the-internet-of-things.html
http://www.csoonline.com/article/2947477/network-security/security-and-the-internet-of-things-are-we-
repeating-history.html

[MUSIC] 
Welcome to Introduction of Programming the Internet of Things and Embedded Systems. 
I'm Professor Ian Harris. 
I'm a professor in the Department of Computer Science at the University of 
California Irvine. 
In beautiful Irvine, California. 
I got my degree, my PhD from University of California San Diego in 1997 and 
before that I got my Bachelors at MIT in 1990? 
1990. 
I do computer security research. 
I do Internet of Things research, specifically building components, 
stuff that this course is about. 
And I also do work in testing, testing and verification of hardware designs. 
[MUSIC]

Welcome to Introduction to the Internet of


Things and Embedded Systems
The explosive growth of the “Internet of Things” is changing our world and the rapid drop in price for typical IoT
components is allowing people to innovate new designs and products at home. In this first class in the
specialization you will learn the importance of IoT in society, the current components of typical IoT devices and
trends for the future. IoT design considerations, constraints and interfacing between the physical world and
your device will also be covered. You will also learn how to make design trade-offs between hardware and
software. We'll also cover key components of networking to ensure that students understand how to connect
their device to the Internet.

Course Learning Objectives


1. Define the term “Internet of Things”

2. State the technological trends which have led to IoT

3. Describe the impact of IoT on society

4. Define what an embedded system is in terms of its interface

5. Enumerate and describe the components of an embedded system

6. Describe the interactions of embedded systems with the physical world

7. Name the core hardware components most commonly used in IoT devices

8. Describe the interaction between software and hardware in an IoT device

9. Describe the role of an operating system to support software in an IoT device

10. Explain the use of networking and basic networking hardware

11. Describe the structure of the Internet

12. Describe the meaning of a “network protocol”

13. Explain MANETs and their relation to IoT

Prerequisites
There are no prerequisites for this course.

Readings
In this course, each module will recommend readings correlating with the module content that will enrich your
learning experience. These readings are optional. All the resources required to complete this Specialization are
included.

Peer Review Assignments


Each of the four modules will include a graded peer review assignment so that you can practically apply what
you have learned in the course. Three of your peers will review each of your assignments.

Each peer assignment will be worth 20% of your final grade. You must earn 80% to achieve a passing score on
each peer review.

Quizzes
At the end of each module you will have an opportunity to check your knowledge and skills by taking a brief
quiz.

• Each of the four modules has a quiz.

• Each quiz is worth 5% of your final grade.

• To pass the quiz you must score 80% or higher.

• You get 3 quiz attempts every 8 hours.

• Your final grade for a given quiz will be based on the highest score of all of your attempts.

• The four quizzes will count for a cumulative 20% of your final course grade.

Grading Scheme
Each of the four modules in this course has 1 quiz and 1 peer review assignment. Each quiz is worth 5% of
your grade and each peer review assignment is worth 20% of your grade. You must score 80% or higher on
each of these assessments in order to pass this course.

 Define the term “Internet of Things” (IoT)


 State the technological trends that have led to IoT
 Describe the impact of IoT on society
The Internet of Things (IoT) is a popular buzzword right now, but unlike many fads which have come and gone,
the Internet of Things describes an important trend which is having lasting effects on society at large. The term
itself, “Internet of Things”, is used to mean a variety of ideas, depending on the motivation and background of
the speaker. This course will start by providing a definition of the term. We will talk about how various trends
have enabled the Internet of Things, and how it changes the way design is performed. We will also discuss
some of the ramifications that IoT is having on society today.

[MUSIC]

Start transcript at 16 seconds0:16


Internet of Things is a pretty popular buzzword right now. 
But it's not one of those passing fads. 
Internet of Things is actually an important concept that's 
making changes to society right now. 
So, welcome to Module One, and 
we'll be talking about Internet of Things over the entire course. 
But in this module we'll basically define the term.

Start transcript at 36 seconds0:36


It's used in many different ways depending on the speaker and 
their motivations and so on. 
But we'll break down the term, talk about it, give some examples. 
So you get some kind of an intuitive understanding of what an Internet of 
Things device is, and what it is not.

Start transcript at 51 seconds0:51


Also, we'll talk about various trends, technology trends that lead to Internet of 
Things, that allow it, that enable it effectively, and make it all possible.

Start transcript at 1 minute 0 seconds1:00


And, we'll talk a little bit about the impact on society. 
Of having things embedded in everywhere that are watching you at all times and 
are networked. 
So I will talk about that privacy issues and things like that. 
Thank you. 
[MUSIC]

[MUSIC]

Start transcript at 14 seconds0:14


So now, it's the lab tour. 
So, here's my lab. 
I got a bunch of equipment here. 
Let's start off with these computers. 
These are sort of old and semi-defunked computers. 
These computers are actually for my computer security research. 
I actually have a group of students, who wanna do, look at attacking networks. 
Look at attacking computer networks, and so I'm gonna have them work on this. 
This will be a network. 
And they will attack it, and try to defend it, and see if they can do that. 
So that's what those are for. 
This is just a computer.

Start transcript at 43 seconds0:43


Over here, we have some of the stuff that I use for hardware design. 
So I've got, let's see, a soldering iron. 
Let's start with that.

Start transcript at 52 seconds0:52


Soldering iron is used to solder together pieces of metal, 
when we're building a system, and this is a cleaner for the iron. 
[SOUND] I've got my oscilloscope. 
An oscilloscope is a diagnostic tool. 
It is used to tell you the value of certain signals, certain wave forms. 
So if you wanna see the voltage of a signal over time, you connect this up, 
and this is the ground, and 
you can see the voltage of the signal over time on this screen. 
So, I use that a lot. 
I got a multimeter. 
I use this even more. 
Multimeter is basically just a device that has two probes, and 
it allows you to see the voltage current and resistance between the two points. 
So you can touch these two probes to different points in the circuit, and 
see the voltage between them. 
[SOUND] I got a microscope. 
This is for working with small devices, so sometimes I'm looking at small printed 
circuit boards, things that designed area very compactly. 
So in order to desolder it, and work with them properly, I need a magnifying glass, 
or even better yet, this is actually better than a magnifying glass. 
It's got a light on it, to give me good visualization of the component. 
Random parts, solder, and snips, and desoldering wick, and so on. 
This is actually a mixed power supply and a multimeter, together. 
So a control power supply and multimeter, I don't use it too much, but 
it's very useful.

Start transcript at 2 minutes 18 seconds2:18


This is just a crimping tool, to crimp terminals onto the end of wires.

Start transcript at 2 minutes 23 seconds2:23


This right here is a project I'm sort of working on still, it is a quadcopter, or 
a de-funked quadcopter. 
It's got four motors. 
Four actuators. 
Four ESCs, electronic speed controls. 
These control the speed of the motors.

Start transcript at 2 minutes 39 seconds2:39


This is the control of the main flight controller for it. 
So this flight controller sends data to these ESCs, 
to indicate what speed the motor should go at. 
This is the battery right here. 
This is maybe half the weight of the old device.

Start transcript at 2 minutes 52 seconds2:52


Then over here I have my turntable, one of my turntables, so 
it's an old dirty turntable, and it doesn't work right now. 
And since I have a lab, I feel like why not fix it. 
I need to solder something together actually this board, 
this is actually what's wrong right here. 
[LAUGH] That needs to be resoldered, [LAUGH] the board is decayed.

Start transcript at 3 minutes 11 seconds3:11


And this is the turntable, the platter that goes on top of it once it's repaired. 
Over here I just have a box of a soldering irons and things like that, 
tools that I use for my classes. 
So when I have a class, and I want them to solder, I just 
bring this whole box over to the class and everybody has a component to work with. 
So over here, we have lots of different parts stacked up here.

Start transcript at 3 minutes 33 seconds3:33


All kinds of different components, wires, every wire and 
cable that you could probably ever need, that I have somewhere in here. 
Programmers, and programming micro-controllers, wire. 
These are my portable cases, so when I'm on the run to a class or 
something like that, I put stuff in this and carry it off.

Start transcript at 3 minutes 50 seconds3:50


Duct tape is always good, [LAUGH] I always need that.

Start transcript at 3 minutes 54 seconds3:54


What do I have? 
More equipment over here.

Start transcript at 3 minutes 57 seconds3:57


Piles of resistors, in all sizes and shapes, and all of that. 
Power supplies. 
Here we have Raspberry Pi, so, [LAUGH] we'll be seeing this in the class, 
eventually.

Start transcript at 4 minutes 9 seconds4:09


Let's take a look.

Start transcript at 4 minutes 16 seconds4:16


Here we go. 
That is a Raspberry Pi Model B. 
This is basically what we'll probably be working with, maybe this is the right way.

Start transcript at 4 minutes 25 seconds4:25


[LAUGH] Yeah, this the right way, the wording is right up this way. 
So this is a Raspberry Pi, and we'll work with those.

Start transcript at 4 minutes 32 seconds4:32


Also Arduinos, I got those too, in my Arduino case. 
[SOUND] Put that over there. 
Here is one, it's not a brand new one, but they all look the same, pretty much. 
That's an Arduino Uno.

Start transcript at 4 minutes 43 seconds4:43


Actually, this is a shield for an Arduino. 
We'll talk about those, too. 
It stacks, and notice it has the same size and configuration. 
You can stack it on the top.

Start transcript at 4 minutes 53 seconds4:53


This is an ethernet shield, and this is an old ethernet shield. 
[LAUGH] But if you wanna connect this to the ethernet, you'll do that. 
And Friday components, and that's it. 
Thank you. 
[MUSIC]

[MUSIC] 
The point of this lecture is really to just introduce the term 
Internet of Things. 
Just to define the term, give you some kind of a general idea 
of what Internet of Things really is, what it's about. 
So we'll go through an example, a refrigerator example. 
And talk about how a refrigerator can be integrated into the Internet of Things, 
and how it’s different than just a regular, 
traditional refrigerator that you are probably used to.

Start transcript at 33 seconds0:33


So let’s break down the term Internet of Things. 
We're probably gonna start off with a thing of some kind. 
So in this case we're talking about a refrigerator and 
a refrigerator is just a thing, so it can be anything besides a computer. 
Right? If it's a computer, 
we're not calling that a thing, but anything besides a computer. 
Besides a traditional computer, a laptop, desktop, 
server type of device, you'll call that a thing of some kind. 
And it has some features. 
It has some use. 
So in the case of a refrigerator like this, we know what a refrigerator does. 
It keeps things cold and so on. 
So you start off with a thing.

Start transcript at 1 minute 6 seconds1:06


Now the next thing you do is you add to that 
some type of computational intelligence. 
Usually that involves a processor like what we're showing here. 
That's actually a picture of an R-Dweeno but 
it could be any type of computational intelligence. 
Typically it's a micro controller of some kind, running some kind of code. 
So, you see these devices all around your house. 
But it's the computer inside, right? 
So it doesn't look like a computer, it looks like a thing of some kind. 
It looks like a refrigerator, but it actually has computational intelligence 
inside, so it's really a computer hidden on the inside. 
And it's somehow is used to improve the functionality of the device, 
to make the device do what it did before, but better.

Start transcript at 1 minute 47 seconds1:47


So that's what you start with, you start with a thing, you add some intelligence, 
some computer technology inside it. 
Then, to top it off, you add Internet connectivity. 
Now, this is very common in things, and 
that's where the term Internet of things comes from. 
You add some kind of Internet connectivity. 
So now you've got a thing. 
It's got some kind of computation inside and it's got a network connection which 
means it can use all sorts of other resources that are not local. 
Right? 
It can reach on the Internet. 
It's potentially accessible from this IoT device. 
So all that put together is generally what you'd call an IoT device, 
an Internet of Things device. 
You take the thing, you put some intelligence in there, and 
you put some network connectivity. 
And remember that, from the outside, 
this device doesn't look that much different than it used to look, right? 
It doesn't look like a computer, that's the main thing. 
It doesn't look like a computer. 
It doesn't have a full on keyboard and a screen, it might have a screen, 
a few little buttons on it but it doesn't look like a standard computer. 
You don't have to install Windows or iOS or Android or 
whatever the operating system is. 
It's none of that complexity. 
So it's much simpler to use, just like the original thing was. 
So if you look at the now, 
the new refrigerator, it's not gonna be hard to use. 
You still open a door, close a door, plug it into the wall, that sort of thing. 
Get ice out of it. 
The same old simple interface.

Start transcript at 3 minutes 15 seconds3:15


So traditional refrigerator, keeps items cold, right? 
This is a non Internet of Things. 
Keeps items cold, you put things in it, food, whatever it is. 
A real simple interface, all right? 
Everybody knows how to use it, and decades ago it was the same interface. 
Right? A hundred years ago, I don't know if they, 
yeah I guess I suppose they had refrigerators a hundred years ago. 
Hundred years ago, you had a refrigerator that looked basically the same thing.

Start transcript at 3 minutes 40 seconds3:40


Now, an intelligent refrigerator, I'm using that term to mean refrigerator 
that now has some kind of computational intelligence inside it. 
And you see a lot of this inside refrigerators nowadays. 
My fridge is like this. 
So, for instance, it'll warn you when the door is ajar. 
Usually it'll beep in some way, but it could talk to you if it wanted to, 
it doesn't matter. 
But it'll warn you that. 
It basically has some sort of sensors built in that tells if the doors are shut. 
And if they're open for a certain amount of time, maybe they start a timer, 
if they're open for a certain amount of time, an alarm goes off and 
that requires some kind of computational intelligence.

Start transcript at 4 minutes 15 seconds4:15


It might tell you when the water filter need replacing. 
Mine is annoying in that way, it tells me the same thing. 
So it starts beeping every time I try to get water now, 
in fact right now I need a filter. 
So it just beeps and beeps and beeps every time I try to get water out of it. 
So again it has some type of timer where it keeps track of the date. 
Says okay, this many days have gone by since you last refilled the filters, 
you changed it. 
So again requires computational intelligence. 
Note that it doesn't require networking yet right? 
These tasks are just computational tasks.

Start transcript at 4 minutes 44 seconds4:44


It could tell you when you're low on butter. 
Now my fridge doesn't do this, but you can imagine a refrigerator 
that has some sort of a sensor in there that can sense. 
Maybe it has a camera in your butter tray and it senses when your butter is low. 
Right? Maybe it tests the weight of your butter. 
Right? 
And if the weight is too low it says, okay. 
There isn't butter in here. 
You are low on butter. 
It could easily warn you of that. 
Now mine doesn't do that. 
There are refrigerators that can do that sort of thing. 
But, again, local intelligence is required. 
No real networking required to do that.

Start transcript at 5 minutes 14 seconds5:14


It could also tell you when you buy foods that are high on fat content. 
Now, this I've never actually seen such a refrigerator, but you could do this. 
You could take a picture, the fridge itself could have a camera inside. 
Could take a picture of the food that you ordered, look it up in some type of 
a library of food that it has, and look at the food content, 
look at the fat content and cholesterol and so on, and it could warn you, right? 
And it could do this with local data, without network connectivity, 
if you need it to.

Start transcript at 5 minutes 42 seconds5:42


You can also have a set of recipes programmed into your refrigerator. 
I know there are refrigerators that have this. 
They can be programmed into your fridge and they can suggest recipes for 
you based on the foods it sees inside. 
So you've got milk, you've got butter, you've got this, you've got that, 
you can make pancakes today. 
Something like this. 
So, that's another thing that, 
another feature that you can add on to an intelligent refrigerator if you wanted to. 
And it requires this computational intelligence inside the refrigerator to do 
that, also sensors, like cameras maybe, 
weight sensors, door sensors to see if the doors open and close, something like that. 
And using all that together, 
you can enhance the properties of the refrigerator. 
So now this refrigerator, it does a lot more than what it used to do, but 
it's still very easy to use, right? 
You don't have to do anything complicated. 
It tells you the door is ajar, or something like that. 
It's not extra work for you, no learning curve, all right. 
So, you might call that an intelligent refrigerator, but 
you'll notice that these features that I'm listing here. 
They don't require network connectivity in general. 
So these things that I'm listing here, 
they can do that with local sensors, right? 
And local processing that sense what's in your fridge and respond to you and 
give you information.

Start transcript at 6 minutes 49 seconds6:49


So that's intelligent refrigerator. 
But maybe you wouldn't call that Internet of Things, 
cuz it's not actually networked yet.

Start transcript at 6 minutes 56 seconds6:56


So the ultimate, the IoT refrigerator. 
The IoT refrigerator is basically the computational intelligence, 
but also network connectivity. 
With the network connectivity you can add another set of features on top of that, 
that you couldn't have added without the network connectivity. 
For instance, you can have your refrigerator actually order food for 
you when the stock is low.

Start transcript at 7 minutes 16 seconds7:16


That could easily happen. 
It can check, it could just go straight to Amazon. 
Amazon, I guess I shouldn't advertise, but there are services 
from which you can go to supermarkets and order food, I use one of these services. 
And they deliver food the next morning, actually. 
It's pretty amazing. 
Seven in the morning and the food will be there in the door step. 
So, you can have your fridge detect that you are low on butter and then just 
order that, and then the next morning, butter will appear on your doorstep. 
But that requires network connectivity. 
You have to be able to connect to the network, and place the order, 
grab money out of your bank account, right, 
transfer it to whoever you're purchasing it from, things like that.

Start transcript at 7 minutes 53 seconds7:53


You can search for low food prices. 
So it also suggest to you look, you might wanna buy this item. 
You're low on butter. 
Buy butter from here rather than there because it's cheaper. 
And in fact, it can go ahead and just buy that, or it can just suggest to you. 
But again, that requires network connectivity. 
It would have to connect to the network, go search around different sites, 
different super market sites, find the different prices, compare them, and so on.

Start transcript at 8 minutes 16 seconds8:16


It could order a water-filter when you need a water-filter. 
So rather than annoying me and telling me, you need water-filter beep beep beep. 
It can just go and order that, and it could appear for 
me, UPS could deliver it the next day. 
Right. 
So it can anticipate meals. 
It can be predictive. 
So it can know what kind of food you have in your fridge and 
order what you need for tomorrow's meals, right. 
Took, and say oh, a good idea for food for 
you tomorrow is this type of meal that you've had in the past. 
I will order whatever you need for that meal, and 
then it'll appear in your doorstep the next morning. 
And then you'll have everything you need to cook what you need for the next day.

Start transcript at 8 minutes 53 seconds8:53


It can search news. 
Probably it could actually do more global type of searching. 
It could look on news prices to see what global trends are, so for instance. 
And this is elaborate, but you could certainly do this. 
It could look at news trends and say, oh it's El Nino.

Start transcript at 9 minutes 7 seconds9:07


Right, the world is getting colder this year. 
That means that fruits are gonna be more expensive, right. 
So I better stock up on fruits right now, 
because I know that in a few months I won't be able to get them, right. 
Your machine can do that, your fridge could do that. 
Now I've never heard of a refrigerator that does that, but that is certainly 
possible, if you have the computational intelligence inside the fridge and 
you have network connectivity so it can actually execute the searches.

Start transcript at 9 minutes 31 seconds9:31


It could also provide information to 
businesses to tell them what you're buying, right? 
Now this maybe is not an advantage to you, but certainly

Start transcript at 9 minutes 42 seconds9:42


some store that's selling different type of food, it might want to market to you, 
so they might want to know these people are buying this type of food a lot. 
So maybe we wanna market that type of food to them. 
That's another thing that these devices do, and 
we'll talk a little bit more about that later.

Start transcript at 10 minutes 0 seconds10:00


Thanks. 
[MUSIC]

[MUSIC] 
This lecture will give some more examples of the Internet of things devices. 
Just to give you a sort of a better more concrete idea of what these devices 
are and how they differ or how they're distinct from traditional computers. 
So we'll run through a few more examples and 
get a little more detail about their behaviors.

Start transcript at 29 seconds0:29


So take a car, a car is an IoT device, I will claim. 
Okay, the reason I call it this is, 
because if you look at a car, Ii's a thing, clearly. 
You look at a car, an old car, there's an old car, a 50s car maybe. 
So old cars had a certain interface, right? 
You drive, you have a steering wheel, gas pedal, brakes, and so on, the radio, 
sort of a simple, straightforward interface. 
What I would consider to be simple. 
Now that interface, it was basically implemented with electrical and 
mechanical controls, but there was no computational intelligence in there. 
Early cars, they didn't have computers in there, processors doing anything. 
There was electricity, there's mechanical stuff, but that was it. 
So that was an original device, it's not IoT, from the 50's. 
But nowadays cars have lots of computational intelligence. 
Let's take a look at this. 
So, 21st century car. 
So what is that? 
Looks like a Prius I think. 
This car, its got lots of chips in it, so lots of processors. 
That car might have over 50 processors in it doing different tasks.

Start transcript at 1 minute 37 seconds1:37


For instance its got an anti-lock braking system they all do these days and 
the anti-lock breaking system, 
it'll have its own processor dedicated just to anti-lock braking. 
And so, its got that. 
Its got fuel injection, right? 
Fuel injection system, its gonna have another processor dedicated to that. 
So every sub system has its own processor. 
And it's also got a stereo, say. 
Stereo system's got to have it's own processor, but 
every subsystem inside the car has it's own processor. 
But the thing about this car that you notice about this device, 
is that even though it has this computational intelligence, 
it has the same basic interface as that 50s car. 
So you drive this car pretty much the same way. 
Now the 50s car, it probably had manual transmission, I'm gonna guess, 
because it's the 50s. 
So this will have automatic transmission. 
But besides that, it has the same interface, the same steering wheel, 
gas pedal, brake. 
So you could train somebody to drive on the 50s car and they could drive this new 
car, even though this new car is enhanced with all this computational intelligence. 
So, that's the thing about IoT devices, they have a very simple interface. 
They want to be easy to use, they want to give you the benefit of this computational 
intelligence, so now you have anti-lock breaking for instance. 
And anti-lock breaking in case you don't know, 
anti-lock breaking, it prevents the tires from locking, so 
you don't want the tires to skid compared to the road, right? 
They should always stay in good contact with the road. 
But if you brake hard, if you"re moving fast, 
you brake hard, the car will skid and the tires will not move but the car will move. 
So anti-lock braking tries to prevent that. 
Now, before anti-lock braking, 
what you used to do, I remember when I learned how to drive on snow. 
You skid a lot, right? 
So what you do, is when you do a hard break, you'll pump the breaks, right? 
Manually pump the breaks. 
And you'd have to remember this, 
you'd have to be pretty consciously aware enough to remember to do this. 
Anti-lock breakings do that for you, right? 
Excellent breaking devices, they take care of that for you. 
So this is a great benefit to drivers nowadays. 
Kids they don't even know about pumping breaks. 
They don't learn that because they don't have to, 
anti-lock breaking takes care of it. 
So the computational intelligence is helping you, 
reliving you of burdens that you didn't wanna have to deal with. 
But the interface is beautiful. 
You don't have to worry, you just hit brake pedal just like you used to. 
It just does better. 
It just does what you want it to do, does better and 
makes everything easier for you. 
Now, a typical car like this car that we're looking at right here. 
This car, it has computational intelligence, now whether or 
not it has networking is a different thing. 
Cars now a days, actually these days, cars are having more and more networking. 
And you may have heard of this in the news, but cars are networked actually, 
so you can, for instance, remote start a car, right? 
Start it when you're not near the car, you can start it through the network. 
Cars also have, what do they have in there? 
Those, I forget the name of the brand, there's OnStar, is one brand name. 
But when there's an accident, the car can, through the Internet, 
connect with 911 and call and get help, right? 
So this type of thing is present in cars. 
My car does not have that. 
But I'm cheap and I'm a professor, I buy old cars. 
So my cars are old but new modern cars have these features built in there [LAUGH] 
and they are actually networked. 
So that would be a modern car. 
The most modern car, that would be an IoT device because it has the computational 
intelligence and it's also networked to add extra flexibility. 
So, that's one device. 
Let's take a look at another. 
Let's talk about logistics. 
Tracking things okay, logistics. 
So say you are Walmart or some big company or your the military, something like that, 
and you want to move lots of things between different 
places on a certain time scale, right? 
You need to get these from this manufacturing place to this sales 
place on this schedule. 
That's logistics. 
And the military is all about logistics, right? 
We are waging a war. 
We need to get these devices from here to here and 
these people from here to here on this time frame. 
So you wanna move things. 
So say you're Walmart, and 
you would have to be able to track these devices that you're moving. 
You wanna make sure that they are moving place to place in a certain time frame. 
And you want to be able to at any time, be able to say, 
where is box number whatever, right? 
How many boxes do we have of this type of device at this location at this time? 
And you need to be able to track that dynamically, so 
you can get count for things like, weather difficulties, right? 
Maybe the planes are shut down so 
you can't move enough devices from here to here. 
So you need to know how many are here so you can reroute things.

Start transcript at 6 minutes 13 seconds6:13


So, to do that, one way, a very common way, is to use barcodes. 
This helps you because every box, every device, it has a barcode which has some 
basic information about what's in the box, right? 
And where the box came from, stuff like that, gets stuck on the box. 
Now, barcodes are in very common use today. 
We use barcodes, if you look at any food item, you go to the supermarket and 
you check yourself out, you run the barcode over the scanner. 
So barcodes are very useful and they have a certain amount of 
information on there and they make it so that you can just scan the device and 
find out information about the device, or whatever it is, the box. 
And it makes it easy to track.

Start transcript at 6 minutes 48 seconds6:48


So this is basically old technology, barcodes have been around for a long time. 
Nowadays, you also find RFID tags. 
So RFID tags, you can see the antenna, for one, right there.

Start transcript at 7 minutes 2 seconds7:02


It's basically an electronic version of a bar code. 
And what you're seeing is that sort of spiraling wire, 
that's actually the antenna, okay? 
A remote antenna. 
And what RFID tags allow you to do, why they're an improvement over barcodes is, 
the first thing is, they basically have a processor inside there. 
So you can have a lot more information about the device than what you 
could encode inside a barcode, right? 
A ton more information. 
And that information can change, right? 
Because barcode, once you print that on the box, that will never change, right? 
Until you rip off the barcode, put a new barcode on. 
But that data can never change. 
With an RFID tag, that thing could have flash memory in there if you want to, 
that actually reloads, that gets changed and updated over time. 
So for instance, if you want to track where a box moved, t he box itself and 
it's RFID can store that information over time. 
So, as it moves from place to place you can store that and 
you can see the whole path that the box took, all right? 
So, RFID another benefit of these, 
is that you don't have to be right next to them to scan them. 
So, if you know anything about a barcode, you have to take a scanner and 
put it right up to the barcode in order to scan it, you have to try, right? 
You have to, I mean, if you ever scan, like just yesterday I was at Albertson's, 
scanning food out. 
I have to work to get that scanner directly over my barcode, right? 
With RFID tags, there's a range. 
So you just have to be within proximity. 
You don't have to have any particular orientation. 
Just be near it, which is helpful, right? 
Then you can just run every box near a scanner, and it'll catch it. 
So RFID tags have a lot of advantages over barcodes and they can easily be networked. 
So the scanner can be network connected to the Internet so 
you can keep constant track of where all your boxes are at some global site. 
So Walmart can know where every box is and what manufacturer, what plant it's in. 
And they can keep it all centrally because the IoT RFID scanner is 
actually connected on the network to its main cloud service. 
So, devices can become an IoT device if you put RFID tags and 
the computational intelligence on to them. 
Thank you. 
[MUSIC]

[MUSIC] 
This lecture will compare IoT devices to standard computers, and 
it will just compare and contrast. 
Just so you get an idea of the difference between an IoT device and a computer, 
because they are substantially different. 
And we'll need to know this for 
later because we're gonna talk about how you design IoT devices. 
And the design methodologies are very different than what you'd use for 
a standard general purpose computer.

Start transcript at 35 seconds0:35


So, IoT devices, one big difference between those type of devices in standard 
computers, and by standard computer I mean desktop, laptop, server. 
Basically a big box with a keyboard, big box or 
little box, with a keyboard and a screen, mouse, that type of thing. 
So one difference is that IoT devices, 
the main function of an IoT device is not to compute. 
Not to be a computer. 
A computer is there to be a computer, to compute functions, to run programs.

Start transcript at 1 minute 6 seconds1:06


But an IoT device, that is not its main point. 
It has some other function besides that. 
So, for instance, we talked about cars last lecture, right? 
So cars, their IoT devices, their main function is not to 
compute anti-lock breaking or to do fuel injection, 
their main function from the point of view of a user is to be driven. 
Right? To move you from place to place. 
And the computer is just to help that function, just to support that. 
Also, we talked about refrigerators, right? 
In an earlier lecture. 
So, a refrigerator, it's a refrigerator, it keeps things cold, 
that's its main function. 
Now, computational intelligence can help you, network connectivity can 
improve its ability, but that is not its main function, to talk on the network. 
Its main function's not to run code, even though it does that,

Start transcript at 1 minute 53 seconds1:53


where a computer, it's main function is to run code. 
So that's a big difference, that's the focus of the function. 
That IOT have this separate function, separate from computation.

Start transcript at 2 minutes 6 seconds2:06


So computers, like I said, their main function is to compute. 
They run code. 
This code can do lots of different things, but they execute code. 
This picture right here, we're showing a decision making process. 
It's sort of a high level view of what PC code would look like, but 
there'd be conditions in there. 
If X is greater than five, then perform this action. 
If X is less than five, then do another action. 
Something like that. 
That's what code looks like, and that's the point of a compute,r is to 
execute code, execute a sequence of functions in a particular order 
as determined by dynamic information, like that condition right there. 
That condition might check something dynamically at runtime. 
And we'll get into more detail of this, because we will be coding in this class. 
But right now, 
the function of the computer's main point is to run code like this.

Start transcript at 2 minutes 52 seconds2:52


IoT devices, on the other hand, they don't. 
So computers are made to be general purpose, right. 
They're made to run any kind of code. 
So if you buy, off the shelf, you buy some Intel processor. 
I see a Mac in front of me. 
Say I buy a MAC. 
This Mac is a laptop. 
This Mac laptop is meant to run code and it can run any kind of code. 
I can play a video game on that thing. 
I can connect it up to a camera and video record something. 
I can do, whatever kind of code I want to run on that computer, I can do that. 
So computers are made to be general purpose devices.

Start transcript at 3 minutes 26 seconds3:26


Now, they're not particularly good or 
efficient at a particular application, but they are generally good at everything. 
So what that means is say, this one I see right here, this Mac. 
This Mac is now connected to this camera, and I'm assuming that this Mac is probably 
running the PowerPoint slides [LAUGH] that I'm presenting, 
and it is probably recording some, right? 
So sure, you can use a Mac to record video if you want to. 
You can connect it up to a camera, record a video, record a sequence, 
but a dedicated camera is better than a Mac at doing that. 
Right? I can take a Mac and 
connect it up to a webcam, and it's now a video recorder. 
But it's probably gonna be better, more efficient to get a camera, 
a video camera that is made for that purpose to do that task. 
So computers are general purpose, they can do whatever you want. 
You hook something onto them, they can do what you want. 
But they are not necessarily the most efficient and 
most effective tool at doing that. 
So Internet of Things devices are generally special-purpose things.

Start transcript at 4 minutes 30 seconds4:30


So they are made to do a particular task or 
set of tasks that are all related to one thing. 
So as an example, music player, right? 
So I still own one of these, an mp3 player, cuz I'm cheap. 
You can buy them cheap. 
You can do it off a phone, too, but I use a special purpose device, you know, 
like an iPod, right? 
So these devices are made to play music. 
Now, you can play music off of a laptop, right? 
Desktop, whatever. 
But this device is made for music playing, and so it's more efficient. 
And by mor efficient, I mean Its hardware and 

its software are designed just for that purpose. 

So if that's all you wanna do. 


They play music very well. 
They're cheap, right? 
They don't cost much, right? 
You don't have to buy a whole laptop for that. 
You can just buy a little iPod, little tiny one, right? 
They have the little iPods, the randomization, the shuffle, 
iPod shuffle, right? 
Tiny, cheap.

Start transcript at 5 minutes 21 seconds5:21


Very compact, much smaller than a laptop, right? 
But they do their job, so that specific job, they do great. 
So these IoT devises are almost always special purpose devices. 
Take a car, right? 
Now a car, a car will do many different things, but 
they're all related to driving. 
So a car can do anti-lock braking. 
A car can do fuel injection. 
A car can do power steering, all these things, but 
they're all parts of one big task, to drive. 
To be driven, right? 
So that's why I say a car does computation but 
only computation that are related to the task that are driving tasks. 
So what that means is the hardware and the software built in there. 
Are streamlined for that purpose. 
So that means they can be cheaper.

Start transcript at 6 minutes 11 seconds6:11


Cheaper effect, more efficient in that way. 
Cheaper and faster at doing just that one task. 
Now they wouldn't be suitable to do anything else, right? 
So if you took your car and said look, 
I wanna play a video game with my car, you probably can't do that as well. 
But if you wanna say, 
look I wanna do fuel injection with my car, hey it's perfect for that. 
And it's great at that and efficient at that. 
So That's a big difference between IoT devices and general purpose computers. 
IoT device is a special purpose. 
They do a particular thing. 
Thank you. [MUSIC]

[MUSIC] 
This lecture we'll talk about the various trend [INAUDIBLE]. 
Technological trends that have led to the incident of things, say revolution. 
It's a overused word, but let's try to use that right now. 
So there are lots of different trends that have led to this, 
led to the incorporation of things, technology into devices today. 
And so we'll talk about those things. 
And it sort of crept up on us over the years, 
but now there's this convergence where the situation is right. 
Everything works and 
you can really do a lot of the things that you see in these IoT devices today.

Start transcript at 42 seconds0:42


So there are several trends. 
One trend is cost, is the straight cost of devices, 
so things have gotten a lot cheaper. 
Computational technology has gotten a lot cheaper than it used to be. 
Now, these are extremes, but take ENIAC. 
Early machine, 1945, very early. 
Not the earliest, but very early machine. 
At the time, it cost almost half a million dollars which in today's dollars is a lot 
more than that, at the time. 
So that was expensive, very expensive for the cheapest available machine. 
Now you can get a laptop for $500. 
You can get one cheaper than that, you can get one more expensive, but 
you can get a very capable laptop for $500. 
So things have gotten a lot cheaper over the years. 
And by the way, I'm saying you can get a laptop for $500, an IoT device. 
The computational ability of it is a lot less than laptops. 
So it will be a lot cheaper than $500. 
But the point is that over time computational technology has 
gotten a lot cheaper. 
And so it's within the reach of what you could add on to a lot of different 
devices. 
So you wouldn't have wanted to take your standard car in 1945 and 
add an ENIAC to it because it would add $500,000 worth of cost, right? 
But now you can add on some low cost device and 
get the benefits of computational technology without too much cost. 
So this is a picture of ENIAC, the original. 
It is big. 
Big and expensive. 
So this is another thing that's changed. 
It also has a lot of wires. 
If you look at it, the way they programmed it was with wires. 
A lot of wiring going on in there. 
Manual wiring. 
So this is a picture of it and it was big. 
So that's another trend. 
Hardware size. 
Things have become smaller. 
Now that old ENIAC there was no possible way you were going be able to get that 
thing and fit it into a device, into a thing. 
So that old ENIAC was, say approximately, 1,800 square feet, 27 tons. 
It was a big thing. 
But a laptop today is small, small and light. 
And IoT devices are smaller and lighter than that, so think, 
computational technology has also shrunk and gotten lighter, 
to the point that it can be incorporated in lots of different devices.

Start transcript at 2 minutes 46 seconds2:46


So this is just a size comparison.

Start transcript at 2 minutes 49 seconds2:49


See, so we've got ENIAC over there, different lighting but 
basically the same machine, and then we've got a laptop. 
And you can see how the computational technology has just vastly shrunk to 
the point where you can actually incorporate it into devices.

Start transcript at 3 minutes 4 seconds3:04


Now, another big trend that helps make IoT possible is the fact 
that computational ability has grown dramatically since, say, 45. 
So in 45, that ENIAC that you saw, 
that got approximately 5,000 instructions per second.

Start transcript at 3 minutes 22 seconds3:22


Now, a standard laptop 18 billion, now this is plus or 
minus, right, but 18 billion easy.

Start transcript at 3 minutes 29 seconds3:29


That's a dramatic improvement, and what that buys you, 
what that gives you is a fact that you can implement a lot more features. 
There are many things that you couldn't have dreamed of being able to do back 
in '45 with a computer that you can now handle because you have so 
many more computations to play with in a unit of time. 
So, for instance, speech to text, right? 
That's common in phones today, right? 
Where you talk and it interprets your speech. 
There's no way with 5,000 instructions per second you could do that in 
anywhere near real time.

Start transcript at 3 minutes 59 seconds3:59


Audio processing, network communication all these things that you can do now 
that require lots of computation and it just wasn't possible with old machines. 
So with modern machines there is so much computational ability, 
their clock rates are so fast and there is parallelism. 
These things are multi-course, you got multiple processes in one device. 
There is so much computation ability you can. 
You can do so many more things that were thought of back then and 
couldn't have dreamed of back then, but now, we see there's so much you can do. 
So, it makes it more practical using devices today to implement 
the features we're interested in implementing.

Start transcript at 4 minutes 35 seconds4:35


Another trend is Internet access. 
So, in '45 the Internet didn't exist. 
Networking wasn't there, but Internet access has improved. 
So, the Internet is reachable from a lot of places. 
First, it exists. 
Right? It didn't used to exist. 
But now it's also true that in lots of different places, 
almost everywhere, you can access the Internet through some mechanism. 
Now this depends on what country you're in and how much money your country has. 
Some parts of the world poor parts of the world have less access. 
We're in the US you have pretty good access. 
Wherever you wanna be you can access it directly through wi-fi, 
you can access it through jacks in the wall I mean we have ethernet jacks in 
the wall right here you can do it wirelessly you can do it everywhere.

Start transcript at 5 minutes 19 seconds5:19


Now different parts of the world have less access, 
if you just look at this map, you can see the lighter parts are less access. 
Most of Africa, a lot of Africa has less access is just because they're out of 
reach of many different, a lot of the infrastructure that's necessary. 
But there are some place like India, that actually lower, 
in fact, I question this map. 
I don't thing it's as bad as what's being stated on here, but 
it is generally true that there are parts of the country, poor parts of the world 
rather, where Internet access is harder to find. 
But generally it's greatly improved over time. 
Also the fact that you can do Internet access wirelessly. 
That actually helps a whole lot because running cables is expensive. 
Where putting up a wireless router is much less expensive. 
Putting up a cell tower that costs a certain amount of money, 
but given the expanse that it covers 
It's much more cost efficient than having to run wires into everybody's home. 
So wireless access is one of those things that's ubiquitous now, and 
it makes IoT technology much more usable and much more possible.

Start transcript at 6 minutes 32 seconds6:32


Data costs. 
So the cost of Internet access is fairly low. 
Now this definitely varies depending on where you are.

Start transcript at 6 minutes 40 seconds6:40


It's never low enough for me. 
I don't like how much I have to pay every month on my cell phone bill or for 
my cable bill, stuff like that. 
But it's low enough that a lot of people can afford it. 
In poor countries, this is not necessarily the case, but that's changing.

Start transcript at 6 minutes 58 seconds6:58


Bandwidth is high.

Start transcript at 7 minutes 0 seconds7:00


So what this means is that you can transmit lots of data fast.

Start transcript at 7 minutes 5 seconds7:05


And that actually enables a lot of different features. 
So streaming movies for instance, right? 
If you want to stream video, you need a lot of bandwidth, right? 
As opposed to just sending data. 
If you want to send email, you don't need a lot of bandwidth. 
Email has a certain amount of text and it doesn't take much data to transmit. 
But if you want to support video, 
you need pretty good bandwidth to support it in real time. 
To send the frames, lots of pixels, it takes you a lot of bandwidth. 
But bandwidth is available in a lot of places. 
And wirelessly too. 
So you can, through wi-fi or 
some other type of wireless technology, cell phones, you can actually get enough 
bandwidth to be able to see videos through that technology. 
So the bandwidth actually has enabled a lot of different features in IoT devices. 
Thank you. 
[MUSIC]

[MUSIC] 
This lecture we'll talk about the pervasive nature of IoT. 
The fact that IoT is everywhere, [LAUGH] and 
even though we're not necessarily aware of it all the time. 
It's there and it's helpful, generally helpful. 
So not only is it everywhere, it's also networked. 
So it gives you access to all these abilities, all these features of things 
that are in the network and it gives you access to them at all times. 
So it's sort of a constant connection.

Start transcript at 37 seconds0:37


So there are a lot of abilities to that, it makes it very powerful.

Start transcript at 40 seconds0:40


So first, a lot of what you can think of as IoT devices, 
you can see them as an interface to the Cloud, right? 
By the Cloud, I mean big, powerful compute servers 
that are accessed through the Internet, so we'll call it the Cloud. 
And these compute servers can do a variety of things for you.

Start transcript at 1 minute 0 seconds1:00


And we can see that devices, small devices, 
IoT devices, are basically a window to these Cloud servers. 
So take Siri, Siri's an example we're talking about here. 
You can see that as a window into 
the Cloud servers that have gigantic databases of information. 
So you can ask Siri some question, it will go search for 
the answer inside some massive cloud database and give you the answer back.

Start transcript at 1 minute 27 seconds1:27


So really your IoT device in that sense is just a window 
into some massive computational resource. 
So not everything is going on on your IoT device. 
So say we're talking about Siri specifically, 
your phone has to do some computation, speech-to-text, right? 
It has to figure out what you're saying. 
But the actual query that you state, 
that's not actually processed directly on the phone. 
That thing is sent to the Cloud, and the Cloud processes it, 
gives you the result and Siri recites it back to you. 
So you can see that these IoT devices actually give you, 
they leverage a much bigger set of servers that are available out 
there on the Cloud if you want them to. 
For instance, viewing movies, say Netflix, something like that, 
the movies aren't sitting there on your phone or whatever the device is. 
The movies, your phone, or 
whatever the IoT device is is really a conduit for viewing the movie, right? 
You're really going to some big servers, Netflix servers. 
You're streaming the movie directly off of those servers. 
So your device is in some ways just a conduit to something much more powerful 
than your actual IoT device. 
So there are a lot of IoT devices that act in that way that are just 
access points for something much bigger out there in the Cloud. 
So this is basically leveraging the networking features of these IoT devices. 
So that basically just what I was saying, you can access these large databases, 
large computational service to get, whatever access to whatever kind of data 
you wanna get, and to do, perform things that you wanna perform, 
format operations that you need to form remotely.

Start transcript at 3 minutes 7 seconds3:07


So, IoT is also pervasive. 
Since networking is pervasive, IoT is pervasive, which means it is everywhere. 
It is embedded in devices and you're not necessarily aware of that, but 
they're are all over the place and if you just look around whatever room you're in, 
you'll probably see these devices. 
I mean, of course, I'm staring down a camera right now, so that's an IoT device. 
There are cameras all over, microphones and all this, 
projectors, things like this. 
They're all in this room. 
My watch, my phone, they're all over the place just helping me in various ways. 
So if you look at your house, you think about inside your house, how many 
computers you have inside of your house, traditional computers, laptop, desktop. 
I probably have probably four or five laptop, desktop machines in my house. 
But if I think of how many IoT devices I have, a lot more, right. 
I just, see my DVR, right, my fridge, 
my microwave oven, my TV, my game machine, right? 
My several, I have several. 
[LAUGH] I have XBox One. 
I have all these. 
So I have my watch, my phones, my kids' phones, right? 
There's so many IoT devices just everywhere.

Start transcript at 4 minutes 18 seconds4:18


Home automation systems, I do not have a home automation system, but 
that's a common use. 
Home automation systems that are connected to the network, so you can, 
you've probably seen commercials on this type of thing. 
You can go to your cell phone and turn off your lights at home from your cell phone, 
things like this, right. 
So, IoT devices are pervasive and they're just everywhere.

Start transcript at 4 minutes 39 seconds4:39


At work, too, so, at home, at work. 
At work, well, my work, we have motion sensors in every room. 
For lighting, right, 
to save the power on lights, the lights go off if there's no motion in the room. 
So they have motion sensors in every room, down every hall, 
checking to see if something's moving and if they need to keep the lights off or on. 
And you've probably been in places like that. 
Also RFID tags. 
I need an RFID tag to get into my building, right. 
I run it past the machine and it lets me in. 
So there's also this type of, my phone, that's another thing. 
My phone, phones nowadays, there's cell phones. 
But there's also even desktop phones nowadays are in Internet things devices, 
right, cuz these are Voice-over IP phones. 
My phone is a networked phone. 
It sends data over the Internet directly. 
It doesn't even use the regular phone system. 
It goes straight to the Internet, right. 
So phones, everything, lots of different devices are IoT devices, even at work. 
Also on your person, so 
these things are now integrated into your body in some sense. 
So hopefully, not too close. 
But health trackers, right, these things are strapped onto your wrist and 
they can track heart rate, all sorts of features they can track about you. 
And they're strapped onto you, they are networked. 
So by Bluetooth, they go to the Internet and 
maybe send that information to a server, to a global server. 
And if you have one of these things, like a Fitbit or 
something like that, you know how they work. 
Pacemakers, oh, those are the ultimate. 
Those are literally embedded within you and they control your heart. 
Actually, pacemakers are quite sophisticated. 
They track your heart, but say your heart stops, they can restart your heart. 
They can give you a charge, right? 
Give you a shock and start that heart again automatically. 
And they are also networked. 
So you have to be able to program them, reset them periodically. 
So they are usually not regularly networked but 
when the doctor wants to reset it in the office, he can do that by radio.

Start transcript at 6 minutes 32 seconds6:32


Insulin pumps, so these are common, too. 
Actually, I knew a guy, I meant to bring one to lecture today. 
But I knew a guy, he had diabetes, type 2, I believe, 
but it was pretty severe, and you need insulin injections. 
What he had was a device like what you see here where it would give the injections, 
while during the day, it would sort of inject him at the right rate. 
And he had to have this under his shirt. 
He had this device, a device like what you see in there. 
It was taped under his shirt. 
And it would know how much insulin to give him on a regular basis. 
So he didn't have to do it, it just gave it to him. 
So diabetes is one of those things. 
It's about regulation, regulating the insulin level. 
So your body normally does this. 
If your pancreas is working, it does this perfectly, right. 
It senses how much sugar you have in your bloodstream, 
it puts in insulin in the right dose to keep it level. 
But if your pancreas isn't working, then you have diabetes and 
you need a device, an external device, to do that. 
Now you can do it manually or you can have a device like these insulin pumps which 
actually do it for you and they push in the insulin at the appropriate rate. 
So these things are basically integrated into you, right? 
Now cell phones are not integrated into you, not quite, 
they are not quite connected to your ear, but I know a lot of people who cannot 
leave their house without their cell phone, right? 
So you forget it, you're like, look, I gotta go home, 
I have to have that thing with me. 
So it's not physically connected but it might as well be.

Start transcript at 7 minutes 55 seconds7:55


All right, pervasive. 
So other places, not even on your person, but everywhere, on the streets, right? 
So I watch TV. 
I watch Law and Order a lot. 
How many times have I seen the cops in Law and Order, this is TV, but 
using video surveillance devices, you know, the ATM had a camera and 
they used that to catch the crook, right. 
There are devices all over the place that are surveilling us for 
beneficial purposes, okay. 
Like traffic light cams, okay. 
Now traffic light cams, it's beneficial, right, they gotta ticket you. 
I don't like it, right, but I can see the social benefit to being able to track when 
somebody runs a light and giving people tickets. 
Otherwise everybody would be running lights all the time, right. 
So that type of thing, that type of surveillance, goes on all the time. 
Actually In London, their traffic cameras do more than that. 
They actually track your license plate numbers. 
So they can track criminals by looking at their license plate numbers 
automatically as they're going through the city. 
So IoT is everywhere, in all sorts of devices that you interact with every day. 
Thank you. 
[MUSIC]

[MUSIC]

Start transcript at 11 seconds0:11


Let's talk a little bit about the benefits to society that Internet 
of Things can have. 
And that's why we do these things, right, presumably is to benefit society, 
to help people. 
So, we'll talk a little bit about that. 
So, generally, these IoT devices, 
the use of Internet of Things technology makes life easier, that's the goal. 
In lots of different ways depending on the device, but 
it's supposed to make life easier.

Start transcript at 39 seconds0:39


So for instance, 
some lectures ago we talked about an Internet refrigerator, right? 
An Internet refrigerator that was intelligent, 
could order your food for you. 
It takes care of things you don't necessarily want to take care of, right? 
It takes care of these details that you would have had to spend time on, but 
now you don't, right? 
It says okay, you need this food, I will order this food. 
And I don't have to worry, necessarily, about doing that ordering, right, 
because I'm busy, I have more important things to do. 
So, it's supposed to make things easy for you. 
Are my accounts balanced? 
Let's say I have my phone device, I'm using it to do my banking, 
right, and it balances my accounts. 
It says oh, you owe this much, I will simply transfer the money, right? 
So that was a details where maybe I don't want to deal with those details, right? 
I want to do something fun with my life, but I have to balance my accounts and 
pay my bills. 
But my device can deal with that for 
me rather than me having to think about it consciously all the time, right? 
So, that's generally the goal of IoT is to just enhance these 
devices to make them better. 
And the key thing, 
key aspect of that is to make them better without adding complexity. 
So, you don't wanna have to, sure, 
say I would like to have a refrigerator that can order my food for me, right? 
But I don't want to have to write code to get it to do that. 
I want it to be easy, almost as easy as a regular refrigerator, but 
still do these nice things for me. 
So, you enhance the features of some devices 
to make them do things that are very helpful to you. 
But, you don't want to enhance the features in such a way that it increases 
complexity. 
So the complexity is dealt with by the computational infrastructure inside 
the device.

Start transcript at 2 minutes 19 seconds2:19


IoT can also help you be independent of people, right. 
So you don't need to have as many people as you used to have to do certain things. 
So this is good and this is bad, right. 
So, certain things that you would have had humans deal with, 
now your IoT device can deal with for you. 
So, for instance, fewer doctor visits, right. 
If I had my health monitor on my wrist, I don't have to necessarily go to the doctor 
to have the doctor tell me oh, your blood sugar level is fine, right? 
Or, your heart rate is fine, everything is going well. 
My device can see that and report back to me and say yes, everything is fine, and 
I don't need to see the doctor as much. 
Now, there's still always a need for a doctor, but 
maybe just when something calamitous happens. 
Maybe on a regular basis, I don't need to see the doctor as much. 
So, going to the super market. 
I don't have to go the supermarket if my fridge is buying my food for me, right? 
And ordering it on Amazon Fresh, or something like that. 
I don't have to deal with that nearly as much. 
So I don't have to actually interact with people as much as a I had to. 
Now, interactions can be good. 
But also, depending on people for things can be burdensome. 
So maybe if you have a bunch of Internet of things, 
IoT devices that are helping you, you can depend a little bit less on people, and 
take care of things independently. 
And actually, this is very helpful for people who are infirm, or 
maybe you're older, you're infirm and you don't wanna have to depend on people. 
You wanna be able to live independently. 
IoT devices can help you a lot. 
So for instance, cars that are coming online that drive themselves, right? 
Ultimate IoT device, drives you to where you wanna go. 
That can be really helpful if you're old enough where you can't, 
maybe you lose your license cuz your vision is bad, or something like this. 
Your reaction time is slow. 
If you have a car that can drive itself, drive to wherever you wanna go, 
that's a pretty big advantage, right? 
So not having to depend on a person, to hire a person to do that, 
you can just have your IoT device do that for, could be very helpful to you. 
Also, IoT devices, they got Internet right there in the term, 
they connect into the network, so you can actually connect to people. 
So in some ways, 
it can enhance your interaction with people in a different form. 
So maybe not in person interaction, but 
you can talk to people on the network, right. 
Through any device that you feel like using, right. 
So you can have all sorts of personal interactions, but 
also professional interactions. 
So you can do, we get this a lot at work now. 
Rather than going all the way to a conference and 
spending money to fly out there, stay at a hotel. 
We can have meetings online and I don't have to move anywhere. 
I can just use the camera in front of me. 
I can use my phone, and just do a conference right there, right. 
So its a lot cheaper, and it's not the same as in person interaction, but 
it can save you a lot of money in the long term.

Start transcript at 5 minutes 14 seconds5:14


Thank you. 
[MUSIC]

[MUSIC] 
So in this lecture we'll discuss some of the downsides of Internet of Things 
technology, some of the risks, and especially the privacy and 
security issues that come up when you have IoT devices as pervasive as they are doing 
things and out of your control at some extent.

Start transcript at 28 seconds0:28


So, one advantage that we listed in the last lecture 
was that you don't have to depend on people as much. 
You can depend on your IoT device to do things for you, and 
you don't have to deal with people as much. 
So the downside of that is potential social isolation, right? 
You don't have to leave your house if you don't want to. 
You can be a hermit. 
Stay in your house, never walk out, and have everything come to you. 
Right? 
Now, usually it doesn't go to that extreme, but it can happen. 
It depends on the mindset of the person who's using the device. 
But if you need to interact with people less, 
you have less of an excuse to go out there and deal with people. 
And this picture is showing all these people looking at their cell phones. 
This a constant problem, right? 
People looking at their phones even in quote unquote, social engagements. 
Say you're at a party and people at the party, which is meant for 
human interaction, reading their cellphones and 
looking down at their devices rather than actually interacting. 
So, you can have this increased risk of social isolation because you don't have to 
to interact with people.

Start transcript at 1 minute 31 seconds1:31


Another big problem with IoT is that you're now more dependent on technology, 
and all the infrastructure that comes along with it.

Start transcript at 1 minute 40 seconds1:40


So, if things go down, like for instance my email.

Start transcript at 1 minute 46 seconds1:46


And this is not even really an Internet of Things issue. 
But, email, I use it on a standard computer or my phone too, if I want to. 
But if email goes down, it's a serious impediment to me. 
I need my email on a daily basis, really, an hourly basis. 
I need to get emails from people. 
And so, when that type of thing goes down, it's a problem for work and 
even for personal life, right? 
I communicate with some people personally with some people through email, 
or texting or whatever communication technology you use. 
When you're using it through IoT, through the internet, and through your devices, 
when your device goes down, or 
when the network itself goes down, it's a big problem for you. 
So, power outages in general are a big problem 
because all your devices are going down. 
I mean their charges are gonna die even if they're on battery. 
But if your device goes down. 
So for instance, If my phone, so this happens to my wife all the time. 
She has a phone. 
I won't say the brand. 
She has a popular phone. 
When she gets an update on her phone, 
like she just recently got an update on her phone. 
The thing just hangs up. 
Regularly. Just yesterday, she's talking to me and 
suddenly it hangs up. 
She talks to me again. 
It hangs up for no reason, right. 
Because the update that was supposed to improve her device. 
So now, her being dependent on this device all the time, 
when she gets an update and it goes wrong, 
when there are bugs in the software, it's a much more serious problem. 
And buggy software is always a problem on a desktop, 
say, but when it's something that you use a lot. 
For instance, if it's a life critical thing, 
like we talked about insulin pumps a couple of lectures back. 
If that thing has a bug, that's a serious problem. 
I mean, you can die off of that, right? 
A pacemaker has a bug, there's a serious problem. 
And these things actually happened in medical devices too, 
that you've had these bugs and people have died. 
We won't go into them, I don't have slides on these right now. 
But there are devices that this has happened. 
And the more these IoT devices get integrated into our lives, 
the more dependent we are. 
So when they go wrong, it's a much worse problem for us.

Start transcript at 3 minutes 51 seconds3:51


Privacy and Security. 
So another property of these IoT devices is they are, 
they're recording information. 
They are observing us. 
Now, presumably for our benefit. 
But they are observing us a lot and they are pervasive, so everywhere. 
So for instance, your cell phone. 
That thing is observing your location. 
If you have your location services on, 
which most people have on because a lot of applications depend on those services. 
You have that on, it is reported your GPS, your location at all times, and it can 
easily be sending that data back to Apple or whoever, whoever your manufacture is. 
And that happens all the time. 
This type of data is being tracked by your phone, and 
sent back to some central location. 
Now maybe they're using it for good purposes, to help you. 
Like having your location means that when you're looking for 
a restaurant, you don't have to report your location, it just knows, and 
it can tell you where all the nearby restaurants are. 
So that can be beneficial. 
But it is tracking you all the time. 
Health monitors. 
They're tracking your health information, right, all the time, and 
sending them on a network to some cloud server. 
So there's important information about your health 
that is being transmitted over the network and stored in some remote server.

Start transcript at 5 minutes 3 seconds5:03


TV watching habits, media watching, whatever media you're watching. 
That type of thing is. 
So, say you've got a new TV, it can track, 
in fact it typically records what you watch. 
In fact, my DVR it flags, when I'm looking at the list of TV shows, 
it flags which ones it thinks I'll want to watch. 
Now, how does it figure that out? 
It's tracking my activity, knows what type of shows I've watched in the past, 
finds similar shows and suggest them to me. 
So that's a benefit, right? 
But just understand that it is tracking everything that you're watching 
on your TV or your DVR, things like this. 
Actually, we see this all the time with people must have interacted with this, 
when you buy something online. 
So, one thing I do is I build quad copters with my son. 
We build quad copters, I have a research project on this, remote control, right? 
Whenever I make purchase like a quad coptor purchase, 
suddenly all the ads I see are for quad coptor parts. 
Motors and RC controls and all this, and you must have interacted with this, right? 
It's tracking what you're buying, and then just throwing ads at you. 
It's doing it for marketing purposes, but 
it's throwing ads at you according to things you've bought in the past. 
So, purchasing habits, cellphone or whatever device you're purchasing on. 
Say if your refrigerator's making purchases for you, food purchases for 
you or something like that, 
the fridge itself can track that data and give it to some third party.

Start transcript at 6 minutes 26 seconds6:26


Driving habits. 
So, cars have lots of sensors, about the speed and 
things like that, and if you're hitting the brake, something like that. 
And car incident reporting, the insurance agencies can use that 
when you're trying to get money back for your car. 
So say you crash your car and you say, look, I was hitting the brake and 
they say, well, the car says you weren't hitting the break. 
So, you owe us this much money, right? 
So that type of data is being recorded, sent to insurance agencies, and 
they can use that against you. 
So, data can be used to market to you.

Start transcript at 7 minutes 1 second7:01


I already mentioned this, but the ads that you see on your computer or 
on your phone, those things happen, they pick ads, basically selectively, 
based on what your purchase habits are. 
So, if they know you're interested in buying a particular type of device, 
you'll get ads related to that.

Start transcript at 7 minutes 18 seconds7:18


Health problems. 
So, if they know you're on a certain type of drug, they'll give you ads for 
related drugs for related issues, things like this. 
So, that's probably the most popular use of this data is marketing, right?

Start transcript at 7 minutes 32 seconds7:32


Often you give 
permission to the person you purchase the device from, you give them permission 
to use that data in those long agreements that you click Okay to. 
So when you buy a device, buy a phone, or put an application on your phone and 
it says do you accept the agreement terms? 
And you don't read that, but you click Okay. 
So, in that, you are giving up all ownership of all data often. 
Right? So all this data that's being tracked, 
it can legally be given to some third party agency, 
and then they can sell that data whenever they want to. 
So, it's hard to keep track of your data. 
You don't know who has your data, 
because you agreed at some point to allow them to own that data. 
Oh, insurance agencies. 
So, the car accidents, car insurance. 
They can track the data about your car see how you were driving at the time of 
the accident and use that information. 
It could be used to your advantage. 
They could say oh, you did hit the brakes, so it's not your fault. 
Or they could say look, you didn't hit the brakes so it is your fault. 
So, it can be used either way.

Start transcript at 8 minutes 40 seconds8:40


Also, undiagnosed health problems. 
So this is a little creepy but this can certainly happen. 
So, insurance agencies are basically statisticians. 
They do statistics to determine health insurance. 
How much they are gonna charge you, they do based on the state of your health. 
So, they can predict what the state of your health will be based on 
available data. 
So for instance, say you've got Fitbit, and 
Fitbit is recording data about your health. 
How your heart rate and things like this. 
That data can be used by an insurance agency to 
figure out how much they wanna charge you. 
They can say look, based on your health right now, 
we can predict that in a few years, you might come down with this disease and so 
we're gonna charge you more. 
So, this type of information is very 
useful to different agencies in different ways. 
And you should be aware that while these IoT devices are beneficial to you, 
they are storing data and that data may or may not be in your control. 
Security's another thing. 
Often this data is held in the cloud somewhere. 
So say FitBit, it tracks your data, it sends it to some cloud servers. 
Now, this is medical information and you would like it to remain private. 
And they maybe try to keep it private, but there are hackers. 
There are people who steal data, and you must have heard about this in the news. 
And so, the data can be attacked at the cloud server, and 
it's out of your control. 
So if that data isn't maintained in a secure way. 
So, what we're showing over here is basically 
a rough picture of an encryption algorithm. 
But the idea is that data would need to be encrypted. 
If it's private data, 
health data, you'd like that to be encrypted on the cloud server. 
But you as a user don't have any control, direct control over 
whether encryption is being used, or maybe it's not being used consistently. 
You can't control that directly, right? 
That's up to the cloud server. 
So you are left to trust them to take care of your data, and 
often these agencies are not trustworthy. 
I don't want to name names, but if you've heard about any hacks about 
particular companies having their databases stolen. 
And it's happened many times over the last few months or the last few years, 
that data isn't being held in a secure way and then your private data's stolen. 
So this can happen. 
Thank you. 
[MUSIC]

 Define what an embedded system is in terms of its interface


 Enumerate and describe the components of an embedded system
 Describe the interactions of embedded systems with the physical world
So in the last module, we gave a high-level definition of the Internet of 
Things, give you an idea of What an Internet of Things device is, and 
what impact it has on society. 
Now we'll go into a little bit more technical details about how they're 
implemented, the design and implementation of these Internet of Things devices. 
Now basically, Internet of Things devices are embedded, 
typically embedded in other objects. 
So say, you have a car, and you put some Internet of Things technology inside that 
car, and now it is an Internet of Things device. 
It is computational network and so on. 
It's embedded within another device, some thing.
Start transcript at 53 seconds0:53
So, we're gonna talk a little bit about how you embed something, 
embed that type of functionality inside a regular device. 
So part of the idea is that you want to be able to give enhanced functionality to 
a regular device but not add complexity to the device. 
So for instance, take the camera that we're filming with right in front of me. 
This camera, you could've gotten a camera 40 years ago that you can use to take 
a picture with, snap a button, take a picture. 
A new camera, an Internet of Things camera, is network, 
it's got computers inside, computational technology. 
The same interface, you snap the button and it takes the picture, but 
it does a lot more. 
It has a lot more enhanced features. 
Maybe it does jitters control or something like that, 
so it's embedded within the device, but it's well hidden. 
It's embedded behind a nice, what we'll call natural interface. 
So that the user shouldn't have to bend to conform to the device, right? 
Instead, the device should conform to what the user wants, and 
it's to have an interface that makes it easy for the user to deal with. 
So, in order to do that, the assistance, they have to be embedded within regular 
devices, and they have to interact with the physical 
world through the use of sensors that read information about the physical world, 
maybe somebody pressed a button, a light turned on, something like that. 
Also, a set of actuators that cause something to happen in the physical 
world that basically change the state of the physical world, so maybe motors or 
lights or something. 
So we'll talk about how this physical interaction works and 
how it's controlled inside one of these Internet of Things devices. 
[MUSIC]

[MUSIC] 
So in this lecture we'll talk about embedded systems and 
how they are related to IoT devices. 
There's a lot of overlap. 
Embedded systems, the term, usually refers a lot to, 
not just how the device is used, but also how it's implemented, how it's built, 
so there is a lot of overlap between the two terms. 
And IoT devices are typically embedded systems also, so 
we'll just define that and give you an idea Idea of what embedded systems are. 
It's good to know the term embedded system because it is still commonly used, and 
what we are building are typically embedded systems. 
We will talk about building later on in the class. 
They are actually usually embedded systems.

Start transcript at 47 seconds0:47


So what are embedded systems? 
Embedded systems are computer based systems that don't look like computers. 
That's my simple definition. 
The complexity of a computer is hidden from the user. 
So if you have a computer, desktop laptop something like that. 
If you've ever used it, 
which I know you have, there are complexities to using a computer. 
So say you want to install some new software. 
Right? 
You install software. 
Sometimes it's easy. 
But sometimes there's a conflict, like for instance video games. 
I used to play video games on computers, now I use only game machines, but 
say I play a video game on a computer. 
I put the video game in there and install it, and 
it has some conflict with the video card. 
I need a new video card, right, to play this new video game. 
So, then I need to get new drivers for 
my video card, so there's this whole interaction. 
The functions are not separated. 
This is different than an IOT device. 
An IOT device basically has one function. 
We talked about this last module, right. 
It has one function it's trying to do, like the car. 
It does the car things, right. 
A camera does camera things, but 
a general purpose computer It can do a lot of things, and so there can be conflicts. 
If I install software to play a video game, 
that might interfere with the software to do something else. 
So these relationships add to complexity.

Start transcript at 2 minutes 5 seconds2:05


So it makes it harder to use a standard computer than to use, say an IOT device.

Start transcript at 2 minutes 11 seconds2:11


Now an embedded system, and 
IOT devices are generally embedded, they hide the complexity from the user. 
So the picture we've got here this is like some kind of a scale let's say, 
and say it's an IOT scale, 
so the user doesn't have to see the complexity of what's going on inside. 
The user just knows how to use it, so it has a very simple interface. 
And this is where the term embedded comes from. 
The complexity is embedded inside the device, 
the user doesn't have to deal with the complexity. 
So that's what an embedded system is, how the term came about. 
Now these embedded systems are much more common in desktops and laptops 
because there is computational ability built into a lot of different devices. 
Now one thing to notice about embedded systems isn't necessarily different. 
Not necessarily, but can be different than IOT devices. 
IOT devices are almost always connected to the internet, 
thus the term Internet of Things. 
Embedded systems may or may not be. 
Embedded systems may have computational complexity in there, but 
no network connection at all. 
And so there are a lot of uses for devices like that. 
Things are moving from embedded to IOT because because of the trends we talked 
about in the last module, the fact that internet connectivity is so ubiquitous and 
it's pretty cheap to obtain. 
So a lot of these devices that used to be just embedded, 
are now becoming networked and so you'd call them IOT.

Start transcript at 3 minutes 29 seconds3:29


So what are embedded systems? 
They're basically everything that interacts, 
all the internet of things devices that we've talked about. 
But plus or minus the internet part. 
So take a digital camera, that's what we have here. 
Digital camera, a basic digital camera might not be networked, right? 
It might just be an embedded system where you click, press a button, 
you take a picture. 
And the picture is stored locally, but it might not be immediately networked, right? 
So that would, you would call that type of thing an embedded system. 
Because the complexity is embedded within the device. 
So, a camera, an old camera, you know? 
A mechanical camera, has the same interface. 
You press a button, it takes a picture, right? 
New digital camera, same interface, press a button, takes a picture, 
but there's a lot more complexity to what's going on inside. 
So, that's the term embedded, right? 
The complexity is embedded inside the device, and 
the user doesn't have to see it. 
The user can benefit from the complexity, but using a very simple interface.

Start transcript at 4 minutes 30 seconds4:30


Now sometimes embedded systems don't interact directly with the user, but 
they interact with the user through another device. 
So what do I mean by this? 
Let's take this, take this memory, this thumb drive right. 
Now a thumb drive, you've seen this type of thumb drive, it stores data. 
This type of thing does not interact directly with the user, right. 
A human doesn't have, doesn't connect this up to their body or something, right, yet. 
Right now they connect it to their computer or something like that or 
their phone or whatever it is. 
And then they interact with it, 
they can access the files on it through another device. 
So you would also call this an embedded system, 
even though it's not directly interacting with the human.

Start transcript at 5 minutes 8 seconds5:08


And you see this in other devices like a car. 
The anti-lock braking system inside a car. 
That's interacting with a human but not directly, right? 
The human presses the brake pedal, and the brake pedal talks to the anti-lock braking 
system, so the human interacts with the car, and the car talks to it's sub-system. 
One big property of embedded systems and 
a difference in embedded system design is that efficiency is really important. 
So what that generally means is, 
that It's not enough to get the design to work, to do its task. 
It has to do its task in an elegant, let's say an elegant way, okay? 
Either it has to do it fast, or it has to do it with low power, or 
it has to do it at low price, right? 
So it's not enough just to get it to work. 
And this is actually a big difference between embedded system design and, say, 
traditional software design. 
So So, I teach programming too. 
When we teach programming, generally, we just teach how you get something to work. 
Here, your goal is to get this code to do what it's supposed to do. 
Whatever I wanna do, sort this list of items, or something like that, all right? 
But, I'm not usually saying in that class, it has to sort this list of items, and 
it has to use the minimum amount of memory possible. 
I'm not saying it has to sort these items, and it has to do it within one second. 
Right? I don't put these constraints on it. 
I just say get it to work. 
But with embedded system design, you care a lot about the efficiency. 
You can't just get it to work. 
It's got to do it in an efficient manner. 
So what that means, is that, so that the reason for these constraints is that, 
you know, most of these devices are used in cost critical markets. 
Or in life critical, right? 
So if it's using medical or military, people's lives depend on these devices. 
And if using cost-critical device that compute consumer electronics, 
the cost is important. 
But, either way there's some constraints that are important to you. 
Besides just getting the thing to work, 
it's gotta work within a tight set of constraints. 
So, for instance, say it's a consumer device like a phone. 
So manufacturing costs, and design costs, 
and time-to-market, those things are primary. 
Because you want it to be cheap, right? 
You want to make money off the device, so the cost has to be low. 
Also, time-to-market, because you have competitors. 
And this competitor's coming out with a new phone on this date, so you have to 
come out on the same date with a phone that's better than them, let's say. 
So those things are primary.
Start transcript at 7 minutes 22 seconds7:22
But on the other hand, if you're, this is the military. 
This is going into a tank or weapon system, and people's lives depend on it, 
and it's life-critical. 
Then, you care about performance and power more. 
So if you're in the military, you might say, look, we'll pay millions of dollars 
for this device as long as it works and it can effectively do what we need it to do. 
So cost becomes less important. 
But power and performance really matter. 
And same thing with medical, right? 
You might be a lot more willing to pay a lot of money for a device. 
But it better work and it better, you know, 
maintain your heart the way that it's supposed to. 
Like a pace maker. 
That thing better be, have high reliability and it better, you know, 
rate your, control the pace of your heart properly. 
So if that means costing more money then so be it. 
So in these imbedded devices, 
there's always this tight set of constraints that you're working under. 
So it's not enough to get it to work, 
you gotta get it to work within the set of constraints that you're given.

Start transcript at 8 minutes 16 seconds8:16


So this is very different than traditional software engineering, 
where you just wanna get it to work and get it to work some how. 
And the assumption there is that Moore's Law will save you eventually so 
by Moore's Law, you may have heard of this before but Moore's law just says let's 
say that approximately says that machines get faster and 
more computationally efficient every year, right? 
They get more dense and faster. 
Which by the way, Moore's law is slowing down but still, this happens. 
Machines improve. 
So, software engineering often you'll just either say, look, just get it to work and 
if it's slow it's okay, because process or performance is improving every year. 
And so in the future it won't matter. 
Right. 
So that was the background assumption to a lot of software engineering. 
But a better systems, you can't think like that. 
You have to think loo,k not only does it work. 
It's gotta be working fast. 
It's gotta be working low power and all this.

Start transcript at 9 minutes 6 seconds9:06


Thank you. 
[MUSIC]

[MUSIC] 
This lecture will talk about embedded systems a little bit more. 
We'll talk in more detail about how they're designed, 
since that is the point of this course. 
We're gonna be building IoT devices, which are embedded systems. 
So we're gonna talk about differences and how you would design an embedded 
system as compared to a regular computational platform. 
And some of this we talked about in the last module, but 
we're gonna talk about how these differences impact the design process.
Start displaying text in 35 seconds0:35
Okay, so application specificity.

Start displaying text in 38 seconds0:38


Embedded devices are generally application specific. 
Unlike desktop, laptop computers which can run any type of program or 
pretty good doing any type of program. 
Embedded systems are made to do one thing or one related set of things. 
And we already talked about this with IoT devices. 
So, the phone sort of blurs that line a little bit, all right, 
cuz a phone can do a heck of a lot. 
You can run arbitrary apps on a phone, but most devices like the camera 
in front of me, that thing is made to do camera, right? 
To record, play back, something like that. 
And it does all things related to camera activities. 
So, that's common. 
That's typically how embedded systems are. 
And the reason why this is important is because it changes the way you 
design a device. 
When you know that the device is gonna do one thing, you design it for 
the one thing, you don't design it for everything.

Start displaying text in 1 minute 30 seconds1:30


So the design is focused on the one application, 
unlike general purpose systems like a laptop, desk top. 
So those things essentially end up being overpowered for whatever you have to do 
because they have to be ready to handle any type of computational task. 
So for instance take a standard machine, say a quad-core, 
four processors they have, quad-core's not uncommon. 
So say you get a quad-core i7, something like this, it's running at 4 GHz, right? 
Generally, there is no way that regular users are using up all the computational 
potential of that machine. 
There is no reason why you need four processors to run Word or 
PowerPoint, or whatever application you're running. 
You don't need 4 GHz to run these applications. 
So 99.9% of the time, these laptops and desktops are well under utilized. 
[LAUGH] Only 1% of the CPU, 
some tiny fractions of the CPU is actually being used. 
But then every once in a while, you actually need them to do something. 
So say, most of the time, like say, cameraman right here, okay. 
He's using a, he's got a Mac. 
I bet you he uses Photoshop or other kind of tools to do video processing, right. 
Now, when he does that, then it's using all the processing power, 
right, cuz these video operations chain up effects on screen images. 
Those require a lot of computational complexity. 
But, 99.9% of the time, when this thing is just running PowerPoint, 
something like that, that's not using anything. 
But every once in a while, it's running an application that really uses it. 
So in some sense, general-purpose processors, 
most of the time, they are wasted. 
There's no reason to have all that power except in very rare cases. 
Maybe I'm playing a video game. 
Video games are another case where you really use a computational power, 
because they're doing video operations all the time. 
Graphics, complicated graphics. 
So when I'm playing In my video game, 
okay, I need the processing power, but most of the time I don't need it. 
So in some sense, general purpose machines are very inefficient in that way, and 
because of that they cost more than they need to, to do any individual task. 
So what I mean by that is say you want to play video games, 
and you want to play the newest, best video games. 
You can buy a computer, a good computer with a great graphics card and 
all this, and that might cost you $ 1,500, right? 
To get the newest, most up-to-date video card, in the best computer, 
to run the best games, and run them fast. 
Or you could say, look, let me just buy an XBox One, or PlayStation 4, 
which is a lot cheaper, say $ 500. 
But it runs that game better, probably better than the best, 
than that more expensive computer, right? 
Now, all it does is games, but it does games great. 
Right? It does games the best.
So, in this way, the design is much more efficient. 
It's being used to its full potential because all you ever do with 
the XBox 1 is play games with that thing. 
And most of the time, they're video. 
So you're using the capacity of that thing, basically all the time you're using 
it, you're using it to, if not full, but at high capacity. 
As opposed to a general purpose machine. 
So, this application specifically lets you change the way you do design, so 
that you can just put in the things that you need to put in. 
Spend money on what you need to put in. 
So, higher design efficiency is possible. 
So what that means is that, if I know that I'm playing video games, 
there are certain pieces of hardware that I don't need in my design, right? 
Why buy that, right? 
If I know that, take this camera, right, this camera in front of me, 
I know that this thing is doing some types of video processing. 
I know it needs to control a lens and stuff like this, right? 
But, it's never gonna have to do other types of processing. 
I'm not gonna be doing sorts, or something, right? 
So I can change the way I do design to just include the software and 
the hardware that I need for the task that it's made for. 
And so that makes it cheaper. 
Now it makes it more limited. 
It can only do what it's made to do, but what it does, 
it does cheaply and efficiently.

Start displaying text in 5 minutes 25 seconds5:25


Another big difference in the way you design embedded systems as compared to 
sort of a regular desktop laptop, is that hardware and 
software are usually designed together. 
So again, this is for efficiency reasons. 
But if, say you want to buy Microsoft Word or something, 
some typical desktop software. 
That Microsoft Word, 
you buy that completely separate from when you buy your computer. 
Well, actually maybe you buy your computer and it comes with Word but, 
you can buy your computer and then you can buy Word completely separately, okay? 
And there are two different companies. 
Maybe I bought my computer from Dell and I bought Word from Microsoft. 
Two different companies. 
One does the hardware, one does the software. 
Now, more and more, these companies are coming together. 
And sort of Apple is the epitome of this, right? 
They make their devices' hardware and software together. 
They make the phone and the software or 
whatever the device is in the software, as one.
Start displaying text in 6 minutes 13 seconds6:13
Which means that they work together better, okay? 
And in fact 
the Apple machines traditionally are very reliable because of that. 
But it also makes them more efficient. 
So you can say, look, since this is just a phone, 
I don't need to be able to drive servos or something, right? 
I can make my hardware just the right hardware to run exactly the software that 
I need, right? 
You can match them. 
Your whole design process gets more efficient. 
And we are gonna see this later on in the class when we actually build these things. 
We are only gonna buy the components we need to build the system we want. 
We're not gonna say, every system. 
I'm gonna put all this hardware and software together. 
No, we're gonna buy, we say we need this component. 
We need an LED. 
We need this, we need that. 
We hook them up and we make this one system that we want, and 
write code that uses only that. 
As opposed to a general purpose system where you have to have hardware for 
everything and 
software for everything just for the one occasion where you actually need it. 
So you're designing the hardware and software together, and 
that makes design a lot harder. 
Because you have to not only be a hardware designer but 
you also have to be a software designer. 
So when you're writing the software, 
you have to think about what the hardware can do. 
See, normally when you take an application like Word, 
that thing runs on many different hardware platforms. 
You generally as a programmer do not have to be aware of this hardware platform 
that it's running on. 
You just say look, as long it's running on Windows, I don't care, right? 
Actually, it doesn't even have to run on Windows. 
It can run on many applications, and you don't care about that as a programmer. 
But if you're writing code for an embedded device, like a cell phone, 
you have to know exactly what the hardware can do. 
You have to know, I have a screen. 
It has this size, right? 
So I'm limited in how I write my software to use up that area, right? 
I have touch senses, which can sense this and that, right? 
So I gotta place my buttons so that everything can be touched. 
So you have to really be aware of the hardware when you're designing 
the software and vice versa, which changes the design process and makes it frankly, 
more difficult. 
Yeah, so more work for designers because you have to understand some of both. 
Thank you. 
[MUSIC]

[MUSIC] 
This lecture we'll talk about the structure of an embedded system. 
The hardware structure specifically, look at the different components. 
A very generic view and we'll talk about some of them. 
The main component, the microcontroller we'll talk more about in the next lecture.
Start transcript at 25 seconds0:25
So, here's my high level generic view of what an embedded system looks like. 
So if you look at an embedded system, it's got to take data from the outside world 
and then it's gotta output data to the outside world. 
So it has, first for the receiving data from the outside world, 
it has a set of sensors. 
So these sensors they receive information from the outside 
in many different ways because there are lots of different types of sensors. 
The most basic type of sensor would be a button, push button, something like that. 
And that's receiving data that somebody types in. 
You know, zero, one is binary. 
Then there's also, for instance, you could receive sound information like 
the microphone in front of me, or actually connected to here. 
And that receives audio information. 
There's also video, like the camera in front of me, 
or just a regular light sensor that receives video information. 
There's all kinds of sensors. 
Touch screens, right? 
You can receive touch information through a touch screen. 
So, there's a lot off different sensors that an embedded system 
can receive input from. 
So that input comes in to a set of sensors and it's gonna go into the core of 
the system and in the end, once the system has decided, process that information, 
decide what to do with that information, it needs to cause some results. 
An effect to happen in the outside world. 
So that's done through the actuators at the other side, the actuators, 
they cause events to happen in the world. 
So those might be something like an LED, 
a light, like there's a light flashing in front of me. 
That LED is an output actuator. 
And it goes off and on to indicate probably that it's recording, okay? 
But there are other actuators too, like for instance, the camera in front of me. 
It's got motors inside that control the lens to control the focus. 
So those motors, those are actuators. 
Those are outputs of the system. 
So the system will drive those motors and 
those will be considered actuators and make them.

Start transcript at 2 minutes 15 seconds2:15


Pull the lens in and out and things like this. 
So, lots of different types of actuators. 
Speakers are actuators, they output sound. 
Lights are actuators, they output light. 
The screen is an actuator, it also outputs light but in a more interesting, 
I don't know if you call it interesting, but in a more detailed format. 
More complex format a light, so a screen is an output. 
So there are lots of different actuators. 
So if you look at the embedded system, it's in between there, right? 
It receives data from the sensors, it does something with the data, and 
then it outputs to the actuators to make something happen in the real world 
as a result of the data that it received. 
So the interface components of the sensors and the actuators. 
Now in the middle of the system, 
the center of the whole thing is that microcontroller in the center. 
Now, the microcontroller we will talk about in the next lecture in more detail, 
and actually a lot of this class is specializational focus on microcontrollers 
and how to program them, but there are other components that are commonly inside 
the core of an embedded system as well, and you see two of them right there. 
IP and FPGA, we'll talk about those in a little bit right now.
Start transcript at 3 minutes 21 seconds3:21
So, IP stands for intellectual property, or IP Core people call them, and 
intellectual property core is basically a predesigned component, 
typically a premanufactured component so an integrated circuit, 
a chip that performs one function. 
When I say one function, maybe a set of functions, but 
all related to one particular task.

Start transcript at 3 minutes 43 seconds3:43


So it's a chip that is not general purpose programmable. 
It's a core that just performs some small set of functions that are all related.

Start transcript at 3 minutes 51 seconds3:51


So these things can be very useful. 
They're cheap in high volume. 
So what that means is, high volume means manufacturing volume. 
So if you have some very common task that's performed by a lot of systems, 
like say you got a cellphone, right? 
And then that cell phone, let's say, 
it's very common to perform some type of audio filtering task, okay? 
So all of our cell phones have to do this audio filtering, right, let's say. 
So you might make one of these IP cores, which performs filtering, 
and then it would be high volume, because there are many millions 
of cell phones that are for sale, and so you manufacture many of them. 
So there's a lot of work to designing one of them and 
it costs a lot if you want to just fabricate one. 
But when you're fabricating a high volume, it's very cheap. 
So these IP cores can be very valuable when you have high volume production.

Start transcript at 4 minutes 38 seconds4:38


So they're useful for common tasks, that's the best thing. 
In order to make sure you get high volume. 
You basically wanna have, you wanna use them for very common tasks. 
Tasks that happen over and over because there's a lot of need. 
So if it's just a one-off if this is a design, some kind of function that's only 
done in this one system, then you would almost certainly not make an IP core and 
make a special purpose chip just for that. 
You wouldn't do that, but if it's some common task that's done a lot. 
So, for instance, network controllers, right? 
That's in a lot of systems. 
Basically every Internet linked device has some sort of network controller in it. 
So that type of thing you might implement as an IP core, 
a dedicated piece of hardware which just does IP control operations. 
Audio, video codecs right, so I'm coding audio and video, and 
compressing it, decompressing it. 
These are operations that perform by lots and lots of IOT devices, so 
this type of device, this type of function you might put into an IP core. 
Now these IP cores, we're not designing them in this class, 
that's outside of the scope of the class, but when you're making an IOT System, 
you definitely might want to buy one of these. 
So you'll look at a library, an online library, of IP cores, find some vendor, 
Texas Instruments, say, they sell a lot of chips that do different things, and 
you find the one that does exactly what you want. 
You say, well I'm doing MPEG encoding let me find the TIM peg encoding chip, and 
you find, you'll probably find 50 of them, and you pick the one that you want, 
and that's the core that you use. 
So that's how we use these things. 
We're buying them off the shelf, we're not actually gonna be designing IP cores, 
because that's too complex.
Start transcript at 6 minutes 9 seconds6:09
And they have to interact with a microcontroller. 
So remember that the microcontroller is the center of all the action right? 
So, it's connected to the IP cores and 
it tells them when to do what they need to do. 
Right, so if an IP core is for encoding video, 
the microcontroller will say encode now, right, encode this data now. 
And when I say it will say that, it means, I mean through the signals, so the wires 
It will send the appropriate sequence of input signals to trigger it to record. 
And then the results may be the core sets a signal high when it's completed. 
And that goes back to the microcontroller. 
The microcontroller knows okay the coding is done, let me move on right. 
So there's this conversation between the micro controller and 
the IP core that goes on. 
And so you have to wire it appropriately and we'll only touch on that.

Start transcript at 6 minutes 58 seconds6:58


Now another component that you often find in IOT devices, 
embedded devices in general, are Field Programmable Gate Arrays. 
Now, we will not be using Field Programmable Gate Arrays in this class 
because their complexity is basically outside of the scope of the class, 
but what they are, they're an interesting thing and you should know what they are. 
They're hardware. 
They're integrated circuits, they're chips. 
Not programmable chips, they're regular chips. 
Not programmable in the conventional sense, okay? 
These things can be reconfigured, 
essentially rewired to perform different tasks. 
So, let's say you need something to do audio filtering. 
So, you might configure the FPGA to perform filtering. 
So it's a hardware device that will perform filtering because it's been wired 
to do that. 
But then you can rewire it, reconfigure the device, to rewire it so 
that it performs mpeg coding instead or something like that. 
So you can rewire this thing, reconfigure it, so 
that it can perform different tasks. 
Now it's not programmable in the sense of a general purpose processor, 
you don't write code for it.

Start transcript at 8 minutes 2 seconds8:02


And as a result it's actually a lot faster than a general purpose processor right. 
You can get that same flexibility with a general purpose processor. 
You could run one program, or 
another program, you could do that with a processor but 
you would do it with the FPGA if possible because it's a lot faster. 
It will execute a lot faster. 
Because the software conversion step we won't talk here that is skipped 
if you directly in hardware using FPGA so FPGAs have that advantage. 
And no fabrication is needed. 
So when you make an IP core and you fabricate it as a chip. 
You have to fabricate it. 
You have to manufacture chips and that's expensive. 
So it only makes sense in high volume with FPGAs you don't have to fabricate you just 
reconfigure it through programming, just connect it by USB to a computer and 
you can rewire the thing. 
So that's much more convenient and cheaper, so if you have a one off 
design you would implement in an FPGA over some kind of an IP core. 
Thank you. 
>> [MUSIC]
[MUSIC] 
This lecture we'll talk about components in embedded systems, 
the hardware components. 
Specifically we're gonna talk about microcontrollers. 
We'll start talking about microcontrollers. 
We'll go on in the next lecture about that, too. 
The microcontroller is the center of the action, so we're good to start there. 
That's where we'll be mostly focusing this class really working with 
the microcontroller. 
So here's a picture of a board, an Arduino. 
There's different versions of Arduino boards. 
You have one or you may have one. 
This one, this particular board, 
you can see there's a big chip in there, that black chip over there. 
And, like the bottom part of the board and 
that's actually the microcontroller itself. 
And there are other devices on this board, but the microcontroller is that main chip 
in there that's going to be executing the programs that we're gonna write. 
So then note that the board, the Arduino board, 
we'll go into great detail about the arduino board in the next course. 
But the Arduino board has a lot of other stuff on the board to support 
the microcontroller, but 
the microcontroller is that particular chip right there. 
So a microcontroller is an integrated circuit that executes a program. 
So this picture of a microcontroller looks a little bit different than 
what we saw before. 
That's actually the bare silicon. 
So we're not gonna go into depth about how these things are made. 
But these chips, they're made out of silicon, the semiconductor. 
Mostly silicon, ours are silicon. 
And so there's a wafer, a small chip. 
That's actually what the tip of a chip looks like. 
But that's not what you use, it's not in a usable form yet. 
Before you can actually connect that to anything, you have to actually wire it up. 
You have to package it, what's called packaging. 
But that is a microcontroller, and it will be packaged and 
then it's gonna be integrated in the middle of the system. 
So, the microcontroller, its job is to execute code and 
it's the center of the system. 
So, it reads inputs from other components and it controls other components.

Start transcript at 2 minutes 6 seconds2:06


Microcontroller versus microprocessor, so that's, it's a terminology difference. 
Basically, the way I think about it, I don't know what the formal definition, 
but I know how it's commonly thought of. 
Microcontroller is basically smaller and weaker than the microprocessor. 
So when you say microprocessor, you're thinking about what you'd find in 
a desktop, laptop, Intel whatever, AMD whatever. 
A big general purpose processor, general purpose digital signal processor. 
That's called a microprocessor. 
Basically, they're more heavy-duty. 
They can do, they're very fast, have a lot of memory, and all this. 
A microcontroller is more slimmed down, OK? 
More like what you would find in an embedded system or in an IOT device. 
Because remember, these devices, they have to be designed efficiently, right? 
We don't want overkill. 
We don't want to over design the system. 
We don't wanna buy the highest end processor, quad core, 4 GHz, 
whatever the highest end is at the time. 
We don't wanna buy that if we don't need it, right? 
For the task that we're performing, maybe we're interacting with users, and 
these users are only so fast. 
So maybe you don't need a fast processor. 
So you want the cheapest processor that will do the job. 
So you will go for a microcontroller, which is slower and 
cheaper than whatever the high end microprocessor is. 
So a microcontroller, generally, think of it as a lower end microprocessor. 
Roughly, that's what it is. 
So it's slower, typical, 
by the way these speed numbers are completely, they change over time. 
But a common ratio, so a microcontroller might be 16 MHz, that's a slow one. 
You can go slower than that, 8 MHz, something like that, 4. 
All the way up to, well I have 500 megahertz. 
500 megahertz is sort of a high end, actually though if you look at say, 
Raspberry Pi, that's going 1 GHz I think, so it's twice that. 
So this whole, it's a shifting scale, this range. 
But generally microcontrollers are going to slower than microprocessors and 
going to have less memory, less of everything roughly. 
Yeah, lets make, fewer features, so there are lots of other features and 
we'll talk more detail about these in the next course. 
Specifically we'll talk about Arduinos and Raspberry Pis and. 
The processors, the mircocontrollers, that are on those devices. 
We'll talk in detail about what features they have, but 
they are less than the features that you find in your standard microprocessor for 
a desktop or laptop.

Start transcript at 4 minutes 31 seconds4:31


So this picture, 
this shows a microprocessor after the silicone has been packaged so 
that you see it is a black rectangle, a black square in this case, right? 
That black is all packaging, and 
that packaging is basically to keep the chip safe. 
Also, it cools it, so 
it helps propagate heat out because these things get very hot. 
Also, you'll notice around the perimeter of the chip, of the circuit. 
There are these pins, they're called pins. 
These little pieces of metal, essentially,

Start transcript at 5 minutes 1 second5:01


that are used to wire it to the rest of the components in the system. 
So if you look at that picture, 
it's a printed circuit board, a little piece of one. 
Actually this is the back side of one, so we can't see all the parts on it. 
But there are lots of other parts that this microcontroller or 
microprocessor is wired to through the printed circuit board. 
We're not gonna actually build printed circuit boards in this class because 
that costs money we're not gonna spend. 
We're gonna do this type of thing, this wiring, manually. 
But in a printed circuit board, there are what are called traces, 
little pieces of metal that are drawn onto the printed circuit board connecting 
different components. 
So the microcontroller is at the heart of the system, it's connected to lots of 
different components that are in the embedded system in the IoT device. 
And it takes inputs from them, and it sends control data out to them.
Start transcript at 5 minutes 49 seconds5:49
Now, microcontroller needs to be programmed, it needs to run code. 
And that's what it does, it executes code. 
So you need to write the program in some language. 
Now there are many languages that you can write programs in. 
We will be using, when it comes to Arduino we'll eventually be using C/C++. 
And then when it comes to Raspberry Pi we'll be using Python. 
But you can use different languages. 
But at some point, you have to write a program in a language. 
And then that program has to be compiled or interpreted, and 
we'll talk about that in another lecture. 
And the result though, 
has to get transmitted on to the memory of that microcontroller. 
So it has to be placed in the memory of the microcontroller. 
So inside that microcontroller, there is always some flash memory. 
Flash memory is just a non-volatile memory, 
a memory that stays after you power off. 
So there's some memory and that memory has to hold the program so 
that when it gets power, it starts executing the program from the start.

Start transcript at 6 minutes 44 seconds6:44


And we'll be doing that in the course of this course and the next course and 
all the rest of the courses.

Start transcript at 6 minutes 53 seconds6:53


So, the microcontroller has to be programmed.

Start transcript at 6 minutes 56 seconds6:56


So this term programming, in terms of a microcontroller, means we write the code. 
So first you'll write your program on some host platform, a laptop, desktop. 
Which is not the program that you're gonna execute, 
not the chip that you're gonna execute it on, not that microcontroller. 
You typically write the program on a different host processor 
like your laptop, desktop. 
So you write the program there, then you process the program, compile or 
interpret the program, or compile it and interpretation will happen later. 
But you compile the program then that final version of the compiled program has 
to get transferred to the microcontroller. 
Usually it's done through a piece of hardware, an external piece of hardware. 
So, here we see in the middle, there's a little board. 
That board is connected by USB to the laptop, and 
the microcontroller chip on the side of the diagram, 
that is plugged into the board, to this slot that fits the microcontroller. 
You plug it into the board, then on the laptop you would type, hit program, 
there's a button that hits program. 
You program it and it'll write the data into the memory of that microcontroller. 
So that's one way to do it. 
Now that is not exactly how we're gonna do it because we're using Arduino and 
Raspberry Pi. 
We'll show that later. 
Basically, the way an Arduino and Raspberry Pi work, 
is that a lot of this programming hardware that you see in there, 
that is built into the Arduino board and to the Raspberry Pi board. 
So, we don't need a separate device to program the microcontroller. 
That logic is basically built right into the board. 
So we just take our Arduino or Raspberry Pi and 
plug it into USB into the laptop/desktop. 
And we can program it directly. 
Thank you. 
[MUSIC]

[MUSIC] 
So in this lecture we'll talk about basic components that you see in embedded 
systems commonly, different versions of what you will eventually use in the class.

Start transcript at 20 seconds0:20


So development board is very common. 
On the development board, see circled in red is a microprocessor, microcontroller, 
actually, in that case. 
It looks like a freescale. 
And this is a board from my office, actually. 
This freescale board has a freescale processor on there and 
you can program it from a host. 
So you go to a host, like that laptop that is pictured there. 
You type in the code, you compile the code, and you connect the host 
to the development board and transfer the data to the microcontroller. 
You should do your programming on a host not always, like with a raspberry pie, 
as you'll see. 
You can actually do the development on the rest of your Pi itself, if you want to. 
But it's most common if you do it on a host, 
because a host is generally in a more powerful platform, 
and easier to program all.

Start transcript at 1 minute 1 second1:01


So as far as processes go and microcontrollers as well, 
but right now just talking about general purpose processors. 
You can classify them in two broad categories, general purpose and 
digital signal processing. 
So general purpose processors, 
those are what you see in your standard desktop, laptop. 
They're used for any application and they include many features. 
But they are overkill for most features. 
They have many features that you probably don't even need. 
But they can handle anything, so any particular task they can do it. 
They can do it adequately.

Start transcript at 1 minute 38 seconds1:38


But they tend to be more expensive because they're overdesigned, right? 
They're overengineered, and they have many features that 
maybe you don't need a lot of them, but they have it just in case. 
So that's a general purpose processor. 
There are also digital signal processors which 
Specific to doing digital signal processing applications. 
So digital signal processing is basically processing data streams. 
So audio streams, video streams. 
These are common, these are very common. 
Maybe you wanna as audio is coming in you wanna filter that audio or 
you wanna compress that audio. 
So same thing with video, same thing. 
You might wanna filter it or do some special effect or compress it or 
something like that. 
So these are big streams of temporal data over time and 
you wanna do some processing on it. 
Digital signal processes are actually good processes to do that with and 
they're made for that with that in mind. 
They have special instructions for that, 
they have what are called vector instructions. 
So vector instructions are instructions that do the same thing 
to lots of different data. 
So for instance, say you got add right? 
With add, you might take two numbers and add them together and get a result. 
A vector add might take 32 numbers, 
add them to another 32 numbers, and get a 32 number result. 
So we just did the same thing for many pairs of data, many sets of data. 
And this is very common in signal processing. 
So imagine you're processing video, right, you got some image with a million pixels, 
which isn't even a lot. 
And you wanna perform some blur or 
some operation to the pixels, whatever operation you performed to one pixel, 
you wanna do that to all one million, the same thing. 
So vector operations are very useful for things like that. 
You can just do things in parallel very quickly.

Start transcript at 3 minutes 18 seconds3:18


So, sensors. 
Sensors are extremely common, you need some form of sensors. 
And sensors just receive information from the environment, 
there are lots of different kinds of sensors. 
Let's generally say you can have simple sensors that receive, 
say, heat information, like thermistor. 
That receives temperature information. 
Photoresistor, it reports light intensity, right? 
So these are generally simple sensors. 
I'll call them simple sensors because their inputs and 
outputs are just real numbers. 
Zero volts to five volts, right? 
So it's bright or not bright, something like that. 
But complex sensors can actually receive information and 
receive more complicated data. 
So for instance take a camera. 
CMOS camera, like in a digital camera. 
So it captures images. 
Now that's a light sensor, it's technically a light sensor. 
It's a special purpose light sensor. 
It doesn't just tell you the intensity of light like a photoresistor might. 
It also tells you what color the light is at every point in the image. 
So it's much more complicated visual data that this thing is reporting. 
So it can't just give you one number, zero to five yes, this is bright. 
No, it's not. 
It has to give you, say it's a megapixel, 
a million pixels of image data, to represent what it's capturing. 
So this is a sensor, it's still receiving data from the outside world. 
But it's a much more complicated sensor, so there's a lot more data to receive and 
it's more complicated to work with generally.

Start transcript at 4 minutes 45 seconds4:45


Now, we can still work with them, but 
you generally have to know a little bit more about the circuitry in 
order to do that, or use library functions, which we will talk about later.

Start transcript at 4 minutes 54 seconds4:54


Now, also an ethernet controller, you can see that as a sensor.
Start transcript at 4 minutes 57 seconds4:57
You know, whether that's a sensor or not is a question, 
is a sort of a judgement call, but an ethernet controller will allow you to 
receive information on the ether, from the ethernet, from the network. 
So that information, you can call that sensing, 
not necessarily from the physical world, but sensing from the network. 
And the type of information they receive over the network can be very complicated. 
So that's a more complicated form of a sensor, more complicated to use.

Start transcript at 5 minutes 23 seconds5:23


Actuators, they cause events to occur in the environment, there's some simple ones. 
LEDs, light emitting diodes, they turn lights off and on. 
LCDs, liquid crystal displays, that's like what's on my digital watch, 
you've seen these. 
They're not back lit, so they're not as bright. 
They're low power, but they're useful. 
Those, you can put numbers on them, something like that, so 
it's a relatively simple display.

Start transcript at 5 minutes 48 seconds5:48


You can also have more complicated actuators, like a servo motor, so 
they're motors, DC motors, servo motors are a little bit more complicated. 
You can control the angle, the precise angle to which the motor turns, 
which is useful in a lot of cases, like say a robot arm or something like that. 
Ethernet controller, it can also be thought of as an actuator, 
because it can output data to the environment. 
If I consider the network itself to be the environment then an Ethernet controller 
allows you to output some message data to the network and 
send it out to wherever you're going to send it to. 
But these are more complicated sensors, or actuators, I'm sorry. 
Thank you. 
[MUSIC]

[MUSIC] 
In class we've been talking about embedded systems. 
And I'd like to give you a small example of one in the flesh, so to speak. 
This one, it's got a sensor, an actuator and a microcontroller in between. 
It's got all the basics that we've spoken about. 
So if we look in front of you, we've got a bread board, right here. 
And on this bread board, we've got our sensor, this little blue knob right here. 
This blue knob is a potentiometer. 
What it does is it senses rotation. 
So it's a knob, I can turn the knob, and 
it will report back to me the amount of rotation. 
It does that in terms of resistance, so it's really a changing resistor, or 
a variable resistor. 
You turn the knob and the resistance changes.

Start transcript at 54 seconds0:54


So that is connected to a microcontroller, 
this microcontroller right here on the Arduino. 
This is the Arduino.

Start transcript at 1 minute 2 seconds1:02


The Arduino reads the information about the rotation, and based on that, 
it sends signals to the actuator. 
The actuator is over here. 
This actuator is a servo motor, 
it's a motor that you can control the angle to which it's rotating. 
You can see it has a little arm on there, and 
we're going to control that angle based on the rotation of this potentiometer. 
So the idea is, you turn the potentiometer, and the servo will rotate, 
and it'll rotate according to the amount that you turned the potentiometer. 
So, just to show you the wiring before I show what it does, you got 
the potentiometer wired to, actually, let's start with the power and ground. 
Everything is wired to power and ground, so we've got power and 
ground which are the red and the black coming out of the Arduino. 
Those are wired into the servo motor and into the little bread board. 
So it's wired to these two columns of bread board, so 
it's also wired to potentiometer. 
So the potentiometer, its signal is the signal that reports how much rotation has 
occurred, that's this yellow wire right here that goes into the Arduino. 
And then there's a green wire from the Arduino into the servo which controls 
the angle to which the servo is turned. 
So let's go ahead and turn this.

Start transcript at 2 minutes 14 seconds2:14


Hold it down, there it is, now it's working just like I wanted. 
I turn the potentiometer and the servo turns. 
So this is just a simple example of an embedded system with a sensor, 
an actuator, and a microcontroller in between that controls the actuator and 
reads data from the sensor. 
[MUSIC]

[MUSIC] 
So we're going to talk about analog versus digital. 
If you remember several lectures ago we talked about embedded systems, 
IT devices, and their interface. 
And so at the input they have a set of sensors that receive 
data about the outside world. 
Though the sensors could be simple things like buttons or something like that but 
it could be a microphone, a light sensor, a camera, something like that. 
But it senses data about the outside world. 
And then actuators on the other end, output data to the outside world. 
So maybe they're lights, LEDs or speakers, or just a screen or something like that. 
Okay, but they send data to the outside world. 
So there's this interface, sensors at the input side, actuators at the output side.

Start transcript at 54 seconds0:54


And so these devices, they're sensing physical phenomenon okay, so 
if you look at the sensors, the sensors are sensing physical phenomenon and 
physical phenomenon are often analog signals. 
Okay, now let me describe this difference between analog and 
digital just very briefly.

Start transcript at 1 minute 12 seconds1:12


Analog, actually a very quick way to say it is, analog 
to digital is the same as the difference between real numbers and integers. 
Okay, if you remember that, right. 
Real numbers are continuous. 
So if you get the number, real numbers between 0 and 1, 
there's an infinite number of real numbers between 0 and 1. 
0.5, 0.6, 0.7, whatever fraction you can think of. 
That's an infinite number of values, of real values, between 0 and 1. 
Now integers, however, can only be 0, or 1, or 2, or so on. 
No fractions, so between 0 and 1, there's just integers 0, integer 1, 
it's a finite number, and a much smaller number, so no fractions. 
So that difference between real numbers and 
integers is the same as the difference between analog and digital. 
So if you look at an analog value, let's take light, 
okay, I've got a lot of light, I've got these lights pointing at my face. 
Okay? 
Lights, they can be, generally, 
they have analog values, the brightness has an analog value. 
So you can take a light and have a dimmer switch connected to it and make it 
a little brighter or a little darker, right, and depending on how fine your 
control is you can have a lot of possible values between totally off and totally on. 
And it's a smooth transition, you can hit every possible value between 
completely dark versus completely bright by turning your dimmer switch. 
So in this way, light is generally an analog phenomenon. 
Also sound, you can see the same thing there. 
Sound I'm talking, right. 
I can talk quietly, I can talk loudly, [LAUGH] right? 
I can talk in between. 
So I can adjust my volume anywhere in between completely quiet and 
completely loud. 
Again, an analog phenomenon.

Start transcript at 2 minutes 49 seconds2:49


So the universe. 
The world in general to the perception of humans is analog.

Start transcript at 2 minutes 55 seconds2:55


Now physicists will say look, the world is digital. 
If you look down at a subatomic level, look at quarks and they have fixed states. 
Maybe things are digital in reality. 
Okay? 
They are discreet. 
Either as high or low. 
Plus, minus. 
Right? 
Maybe, but to our human perceptions the world is analog. 
So, a lot of these phenomena that you want to sense are analog, sound, touch, right? 
You can push hard, push soft. 
Things like this? 
They're analog phenomena.

Start transcript at 3 minutes 22 seconds3:22


Now, digital phenomena is something that's either off or on, or 
at least has some discrete number of states. 
So for instance these lights, I could just hook them to a switch. 
They're wall switches, right? 
I hit off and the whole thing goes off, or it goes on, right? 
So maybe I'm using my light in a digital way. 
It's either all off or all on. 
All right? That's digital. 
Or that's discrete, really. 
And digital is a version of that. 
But that's, so that's basically the difference between analog and digital. 
This is also, you get the same definition in terms of watches, right? 
So my watch is a digital watch, right? 
It shows digital numbers. 
One second, two seconds. 
It doesn't show fractions between seconds. 
But if you look at an analog clock where that second hand is 
can point at any fractional number between seconds, right? 
So this is analog to digital. 
Now the reason we bring this up is because these 
embedded systems are interacting with the real world. 
And the real world, to our perceptions, is largely analog. 
So say I want to have a sensor that senses the brightness of light. 
That sensor is generally going to be an analog sensor because it's got to be able 
to sense, assuming that the light is not either off or on, 
it could be a little bright, a little dark, it's got to be an analog sensor. 
Now the problem with this is that our systems, 
the microcontrollers that we have, they are digital systems. 
So, they only understand digital data, specifically zeroes and ones, okay? 
Zeroes and ones, binary data, that's binary. 
Zero or one, that's digital. 
In order for 
our program on our microcontroller to be able to use information from sensors, 
that analog signal has been converted to a digital value. 
And that is what analog to digital conversion is for. 
So we're not going to talk in great detail about how it's performed. 
Now, I have a slide, in a while I'll show you a little bit about it. 
But how it's performed is a complicated thing, but just understand that 
what it does is it takes an analog value and converts it to a digital number.

Start transcript at 5 minutes 10 seconds5:10


Now, this digital representation is maybe an approximation of the actual analog 
value, but that's okay. 
It can be a pretty accurate approximation, as accurate as we need. 
So we need analog to digital conversion at a lot of our inputs. 
Not all, some of our inputs can be buttons, like push buttons. 
Then that's actually naturally digital. 
It's either pushed or not, so zero one. 
But other analog inputs, like lights and sounds and 
stuff like that, those things typically have to go through analog to 
digital conversion before they can be used in our system.

Start transcript at 5 minutes 38 seconds5:38


Now on the output end, you usually need digital to analog conversion, or 
you often need digital to analog conversion. 
So let's say I have a microcontroller and 
it's outputting some sound to some speakers. 
These speakers are analog devices, they need analog signal. 
But the microcontroller is outputting zeros and ones, so 
you need digital to analog conversion to take those digital signals, 
convert them to analog and then drive the speaker with them. 
So it's very common to see digital to analog conversion on the output 
of a system and analog to digital conversion on the input. 
Because in the middle of that system, 
in that microcontroller, it's almost all digital. 
It's primarily digital. 
So the world is often analog, so you need conversion on either end.

Start transcript at 6 minutes 21 seconds6:21


So just to give you a little example [COUGH] of how you might convert, 
how you might form analog to digital conversion. 
You take some analog signal, a wave form over time, and we see one right here. 
This is, let's say it's a sound way, okay. 
So if the sound wave, sound is pressure. 
Pressure through the air. 
And it changes over time. 
So you can measure sound waves you can look at sound like we've seen here in this 
picture where the x axis is time. 
And the y axis is pressure in the air. 
And that's actually a sine wave that you're looking at right there so 
that's like a pure tone. 
One frequency just a [SOUND] you know, a frequency as pure as you can get, 
that's a sine wave. 
That's what it would sound like at some frequency. 
So the Y-axis is generally the pressure, the air pressure. 
Now a microphone, the job of a microphone, is to take that pressure and 
convert it into voltage. 
Okay? Because our machines can't understand 
pressure, they understand voltage, they read voltages. 
So if you look at the Y-axis as it's labelled, it says voltage, and 
then in parentheses, pressure. 
So what they're showing is the voltage at the output of the microphone. 
But still it's an analog waveform. 
It's smooth, the red line, it's analog. 
And it changes smoothly over time. 
Now the analog to digital converter will take that waveform and 
represent it piece by piece as a set of digital numbers. 
So you can see that step. 
So if you look at that red waveform it's smooth. 
It's real numbers. 
It's an analog waveform. 
Superimpose on that you see the stair-stepping. 
They see essentially just a stair-stepping signal. 
That's always has discreet values. 
So there are those levels, 
those horizontal lines, each one represents a discreet digital number. 
And you know, 1, 2, 3, 4, 5. 
And if you look at that stair stepping wave form that's overlapped on top of 
the analog wave form. 
It only ever hits one of those lines. 
It's never in-between, right. 
It's at a line or up or down, right. 
That's digital. 
So you can take this analog wave form, this red one and approximate it with this 
stair stepping digital wave form and so at every time, every unit of time, 
the digital wave form is always at a fixed voltage value in this case, right? 
And so you can just have a series of voltage values over different 
points in time and store it. 
And that is an approximate representation of analog wave form. 
And that is what analog to digital conversion does. 
And we need it to, 
in order to represent any kind of analog input data to the system. 
And note that on the outputs to the actuators you get the opposite going on. 
So you start with the digital waveform, the stair stepping waveform. 
And the digital to analog conversion converts it into that red or 
something close to that red, smooth analog waveform that you see. 
And that gets sent out to whatever your actuator is. 
Say a speaker, or something like that. 
Thank you. 
[MUSIC]

[MUSIC] 
So in this lecture, we'll discuss some of the basic equipment 
that you're going to be using when you're building your internet of things devices. 
And some of the basic equipment that we'll be talking about through the class we'll 
assume that you're using just to make things a little more concrete so you see. 
I've been more generic in the earlier lectures 
about the general type of equipment, but now we'll actually 
point to the specific things that we're going to cover in this class. 
Then when you do the capstone you'll be using this type of equipment when you do 
your capstone.

Start transcript at 39 seconds0:39


So first, the main thing we're gonna use is a development board of some kind. 
It's a board that has a microcontroller on it, 
which is, of course, the center of all these projects. 
The center of these systems is gonna be some microcontroller with some 
code running on it. 
So, the picture that we have here, is actually an arduino board. 
And that black chip on the board, is actually the microcontroller itself. 
Now, there's other hardware on the board. 
There are interfaces like, for instance, you can see USB interface on the side. 
There are a bunch of holes on the side that you can't see yet, 
but those are plugs we're going to plug wires into. 
We'll do that later. 
There's a power. 
And often there are other interfaces on the board. 
So there are other interfaces on the board. 
There are also the chips on the board and other devices on the board. 
So there's the microcontroller, but 
there are other things that are used on the board. 
Generally the board, those development boards, what they are, 
for the most part, the main thing they have to have is a microcontroller, that 
you're gonna program, but also hardware on the board to program the microcontroller. 
So basically, data has to get taken from the USB cable typically, so this has a USB 
port, has to get taken from the USB cable, which is connected to your host. 
Has to get taken from the USB and programmed into the flash memory of 
the microcontroller, when you want to put a program onto the microcontroller. 
So, typically these boards are minimally they will have equipment on there, 
hardware on the board who's job it is to read the USB cable and 
take the data that is received on there and program it onto the microcontroller. 
That's sort of a minimum thing that you're going to find on these development boards. 
A lot of different development boards have lots of different extra 
equipment in addition to that. 
Maybe you have compasses, accelerometer, magnetometer. 
All sorts of extra components you can find on these boards. 
Touch sensitive screens, all this stuff. 
But the basic board is just what I've been talking about right now and 
the boards that we're using, certainly Arduino is pretty basic. 
It has basically what I just said. 
That's an Arduino right there. 
It has very little else besides the microcontroller, 
the hardware used to program the microcontroller, plus the interfaces, 
USB and the pins and stuff like that. 
That's basically all an Arduino has on it. 
Now, we're also going to use a Raspberry Pie and 
we'll go into that in more detail later. 
That has more things on it. 
That actually has an accelerometer on it. 
It has a magnetometer, meaning a compass. 
It has a few other things on it. 
But it's mostly pretty bare. 
It has a processor on it too, a microcontroller on it, too. 
I'll say it's a higher end microcontroller than what you find on our Arduino. 
But that's the core of the system, so that's how we're gonna start. 
We're gonna take these development boards, plug them in by USB to our host, 
our laptop, desktop. 
Write code on the laptop, desktop. 
Program it onto the microcontroller on the development board.

Start transcript at 3 minutes 31 seconds3:31


Now other equipment you're gonna get. 
USB cable, clearly, just to connect the board up. 
Ethernet cable is a common piece of equipment I dont know if we'll be 
using that. 
But ethernet is common because a lot of these boards have ethernet cables, 
have ethernet jacks because we want them to be networked, right? 
We're talking about internet of things so it's common to have an ethernet jack. 
Raspberry Pie does, standard Arduino does not. 
But it's common that they have ethernet jacks and 
then you would need an ethernet cable to connect to that. 
Jumper wires. 
So you're going to need a set of wires. 
You'll get a set of wires to plug into the input pins of the board. 
So that Arduino we saw on the last slide, it had several holes. 
You can plug wires into those holes to connect up other things. 
Different inputs.

Start transcript at 4 minutes 15 seconds4:15


These are components that we will commonly use as input components, so 
essentially sensors. 
So potentiometer, 
potentiometer is a sensor that senses how much turn, sense of rotation. 
So if you turn something more, turn to the left, turn to the right, 
it changes the resistance between two signals. 
And you can use that as a rotation sensor. 
So if you wanna implement a volume knob or something like that, 
you can use a potentiometer and sense how much it's turned. 
Photoresistor, so that's something that senses the brightness. 
So the brightness of the light will change the resistance on a certain resistor, 
and you can sense that. 
A keypad, that's another common component, just a bunch of buttons put together. 
Buttons, individual buttons, that's another input and 
common piece of equipment, and we'll have some of these.

Start transcript at 5 minutes 2 seconds5:02


Some of the outputs, LEDs, so those are light emitting diodes, 
you've seen those little lights that turn off and on, light emitting diodes. 
Resistors, we'll talk about those later, they don't do much. 
They consume power and they change voltage for us, but simple components. 
We're also going to use a breadboard.

Start transcript at 5 minutes 20 seconds5:20


Now a breadboard, actually I have a picture of that on the next slide. 
So breadboards are for wiring. 
So we're going to have a bunch of these components and 
we're going to need to connect these components together.

Start transcript at 5 minutes 29 seconds5:29


So how do we connect them? 
Well there are several ways. 
One way is to solder things and we are not going to do that. 
Soldering is a more permanent connection where you take two pieces of wire, 
two pieces of metal you wanna connect, you'd take a hot iron touch it 
to the joint, bring some solder which is softer metal, 
you melt it onto the joint and it forms a seal and it connects them electrically. 
So that soldering. 
We won't do soldering, because soldering, well several things, but 
the main thing is soldering is more permanent and we're just prototyping. 
I mean, you're gonna be trying things and trying things again, trying things again. 
Making mistakes, trying again. 
So soldering is too time consuming. 
Soldering is more permanent. 
In the end, when you're done, you know everything works, 
then you might solder things together. 
But we're not in that mode, we're gonna be using a breadboard. 
So breadboard is for non-permanent wiring. 
So basically it's got a bunch of holes, a board with a bunch of holes. 
And these holes fit 24 gauge wire, which is the common wire size for 
components like this. 
And these holes are connected electrically. 
There are rows of five holes, you can see there, and if you put a wire into one 
hole in a row of five, all the other holes in the same row of five are connected. 
So you can plug two wires into two different holes on the same row of five 
and they are connected. 
And that's how you connect components. 
So you can plug one connection from a component into one hole in the row and 
plug another component into another hole in the same row, and 
then those two components are connected. 
Okay. So this is how we're going to be 
doing wiring. 
We're gonna have our breadboard and we connect things in that way. 
And if you look at the breadboard, it's got these rows of five, but 
then along the left and right sides, you got these columns, right. 
These two columns on the left, two columns on the right with breaks in between. 
But basically, two on the left, two on the right. 
So those columns are actually wired differently. 
They're not wired horizontally like those rows of five. 
They're wired in columns. 
So those two columns on the left, all holes in the same column are connected to 
each other, and all holes in the next column are connected to each other. 
Same thing on the other side. 
All holes on the one column and all holes on the next are connected. 
So traditionally those columns are used for power and 
ground because usually when you make a system, you have a lot of chips and 
a lot of different components in there and a lot of them need to receive power and 
need to be connected to ground, so it helps to distribute power and 
ground across the whole circuit to just put power and ground into those rows, 
those columns, rather. 
So, put power into one column. 
Ground into another. 
Then anything you want to connect to power and ground, 
you don't have to run a long wire. 
You just run a wire straight to that column, to the nearest hole on the column. 
So, we'll be using breadboards to connect up our components and 
it's very common for prototyping and it's made a specific size. 
It's a common size.

Start transcript at 8 minutes 11 seconds8:11


Here's a typical circuit. 
This is just one possible circuit but there's an Arduino. 
And this Arduino, it's connected to some LEDs. 
You can see those red LEDs that are in the breadboard, right. 
So the LEDs are plugged into holes in the breadboard, the two leads. 
An LED has two leads, two wires, that are connected to holes in the breadboard. 
They're also resisters. 
I don't know if you can see them. 
But those little components that connect from the LEDs to the bottom row 
that those are called resistors. 
And we'll talk about that circuitry. 
Basically you always want to put an LED in series with a resistor. 
If not, then if you don't then what'll happen is you'll draw too much current 
through the LED and you'll blow it out, it'll will burn out. 
It will be very bright for a second and then you'll here a pop and 
it will be gone. 
You put resisters in there just to slow down the current, 
basically to reduce the current. 
Not slow it down but to reduce the amount of current that goes through. 
And the other side of the LED is connected by those blue wires into the Arduino. 
And the Arduino has some program running on it that probably turns on the LEDs, 
turns them off and on in a particular sequence, or whatever you want it to do. 
So those are the type of components that you will be using in the class, and 
we'll be talking about in the class. 
Thank you. 
[MUSIC]

 Identify the core hardware components most commonly used in IoT devices
 Describe the interaction between software and hardware in IoT devices
 Describe the role of an operating system to support software in IoT devices
Bojanova, I. (2015, March 31). What Makes Up the Internet of Things?  Computing Now, IEEEComputer
Society.

[MUSIC]

Start transcript at 15 seconds0:15


Module three is about hardware and software Internet of Things devices 
are built from hardware components and software components working together. 
You don't design them in isolation, 
you design them together to make them more efficient.
Start transcript at 29 seconds0:29
We'll talk about these hardware components, 
software components, and how you partition the behavior of the system. 
How do you decide what part is implemented in hardware, 
versus what part is implemented in software. 
So for instance hardware is typically used to handle physical interaction. 
The interaction with the physical world. 
The sensors and actuators are hardware components, typically. 
Also hardware's needed, dedicated 
hardware would be needed to do the things that are more computationally complex. 
Where software is used to do the control and 
also slower things, human interactions, things like this. 
So, we'll talk about the hardware and the software and how you design them together. 
We'll talk about the different types of hardware components that are typical, 
that you find in these systems. 
We'll talk about the software design process, too. 
Compilation, interpretation, that sort of thing. 
And how they come together inside a microcontroller.

Start transcript at 1 minute 17 seconds1:17


Now in more complicated Internet of Things components, you use an operating system. 
And people are already familiar with what operating systems are, but they mean 
something a little bit different in the context of Internet of Things devices. 
So, we'll talk about operating systems, and talk specifically about operating 
systems that are appropriate for an Internet of Things component. 
[MUSIC]

MUSIC] 
So this lecture, we're gonna talk about hardware and software systems. 
Internet of things devices, are typically hardware and software combined. 
So as we're learning about the IoT design process, 
we really have to think about how you design hardware, 
how you design software, and how do you design them to work together. 
So you can't think of one in isolation, 
you really need to think about both together as you're working on the project.

Start transcript at 34 seconds0:34


So IoT devices are a combination of hardware and software. 
There's always a hardware part of the design and you can see that here, 
we've got a bread board. 
And the bread board's got various components on it, 
it's got a micro controllers, LED, voltage regulator, capacitors I see, 
a bunch of different things, and they're all mounted into this bread board. 
One part of this design, one aspect of the design, 
is a hardware aspect that you can see right there and that's basically a bunch 
of components that are connected, wired together in some fashion, okay? 
So that's part of the design and so a designer, 
if you're gonna make an IoT device, you have to think about that part too. 
But in addition to that, that alone doesn't explain what the behavior is. 
When you're looking at that set of devices wired together, 
even completely understanding what each component does, 
you can't tell what the behavior of that, right? 
So you have an incomplete view of the design if you only look at the hardware. 
In addition to this, you gotta look at the software component of this too. 
So if you look at the hardware side over there, you've got at the center of it, 
there is this micro controller. 
That big black chip dead in the center, 
that is the micro controller which is the heart of the system. 
And that micro controller executes code. 
And so there's gotta be some code, 
some software, which we can see on the other side of the picture. 
Some software that's going to run on that micro controller. 
Now that software is some sample code and that's actually our Dwino code and 
we'll get to that later. 
But there's got to be some software that's running on that micro controller, 
that talks to all the different components. 
Talks to the LEDs, tells them when to turn off and on and things like this. 
So there's this hardware side and this software side and 
these things have to work together. 
You've got to design both of them. 
So what I mean is when you write the software, 
you have to be thinking about the hardware. 
You have to say oh I've got an LED and it needs to be controlled in this fashion, so 
I will write my code in this way. 
You have to be consciously aware of that when you're doing the coding. 
Whenever you make a new project, you've got a bunch of hardware components, right? 
You gotta get a bunch of hardware components and wire them together and 
decide on that a priori. 
What are the hardware components going to be? 
Now, this is sort of a fundamental issue with design projects in general,

Start transcript at 2 minutes 41 seconds2:41


things change, right. 
So at first when you design something, you have an idea of what the behavior is gonna 
be and you think you know what the components will be. 
And then you start doing it, you get into the design and 
often you have to back off track. 
You might implement something and realize, 
oh you know what I need a different component this doesn't work for me. 
So that can happen, there's always that risk. 
But at the beginning to start building your system you're going to have to have 
some idea of the type of components that you're gonna need. 
So that's always a trial right, to figure out which components you're gonna buy. 
Now, you start with a micro controller, but you need other components around that. 
And each one of these components has different parameters. 
Different sizes for instance, different, and you might care about that. 
You might need this whole design to fit into a certain space, right? 
So you're worried about the size. 
Different voltage, different electrical parameters right, 
how much current can this component take, right? 
Maybe this LED can only take 20 milli amps, which is sort of common. 
So if you drive it with more than that, you'll blow up the LED, things like this. 
So everyone of these components has these features that you have to consider before 
you order them. 
Now back in the old days when I was a kid, 
when you wanted to do one of these projects, you'd go to a store, 
Radio Shack which is gone now, you go to RadioShack and you could buy the parts. 
And the people in the store could help you with the parts. 
So they were knowledgeable about these little parts. 
So they would say, oh that chip, it will do this, but this component, 
this resistor is no good for that purpose or something, right? 
They'd give you, they have knowledge about the different components and 
what they did, but those components don't cost a lot, right? 
Switches and things like that, they're pretty cheap, so stores like Radio Shack, 
things like that, 
they don't particularly care about selling those things anymore, frankly. 
I mean they sell them, But they don't make a lot of money off of them, 
I get the feeling. 
They make money off of selling cellphone deals, or 
something like this, something else. 
So you go into these stores and generally, 
the people are not knowledgeable about their components, which means that it is 
on is on you to understand these components of what they do. 
So you can't rely, most of the time, unless you go to a good store and 
there are stores like that where you can get somebody who really knows what he or 
she's talking about, but often, you are on your own. 
And another thing too is that these type of hobbiest electrical stores, 
they're rare, they are few and far between these days. 
You can't find stores that have these parts. 
I mean I go to Fry's, things like this, also other local places, but 
it's hard to find these parts. 
So often you're buying these components online. 
You go online, you look at websites. 
Now these websites, there are a lot of different websites and 
they're very complete, they have tons of components. 
But in some ways, it's sort of data overload, there are too many components, 
too many slight variations. 
So you see 100 components that look similar and 
you have to figure out exactly the one that you want. 
And I can't tell you how many times I thought I wanted a component, I ordered 
the component, it comes a week later and then tada, it is not what I needed. 
It is somehow slightly wrong and now I have to go and order new parts and 
cycle through that. 
And it is inevitable that will happen to some extent, so just be ready for that. 
But you really wanna minimize that, you wanna to be able to know before you go and 
order these parts, you want to be able to know that they match your needs, 
as well as you can know that. 
So that is what data sheets are for. 
So, data sheets are basically information sheets about hardware components and 
every component has a data sheet. 
The simplest components, maybe you don't have a data sheet. 
For instance, a resistor, actually even resistors you can probably find data 
sheets, but a resistor is so simple you don't need a datasheet for that, okay? 
They have very few parameters, but any kind of complicated 
component will have a datasheet that tells you all kinds of information about it. 
The size, the shape, the inputs, the outputs, the voltage, all the electrical 
parameters, things like this all the data that you need in order to use it. 
So reading these datasheets is really important. 
You can always find data sheets online, you find the part number, you type 
it into Google, the part number, type data sheet and you will find data sheets. 
And they can be very complicated to read, but 
it is important that you be able to minimally read them. 
At least find the important information, just so you can order the parts you're 
gonna need to make these devices that you will be making. 
Thank you. 
[MUSIC]
[MUSIC]. 
So, we'll continue to talk a little bit more about datasheets for 
hardware components, specifically for integrated circuits, 
because they are extra complicated. 
So right here we got, this is a rectifier, a Schottky Rectifier. 
This is a piece of a data sheet. 
So if you Google Schottky Rectifier and if you type in the part number for that and 
type data sheet and Google that, you'll come up with a data sheet, 
several versions of it, actually. 
And you can click on it and 
there are lots of different things inside this data sheet. 
One thing that you always find inside a data sheet 
is the physical dimensions of the part. 
Because they always want to tell you how do you build it into a bigger system. 
So, how's it going to connect to everything. 
You always want to know that. 
This is actually a diagram showing the physical dimensions. 
It shows all detail, the size of it and this is just one cross-section. 
A lot of time these data sheets will show different views from different angles. 
This shows you with the pins. 
It shows you every dimension that you need to know about. 
Actually, right there on that, you can't see all the numbers there. 
They label them with letters but 
there is a table next to it that shows what the sizes are. 
This is a typical thing you will find inside a data sheet. 
Now, you find tons of information in a data sheet. 
And part of it, certainly when I started I could not read most of a data sheet. 
All right, you can read a little bit of a data sheet, 
so I don't expect people to be able to read the whole data sheet. 
And, in fact, most of the data sheet, you don't practically need. 
But, some key things you should be able to figure out. 
For instance, the size, you typically wanna be able to read the size cuz 
there are certain things that you need to know. 
Like, for instance for this class, say you want to use a bread board, right? 
That's commonly what we want to use for prototyping is a bread board for 
connecting things. 
For that, you need to know the size of the pins and 
its spacing between the pins because the holes in a bread board is spaced at 
one tenth of an inch between each hole. 
So, when you get a component, you wanna know the pins are spaced some multiple of 
that, so you can fit them into the bread board. 
Things like this. 
And, if they're not, you need to know that before you order the part, so 
that you can do something about that. 
So, the physical side, the physical dimensions, 
you always find that in the data sheet, and you'll need to be able to read that. 
Now other information, 
just a sample of some of the other information in the data sheet. 
You find electrical parameters and 
thermal parameters, what temperature can this thing run at. 
Now usually, thermal parameters are not something I generally need, 
because I'm not trying to use these components in some extreme environment, 
but they give some kind of boundaries. 
It can't be hotter than this, colder than this. 
That's generally not useful to me, 
but maybe you're using some application where you need that information. 
Electrical parameters are important to tell you things like 
what's the maximum and minimum voltage, maximum current that can go through that. 
And that is actually important because you wanna make sure, for instance, 
that components are voltage-compatible. 
So for instance, say you get a microcontroller and 
it's outputting at 5 volts, but you get a component that only needs, 
only accepts up to 3.3 volts, which is by the way, a common mismatch. 
So if that happens, you need to know that so 
you can either buy the component that matches your microcontroller, 5 volts, or 
you can do some type of stepping, voltage stepping, put a transformer in between, 
something like that to change the voltages and make them match.

Start transcript at 3 minutes 20 seconds3:20


So, these parameters, some of these parameters you need, 
some of them you don't need that much.

Start transcript at 3 minutes 26 seconds3:26


Now, integrated circuits are another type of component. 
They're a sort of simple components and more complicated components, and 
the data sheets vary in complexity. 
So if you look at a simple component like a resistor, 
and we'll talk more about those later, but they're very simple. 
You don't need a data sheet for a resistor or a capacitor. 
You need minimal Information about those components. 
But more complicated components, the more complicated they are, 
the denser the datasheet is. 
Integrated circuits are basically the extreme of that. 
So, integrated circuits, 
and we've talked about these microcontrollers are integrated circuits. 
Integrated circuits are chips. 
Now, they're typically made of say silicon, silicon base. 
But they can be made of other materials, primarily silicon right now.

Start transcript at 4 minutes 8 seconds4:08


And we're not gonna talk about the fabrication technology except to say 
that they're basically made on these big wafers so you can see down there. 
You can see these disks, these flat disks, these circular disks. 
So those disks are slices of silicon, and 
you chop them up into little rectangles and each rectangle is a chip. 
As you take that chip and 
you package it as you can see over there on the right, you see the packaging. 
You hide it inside this bigger package, and 
the package is used to protect the chip, also to cool the chip as it's running. 
Also to wire its pins. 
You can see the pins on the bottom. 
So the pins on a chip are too tiny to contact, so you need them to be bigger, 
so the package does that for you. 
So the package provides pins that you can actually make contact with and big enough 
for you to solder into or connect into a bread board or something like that. 
So anyway, these integrated circuits, 
they have data sheets as well, chip is protected by the package. 
These integrated circuits have data sheets as well, and these data sheets for 
integrated circuits can be very complicated because what these 
integrated circuits do can widely vary. 
So an integrated circuit for instance can be an entire processor, right? 
And then the data sheet for that can be heck, over a thousand pages. 
[LAUGH] All right. 
I've definitely seen that. 
Or a simpler process is like a microcontroller. 
Maybe you get 150 page data sheet, right? 
And it's got tons of information on how this device behaves. 
Now, most of the time for this class we won't have to go to that level of detail. 
We won't have to look at the 150 page data sheet, and 
look at the details of what's going on. 
In fact, with the components that we're using, we're using Arduinos and 
Raspberry Pis. 
Those boards, they come with libraries that hide the details for us, okay. 
So we will not have to be exploring 
a lot of the details inside those components, thankfully. 
But, you could. 
So if you really want to make the most use of these components, these chips, 
you can look in the data sheet and see lots of features. 
So the trade off with what we're doing with our Arduinos and 
our Raspberry Pis is that they give us these library functions, and 
we'll talk about these later, that simplify things for us as programmers. 
But they hide details, they also hide features. 
So there are a lot of things that you can't do with a processor, 
with a microcontroller, 
just because the library doesn't allow you access to that feature. 
Now, if you want access to that feature you can go and 
look at the data sheet and do it, but you won't be able to rely on the nice, 
easy library functions that you really want to rely on. 
And inside this class, we probably won't be going into that level of detail about 
these microcontrollers at all. 
We'll just use their library functions and not have to worry about these extreme 
details of the behavior of these microcontrollers. 
Thank you. [MUSIC]

So, we're going to talk about 


microcontroller characteristics right now. 
The different characteristics of microcontrollers. 
Now, the reason why this is important 
for making IoT systems is because when you 
make it an IoT systems probably 
one of the early decisions about how to 
implement the system is going to be, 
which microcontroller should you use, right? 
Now, there are a wide range 
of choices with microcontrollers, 
and you're going to have to find one to use. 
Now, a lot of these decisions are pre-done for you, like, 
if you work in a company, 
they use a particular brand, 
we use Freescale, whatever, 
that's what you use, right? 
Even within those constraints, you get, 
even be stuck with, say, 
you're only using Freescale. 
It's a ton of microcontrollers you can use, 
all with set of 
different properties and things like this. 
You got to pick the one that's right for 
your project because another feature of 
IoT systems is that they are 
generally constrained, tightly constrained. 
So, it's not like a desktop laptop. 
Right. If you look at a desktop laptop, 
those things are over engineered, 
in the sense that you get 
some quad core processors run in it and I don't know, 
three gigahertz something like this. 
Regular user doesn't use that. 
In fact, it's running, 
it's sort of two percent capacity 99 percent of the time. 
So, you start playing a game. 
Certain games, they will suck up that power, 
they will use what the computer has, 
but vast majority of 
the time that processor is sitting there at 
two percent basically idling 
because you don't need four cores, 
you don't need that clock rate, 
you don't need everything that it has. 
IoT based systems, those things are cheap, 
you want to be cheap. 
You do not want to buy some big 
powerful microcontroller that you don't need. 
You're always saving money trying to say, "Look, 
what is the cheapest thing that just 
barely does what I need to do?" 
So, what you need is, 
you need to have in mind a set of 
characteristics that your microcontroller needs, 
so the bare minimum for your system. 
Then, you look through the data sheets for 
the microcontrollers to figure out which one has that, 
just barely, which is the cheapest one that has that. 
Now, a data sheet, 
we're not going to look at a data sheet because 
those are painful look at. 
A data sheet is basically 
the sheet that has 
all the information about the particular microcontroller. 
So, if you ever want to look up a micro control, 
you can look on the top of the chip. 
You can see the name of the microcontroller, 
its part number and everything, you type that in, 
into Google, and you say "data 
sheet," and you will 
come up with a data sheet, most likely. 
As data sheet, you might look at one, 
they are definitely complicated to read. 
They have lots of different details 
about the microcontroller. 
There are certain information in these, 
certain things in these we really need to 
understand in order to make reasonable decisions. 
So, we don't have to understand everything 
in there, we will not. 
Certain high level characteristics of a microcontroller, 
you should know what they mean, 
and so when you look at a data sheet, 
say the front page of the data sheet, 
you can at least tell superficially, "Yeah, 
it has this, it has that, has that. 
That's what I need or I don't need that." So on. 
So, let's talk about the basic characteristics 
of microcontrollers that you might look into. 
Again, also another thing, 
let me mention is that, in this class, 
you won't be making this decision. 
You're not going to be deciding which 
microcontroller you're going to use. 
In this course, we use an Arduino, right? 
Then, next set of course, 
we can use Raspberry Pi, we're set with that. 
But I'm saying outside of the course, 
when you and design your own IoT system, 
you will need to pick a microcontroller. 
Okay. Datapath bitwidth. 
Bitwidth, what that means is, 
it's a number of bits in each register. 
A register storage element to store as a number. 
So, the bitwidth basically tells you 
the size of most numbers in your system. 
How many bits? 
So, every number is represented in binary as 
a series of bits which are 
binary digits, either zero or one. 
The more bits, the better, okay? 
So, what do I mean by that? 
If you have more bits, 64 bits let's say, 
that means you can get more accuracy than you could 
with 16 bits, something like that. 
So, you get more accuracy, 
you get more data throughput. 
So, basically if you're processing on 64-bit numbers, 
there's more data processing than you can 
do then if you processing on 8-bit numbers. 
I know we're not going to go into architecture, 
but roughly that's what datapath bitwidth means. 
Now, there's a limit. 
I mean you don't need excessive accuracy 
in your average system, right? 
So, you know an 8-bit microcontroller, like, 
the Arduino that we're using, 
is based on an 8-bit microcontroller. That is sufficient. 
That is minimal, but that is sufficient 
for the task that we do in this class, right? 
We don't need high accuracy. 
We're just doing simple control operations. 
We don't need accuracy and numbers. 
So, it's a bitwidth 
is something you have to think about depending 
on the task that you're performing. Input/output pins. 
Now, this is actually an important thing 
because it's often a bottleneck. 
So, you got to your microcontroller. 
The microcontroller is the center of the system. 
It's connected to everything, 
is orchestrating the whole system, right? 
So, the microcontroller has to be connected to 
all the different components 
that you want to put in your system. 
Now, maybe not all but to a lot of them, okay? 
It requires pins to connect it to these things. 
So, maybe you need three pins 
to connect to one integrated circuit, 
and five pins to connect another, 
and so on depending on what the circuit is, 
you know, how many pins it has on its interface. 
You can easily chew up all the pins, 
you can easily use up all the pins on 
our microcontroller because 
there are these microcontrollers, 
generally, they don't have too many pins. 
So, you have to be careful about how you use the pins. 
So, that's why very early in the design process, 
you have to just sketch out your design, 
figure out what the different 
components are you going to use, 
and how many pins each one of 
them needs to go talk to the microcontroller. 
So, you can get a number, 
like say, okay, I need 40 pins. 
Then you can find a data sheet that reports it 
has at least 40 pins and so on, right? 
So, input/output pins are important for that reason. 
Performance, okay. So, performance is important. 
It depends on the application, right? 
So, sometimes it's important, sometimes it's not. 
Now, one thing to note with performances, 
many times when you're making an IoT device 
it is interacting with a human, right. 
It's a device that's dealing with 
the human and humans are slow. 
So, humans, they don't need you to respond too quickly. 
Now, when I say not too quickly, 
let's say you're putting images on a screen. 
These images on a screen, 
if you put 30 a second on a screen, 
a human will be very happy with that. 
Human will see it, say mode, 
and everything will be smooth, right? 
Now, 30 frames a second, 30 things a second, 
operations second is very 
little for many processes 
and that depends on the processor. 
Maybe a processor could do a lot more than that, 
but it's not necessary because the human is slow. 
So, you're supposed to get with this with sound, right? 
With audio, a human can only hear what 22 kilohertz, 
I think, is a maximum0 frequency. 
That is not very fast, 
okay, 22,000 operations a second. 
That's not a high rate of processor speed, right? 
So, a processor can process audio data much 
faster than a human can hear the data, right? 
So, you can use a pretty slow processor and 
still produce a satisfactory audio. 
So, performance is important. 
You have to consider that depends on your application. 
Video though, video requires 
a lot more even those 30 frames a second, 
each frame might have many millions of 
pixels and you might have to do 
lots of processing on that. 
So, video generally requires a higher rate, 
but audio you know, 
if you're just an audio or tactile, 
maybe if somebody's pressing a button, 
something like that, very slow clock rate is sufficient. 
There we go, okay. So, some other features, timers. 
There are other components inside 
your microcontroller that are 
commonly useful to an IoT system like a timer. 
Now, you need a timer for any type of 
real-time application and a lot of 
IoT systems have real time functionality in them. 
So, say you want 
something to happen at a certain deadline. 
I want to sample this sound 
every one thousandth of 
a second I want to sample the sound. 
Then you need a timer to trigger 
that event to happen at that rate, right? 
So, or I want to sample a monitor, 
I want to sample some temperature monitor 
at some regular period, right? 
You need a timer to set that, 
to force it to happen at that rate. 
So, timer is a really important in microcontrollers. 
So, you need a few timers. 
When you considering the timers, 
there's an accuracy, a timer accuracy issue. 
You got to think how much accuracy do you need in 
the timing and then that determines 
the bitwidth at the timer, right?. 
So, an 8-bit timer is less 
accurate than the 16-bit timer. 
We'll get to that later when we deal with timers. 
Anyway timers are components that you look for, 
you always want a few of them in a microcontroller. 
Analog to digital converters. 
So, what this is for is to read analog signals. 
Now, the issue here is 
that microcontrollers are 
generally digital devices, okay. 
When I say digital, all the numbers 
are zeros and one, off or on, 
they're discrete values, zero or one, nothing in between. 
Now, analogue is a continuous set of values. 
So, the difference between 
analog and digital is the same as 
the difference between real numbers and integers, 
right? They're discrete integers. 
You can have zero,one, two but you can't have 1.5. 
While analog is continuous, 
you can have any number anywhere. 
Now, controllers microcontrollers in 
integrated circuits in general they 
are almost always digital, 
completely digital because it's much 
easier to design a digital circuit 
than it is to design an analog circuit. 
But they are digital, 
but the world is analog. 
So, what I mean by that? 
Save this light that is in my face while we're recording. 
This light can be a little brighter, 
I hope is not a little brighter, 
little brighter, a little dimmer. 
Okay. It's not just off or on. 
They can increase the brightness, 
decrease it in an analog way. 
So, phenomena that humans interact with, sound, right. 
I can talk a little louder. 
I can talk a little softer and so on. 
So, that's an analog phenomenon. 
So, the world is generally 
analog to the perceptions of a human. 
These computers are digital. 
So, if you want a an IoT device 
to process these analog phenomenon, 
it has to convert it into a digital number. 
So, the brightness of this light, say, 
I want my IoT system to do 
something when the brightness 
reaches a certain threshold, 
it's going to hesitate. 
it needs to be able to take that 
analog value of that light brightness, 
convert it to a digital number that I can use in my code. 
I can say if brightness is greater than 
1,000 or some digital number, right? 
So, analog to digital converters are important 
in an IoT devices because you want it 
generally is very common to take analog phenomenon 
and convert it to digital values 
that you can process in your code. 
So, A to D converter analog to digital, 
A to D usually 
want one or more of these in a microcontroller. 
I'll note right now Raspberry Pi does not 
actually have an analog digital converter, 
so that limits it in certain ways, 
but it is very calm for microcontroller 
to have at least one analog to digital converter. 
Low power modes. These are common nowadays, too. 
When I say nowadays, I'm an old guy, 
so I remember back in the old days, 
when nobody cared about power, there's plenty of power. 
That's because everything was, 
things weren't battery powered, 
everything was plugged into a wall. 
Also microcontrollers were just much slower then, 
so, they didn't consume much power. 
Nowadays, things are battery driven, 
things are fast, right? 
The clock rate is fast and the faster it runs, 
the more power it uses. 
So, power is a very big issue these days, 
when you're doing integrated 
circuit design and system design. 
So, in integrated circuits, 
it is very common to have low power modes, 
in microcontrollers you can have 
different low power modes. 
So, the chip doesn't have to be just 
completely off or completely on, 
it can have these intermediate modes 
where certain things are turned on, 
certain things that turned off, 
or maybe something that's turned on, 
but it's running at a slower rate, 
you know things like this. 
Maybe you can't use the memory, 
but it doesn't lose what it's storing, right? 
So, it's got this intermediate state. 
So, there in low power modes 
built into these microcontrollers commonly, 
and we're not going to 
cover that in this class because that's a 
little more sophisticated than we're going 
to touch on this class, 
but more advanced IoT systems. 
Yeah, you're considering low power modes. 
You often these things often 
run off a battery if you want 
them to run a long time and 
that's sucked down the whole battery. 
So, that you often want them to run 
in low power mode when is possible. 
So, you can see this in a data sheet. 
You can write in the front page probably, 
you'll say that it has certain low power modes. 
Communication protocol support. 
So, what this is and we'll get to this more later, 
but these microcontrollers they have 
to communicate with other integrated circuits. 
Okay. These integrated circuits, 
the way that they communicate, 
they use some kind of a communication protocol. 
Relatively simple communication protocol, 
the way that they send data to and 
from each other over a set of pins, 
it's got to be in a certain order with 
a certain timing and so on. That's the protocol. 
We'll get into more detail about these protocols later, 
but some of them are UART, 
I2C, SPI, those are some. 
We'll cover those later in the class, 
but these are protocols 
that you can look in the data sheet and say, 
yes it supports I2C, 
yes supports SPI, yes supports UART, right? 
Now, this is important because 
when you're making your bigger system, 
say you want your microcontroller 
to talk to some sram, sram chip, right? 
This sram chip maybe it talks I2C, but doesn't talk SPI. 
If your microcontroller doesn't 
support I2C, then you have trouble. 
Now generally, these microcontrollers nowadays 
they mostly support everything 
and all those I just said and others, too. 
So generally, you have in most basic microcontrollers, 
you have a lot of communication protocol support, 
but you should check, just in case. Thank you.

[MUSIC] 
This lecture will talk about microcontrollers in a little bit more 
detail. 
Specifically, we're gonna talk about the storage elements and 
how you store data inside a microcontroller. 
Some of this is important for us, just to have an idea of what type of elements 
there are inside a microcontroller. 
And not just inside a microcontroller really, but also the memories outside 
the microcontroller, cuz these are important parts of the system. 
You always have data, you need to store it. 
So we need to know a little bit about that. 
So first, here's a picture of taken out of a datasheet for 
an AVR at mega 2560 microcontroller. 
This at Mega 2560 is not the same as what's in the Arduino, or 
not in the regular Arduino. 
In the Arduino uno, it doesn't have this. 
Actually I think there is an Arduino that uses one of these, but 
this is the same series of processes that you find in an Arduino. 
And here's some of the information that you would find right on the front page of 
the datasheet. 
8-bit microcontroller up to 16 megahertz, that's the clock frequency. 
256 kilobytes of flash memory, so 
that tells you something about the type of memory in there. 
Flash memory as you may know, it's a type of memory that's nonvolatile memory. 
So after you lose power when you regain power, the memory's still there. 
So you see this in thumb drives. 
Thumb drives are basically flash memory. 
EEPROM is also another type of nonvolatile memory similar to flash. 
SRAM is your regular random access memory, we'll talk about that. 
And then peripherals, that's sort of a general term for 
all the other components inside the micro controller on the chip, like the timers, 
ADD converters and all those other things. 
So it's got a number of peripherals that I didn't list, 
I didn't put the whole datasheet up there. 
But that picture right there, shows you what the pins look like. 
So actually, where they are configured on the chip. 
So that means if you bought the chip, then which pin corresponds to which function? 
And they're all labeled right there. 
Actually, this is just a snippet of it, cuz we couldn't put all the The pins on 
this one page, but this is like the upper left hand corner of the chip. 
It shows you the pins that you can see there and 
there are a lot more pins than that, but they're all labeled with names and 
are referred to later in the datasheet.

Start transcript at 2 minutes 25 seconds2:25


So let's talk a little bit about storage elements that you find in these 
microcontrollers. 
Storage elements are basically elements that store data. 
There's a need for a lot of data; so you need to store data. 
A variety of types of different data. 
You can store data, you can store the program itself. 
The program itself is data. 
So that has to be stored in some sort of storage element, as well. 
There are different types of storage elements. 
There's a speed performance tradeoff. 
So some types of storage are very fast, but they cost more. 
Usually they cost more, because of area. 
They take up a lot more area on the chip, so they cost more. 
Where on the other hand, there are other types of storage elements that are slower 
to access, but they cost less. 
They are much smaller on the chip. 
There's also a power tradeoff that I didn't mention here. 
So most basic storage element, fastest storage element is the register. 
A register stores only a single value. 
Now depending on how many bits the register is, it serves one number. 
So if you have a 32-bit data path, you'll typically have 32-bit registers. 
So, it can store one 32-bit number. 
It stores whatever you want, 32-bit number. 
Maybe the location in a certain memory locates, 
the value in a location in a memory location. 
Some number that you're working with, some variable that you're working with right 
now in the program, something like that. 
Very fast. 
So when I say, very fast, the access time is a lot less than a clock cycle, 
but it's expensive. 
So you can't have too many of them on chip, because they're so big. 
So there are several special purpose registers that are devoted to particular 
tasks on the microcontroller, like the program counter is a common one. 
Program counter is the register that tells you what instruction you're executing in 
a code, it's the address of the instruction you're currently executing. 
So that's something you as a programmer shouldn't be manipulating, 
shouldn't be touching that, but it's a special-purpose register. 
But there are also a set of general-purpose registers that your 
program can actually use for computation, arithmetic, things like that. 
There's also a register file. 
A register file is basically, a group of registers put together. 
So these are commonly how registers are organized inside microcontrollers. 
It acts like a memory, just a very fast memory. 
You can only read one or two of these registers at the same time, but 
usually you don't need to read more than two in a particular clock cycle. 
Their instruction operands are stored inside register files, so 
what you're seeing there is an add instruction. 
Add $r3, $r2, $r1. 
It's not gonna look like that to you. 
That's what the machine is actually running, 
the simple instructions that the machine's actually executing. 
We'll talk about that a little bit later, but notice it has these operands. 
So $r3 is the destination register, that's the name of a register, $r3 and $r2 and 
$r1 are the two source operands. 
The two things that wanna get added together. 
So what this instruction does is it takes the contents of register $r1, contents of 
register $r2, adds them together, puts the results in register $r3. 
So commonly these microcontrollers are reading data out of registers, 
putting results into registers. 
Because they're fast, you wanna work with registers all the time if you can. 
Can only read one or two at a time and you can contain, typically, 
a register file often has like say 32 registers. 
That's very common to find in a microcontroller, 
32 different registers that you can access. 
So that gives you a hint as to how expensive they are. 
32 isn't much, but that's generally all you can afford on a microcontroller. 
Memories. Now memories are, 
you know what a memory is, it stores data. 
But memories are made to store a lot more data than registries, so 
you won't just have 32 registries. 
Memories will a lot bigger. 
So there are varieties of memory. 
One type of memory is called cache memory. 
Cached memory, it stores a lot of values. 
I'll just give you a ball park on how big a cache typically is. 
This is all ballpark for right now, but let's say, 
modern processing maybe you got a one megahertz cache. 
It wouldn't be 1 megahertz, 1 megabit cache. 
That's ballpark, but say, you got a 1 megabit cache and that could be plus or 
minus, but that tells you something about how big they typically are. 
So usually they're a lot bigger than register files, but 
they're also slower than register files. 
Where a register file, you could access that in a fraction of a clock cycle. 
A cache typically takes you a clock cycle to access, 
a full clock cycle, which is pretty good, but not as good as a register file. 
Still fast and expensive. 
They're cheaper than register files, but 
they're more expensive than larger memories. 
So that's a cache and that's on chip. 
You'd find that on the same integrated circuit as the microcontroller. 
Typically, commonly in the microcontroller is that we are using what is called 
the Harvard architecture. 
So you'll have two different caches, at least two. 
You will have a data cache and an instruction cache. 
The data cache holds the data that the program is operating on and 
the instruction cache holds the actual instructions of the code that 
is being executed. 
So, it's common to separate those two and then there's also main memory. 
Main memory is like cache, except it's bigger and cheaper and slower.

Start transcript at 7 minutes 21 seconds7:21


So you can see the pictures right there of main memory. 
That's a typical main memory. 
If you've ever taken your taken your computer and installed memory into your 
desktop, you'll get something that looks like what we see in the picture and 
you can plug it into a slot inside the board. 
So it's very big gigabytes of memory not in the CPU, so it's not on the same chip. 
By the way, CPU again, I'm throwing you another term. 
By CPU, I'm using that the same as a microprocessor and 
the same as a microcontroller. 
Same thing, roughly. 
So main memory is not gonna be in the CPU, it's off the CPU. 
It's on the same board, but it's on a a different set of chips. 
In fact, if you look at that memory, it's multiple chips all put together.

Start transcript at 8 minutes 9 seconds8:09


It's connected to the system, connected to the CPU via system bus. 
So there are system bus that basically has a group of wires, that are written. 
Basically, drawn onto the circuit board, 
the printed circuit board that connect to the main microcontroller to the memories.

Start transcript at 8 minutes 24 seconds8:24


The memory access is slow relative to the cache. 
So what that means is that in a cache, 
you might be able to access a cache in one clock cycle.

Start transcript at 8 minutes 33 seconds8:33


And main memory, maybe you have to wait 100 clock cycles to access on main memory. 
So again, that's ball park, but that's not unrealistic at all. 
There's what's called the Von Neumann Bottleneck, 
which is the fact that in a Von Neumann architecture, 
every thing, the data and instruction are put into the main memory and 
the problem is that main memory is much slower than the processor. 
So main memory, like I say, 
maybe you wait 100 clock cycles to access something out of main memory. 
So if you say, you wanna do an add instruction, 
you wanna add two pieces of data that are in main memory, you're waiting 100 clock 
cycles for that data to show up and then the add itself takes 1 clock cycle. 
So all your time is going into memory accesses or it can go into memory accesses 
and that is why people use caches, so that to avoid this Von Neumann Bottleneck. 
So, the Von Neumann Bottleneck is the bottleneck to accessing main memory. 
It's the fact that the memory, it's much slower than the processor. 
So to avoid that you, basically, use the cache. 
You try to rely on the cache and the registers as much as you can, 
so that you don't have to go to main memory. 
Now all these complexities that I'm talking about, 
about are you accessing the cache, the register or the main memory. 
A lot of these we will not be dealing with in this class, 
because we'll be writing code in either C or in Python. 
So, all these details of where the data is gonna be? 
Is this register gonna contain this variable or 
is the variable gonna be in the cache or main memory? 
All those issues are dealt with by the compiler, 
if it's C or C++ or the interpreter, if it's say, Python. 
So we are not gonna have to worry about this level of detail so much, but it's 
important to understand the difference in the different types of storage elements 
and how they act and how fast they are, how slow they are and so on. 
Thank you. 
[MUSIC]

[MUSIC] 
This lecture will talk about the software side a little bit. 
Specifically how the software is processed before it's actually executed in 
the micro-controller. 
So key here is that the code that you actually write isn't 
literally processed by the micro-controller. 
It's not executed directly. 
It has to be processed first [COUGH] compiled or interpreted and 
then it's processed. 
So we'll talk about that.

Start transcript at 32 seconds0:32


Software translation. 
So, in the end, a micro-controller or 
CPU as we're calling right here, micro-controller, it understands. 
It doesn't understand C, or C++, or Java, or 
Python, or any of those languages that most humans program in. 
It understands its own machine language. 
So take an Intel processor. 
It understands Intel machine language, X86 machine language it's called. 
So different processor families understand their own machine language. 
Now, machine language is basically a set of really small simple instructions 
encoded in binary, zeroes and ones. 
So if you ever look at machine code directly, all you see are zeroes and ones, 
or typically people, when they view it, they look at it in hex editor. 
So they see zeroes and ones represented in hexadecimal.

Start transcript at 1 minute 19 seconds1:19


But, it doesn't look too readable. 
Basically, it's a string of characters.

Start transcript at 1 minute 26 seconds1:26


Zero through nine, and a through f, right? 
And you just see them in pairs. 
So it's not easily readable but that's what the machine actually executes is 
this machine code, which is an encoding of very simple instructions. 
Add, subtract, multiply very basic instructions. 
Now above that [COUGH] is what's called assembly language. 
Now assembly language is basically a one to one mapping from the machine code 
that's actually executed to a pneumonic, a simple pneumonic that a human can read.

Start transcript at 1 minute 54 seconds1:54


And now, it's not easy to read, but it's easier than the zeros and ones. 
So, instead of having a sequence of zeros and ones, 
assembly code will say add R1, R2, R3. 
Something like that. 
So that's readable. 
But still it's very low level. 
These instructions are very simple. 
You can't have four loops, or 
any of the common constructs that you have in programming languages. 
You can't use any of that, these are very simple instructions. 
So assembly language to machine language they are one to one mapping, right. 
You have an assembly instruction, 
it is exactly equal to a machine language instruction. 
So it's very simple, but at least it's readable. 
It's in some sort of English like format.

Start transcript at 2 minutes 31 seconds2:31


So you can write in assembly language, but 
it's hard and we're certainly not doing it in this class. 
People do it sometimes for 
certain purposes but we're not doing it in this class. 
What we'll work with are high level languages, 
what we'll call high level languages. 
The commonly used languages of C, C++, Java, dot dot dot. 
Python, which is what we're gonna look at. 
We'll focus on C, C++, and python, 
but there are many high level languages that people program in. 
So these are much easier to use. 
They give you the regular programming constructs that programmers are used to. 
Loop constructs, variables, structures, objects, things like this. 
So, those languages, high-level languages, are what we are actually going to code in. 
But, that's not what's actually executed. 
The machine language is what's actually executed. 
So, this high-level language, that you write in, 
it has to be converted into machine language before execution. 
So all the software that you write in a high-level language has to be translated 
into machine language, into the machine language of the micro-controller 
before you can actually execute it. 
So there's always that process. 
You're gonna write the code, then you're gonna do the translation and 
then it gets executed.

Start transcript at 3 minutes 38 seconds3:38


Now there are two ways that this can go. 
Depending on if it's a compiled language or an interpretive language. 
So compiled language, what happens is compilation happens where the language, 
the instructions, get translated into machine code, before execution, one time. 
And you get what's called an executable at the end, which is basically the machine 
code and plus some extra data, but essentially machine code. 
And this executable is what is run every time you run the code. 
So the compilation, the translation from the high-level language to the machine 
code happened one time before you executed it, and then 
every time you execute it after that, you don't have to do that conversion, okay. 
So compile languages include C, C++, Java halfway. 
There are other languages too that are compiled languages. 
So when we work with the arduino, we'll be working in c++ essentially. 
So that's a compiled language. 
So this translation, this compilation process, it happens once. 
It realistically happens many times because you compile it and 
then you realize you had a bug, and you fix it, compile it again. 
But essentially you finish compiling it and once you're done and 
it works, then you never compile it again. 
You just execute it, okay. 
Now, as compared to compilation, there's also interpretation. 
So you can have an interpretative language like Java, Basic, Visual Basic. 
Python is an interpretative language, or a scripting language but 
it also interpretive language. 
So in interpretive language, what happens is the instructions, 
the Python instructions I say, are converted into machine code at runtime, so 
every time you execute that code, you have to convert the Python into machine code, 
unlike the compiled language, right? 
Compile language, you compiled it once and you got the machine code, and 
then every time you executed it, you didn't have to compile again. 
But with interpretive languages, you have to compile every single time.

Start transcript at 5 minutes 27 seconds5:27


Or you call it an interpretation, but its' the same thing. 
You have to convert into machine code every single time.

Start transcript at 5 minutes 32 seconds5:32


Now there are advantages and disadvantages. 
The disadvantages is that it's slow. 
Compared to compiled code, it's slow because you 
have to do that whole conversion from high-level to low-level every single time. 
But it has a lot of advantages because it allows you, 
as a programmer, it relieves you of certain burdens. 
So certain things you, the programmer doesn't have to think of because 
the interpreter will deal with them. 
So, for instance, just as an example let's say in C, you're using a variable, 
you're defining a variable, an integer, right? 
In C if you want to use an integer, you have to declare that integer, 
you have to say int X, let's say. 
And you have to put that at the top of your code so 
the compiler can know he needs an integer in x, right? 
With an interpreter, like with a Python language, 
you don't have to declare x as an integer. 
You can just start using a variable called x. 
And the interpreter will figure out, oh I think this, he means for 
this to be an integer. 
I'll refer to this as an integer. 
Or, if it sees you're using the variable differently it'll make it a floating point 
or something like that. 
But that's a burden that the programmer no longer has to deal with, right. 
The interpreter at run time can figure out what the type is 
rather than you as a programmer having to deal with it. 
So interpretive languages do have the advantages that they 
are generally easier to program in, but they are slow. 
Thank you. 
[MUSIC]

[MUSIC] 
So this lecture, we'll talk about a comparison between Python and C, C++. 
Because Python is what we're going to be using with the Raspberry Pi. 
C, C++, we'll be using with the Arduino. 
Also we'll talk a little more detail just to understand the contrast. 
We'll talk about the tool chain, the software tool chain. 
All the tools that go into taking a high level piece of code, and 
getting the eventual machine code. 
We'll just look at that whole picture, 
cuz it ends up looking a little different for one versus the other. 
So, Python is an interpreted language. 
It's a scripting language, but that's also an interpreted language. 
It's high level language. 
It's easier to work with, because it's interpreted. 
So there are certain things the programmer does not have to deal with, 
like the type of variables. 
Is it an integer, is it in floating point, is it a string, 
you don't have to worry about that in Python. 
Python figures that all out based on how you use the code, ow you use the variable. 
So at run time, while it's executing and 
doing an interpretation, it can figure that out. 
Other things too, like memory management, in C, C++ you have to deal with that. 
You have to say, look, I need more space. 
There's a function called malloc, you can allocate more space, 
I need more memory for this variable. 
Python, you don't have to say that, it'll just make it for you,right. 
And when you're done with it, it'll get rid of it. 
So where in C you, have to make it explicitly, and you have to, 
as a programmer, have to know oh, now I'm done with it, let me free that memory. 
So there are a lot of these burdens, these programming burdens, 
that you don't have to deal with in a language like Python, 
because the interpreter is there take care of it for you at run time. 
Now comparing that to C, C++. 
C and C++, they're related languages. 
Actually, C is Is a subset of C++. 
So C came first, C++ came second. 
C++ is a super set, so C++ does everything that C does. 
So if you have a C++ compiler, it'll compile any C code. 
But C and C++ are compiled languages. 
So you write the code, you compile it once, and then you get an executable, 
which is machine code plus extra information. 
And you only execute the machine code. 
You don't have to do the interpretation at run time. 
So as a result C, C++ programs are generally a lot faster than Python 
programs, but the programmer has to deal with a lot more details. 
Now, dealing with a lot of details is hard. 
But when it comes to embedded systems, it's often useful because 
sometimes, not just sometimes, often the programmer, an intelligent programmer, 
can write code more efficiently than the Python interpreter can. 
Okay, so the programmer, knowing something about what the behavior they expect, 
they can write their C, C++ code in such a way that it runs 
a lot faster than the Python interpreter could ever predict, 
cuz the Python interpreter, it's dumb compared to a human, right. 
A human can know something more about the context in which the software is 
being used. 
So in C and C++ are commonly using embedded systems. 
Outside of embedded systems, you see them used less. 
Maybe Java is favored, or something like that. 
But because of the level of control that you get with C, C++, 
they are much more commonly used in embedded systems.

Start transcript at 3 minutes 18 seconds3:18


So compilation, this is what compilation looks like roughly. 
At the top, you've got, say, 
some regular C code, and actually that code is pretty generic. 
You can have a = b + c in any number of languages, Java, Python, 
they look all very similar. 
Except for the semi-colon at the end, that could've been Python, right? 
So you get the high level language at the top. 
And in the end, you wanna get what you see at the bottom, a sequence of zeros and 
ones that represent the instructions. 
So, what happens is if you look at that top instruction, 
it's actually broken down into a set of smaller steps, of smaller behaviors. 
So that instruction a = b + c, it's not just an add instruction, 
it's not just an add that'll be performed. 
First you gotta get the b variable, you gotta get the c variable, you gotta add, 
and then you gotta put the result back. 
So, maybe b and c are in memory somewhere, and a has to go to memory. 
So first, you gotta load a from memory, or load b from memory, rather. 
Then load c from memory. 
Then do the add, then store the result back in memory for a. 
And that's why you got four instructions in there in the middle. 
You got four what you call, assembly instructions. 
So the compiler will make assembly instructions. 
The lw is load word, so it'll load b into memory, then the next 
lw loads c into memory, specifically into the registers, r1 and r2. 
Then the add takes r1 and r2, adds them, put the results in r3. 
And then that last instruction, sw, store word, that takes what's in r3 and 
puts that back into memory, wherever you want a to go. 
So that one high level instruction breaks down to 
four simpler assembly level instructions. 
And then the assembler takes each of those four instructions, and 
converts it into a sequence of zeroes and ones. 
So you can see, at the bottom you see actually one instruction, 
just the add instruction. 
But presumably, you would have four instructions, four sequences of zero and 
ones just like that, to correspond to each one of the four assembly instructions. 
So that's the process of compilation, a very simple version of it. 
But you take the high level language, in the end, you get a sequence of zeros and 
ones that represent the instructions that need to be performed. 
And those zeros and ones are what get interpreted by the microcontroller. 
So this is a high level view of your standard tool chain, software tool chain. 
A tool chain is basically a term that is used in embedded systems a lot, and 
in IoT devices a lot. 
It describes the sequence of tools, of software tools, 
that you have to use in order to convert a program 
that you code into an executable program on the platform. 
So, if we look at this picture, we start with the host up at the top left. 
The host is laptop, desktop, 
whatever it is that you're actually writing the code on. 
So, you write you code on the host using some text editor, 
it doesn't really matter which one. 
Then, and this is actually a compile tool chain. 
So you write your code, let's assume it's C, the C code comes out of the host, 
goes into a compiler. 
So the compiler, actually I should have said here, 
this is what's called a cross compiler. 
So a cross compiler is a compiler, it takes the C code, and 
coverts into an assembly code, okay. 
But the assembly code is for the target platform. 
So the target platform is whatever microprocessor you're targeting. 
So let's say I'm using an Arduino, right? 
The processor on there is gonna be an AVR ATmega processor. 
So the compiler that is a cross compiler, it'll compile and 
make assembly code that works for that AVR ATmega processor.

Start transcript at 6 minutes 40 seconds6:40


So the compiler makes that, then that code goes to an assembler and 
gets an object file that's generated, which is actually machine code. 
Again, for the target platform, for the AVR ATmega whatever it is. 
And so the OBJ file, the object file, that has the machine code plus extra debugging 
information and other assorted information in there, but it has the machine code. 
Now, you'll notice there's a path on the top from the host into the assembler 
assembly code. 
You could write assembly code directly. 
So you could write C code, which is what we'll do. 
You could also write assembly code directly. 
We will not do that, but you could, 
and that would get merged in at the assembly phase. 
So then once you get the object file, 
the object file, that describes all the code that you wrote. 
But remember that we're using library functions all the time. 
And we haven't done this yet, but 
in our code, you always wanna use library functions to handle complicated tasks. 
Now, library functions are really just functions that are prewritten, but 
you didn't write them. 
You just call the function. 
You just write the name of the function, and that code gets executed. 
So, all those library functions have to get integrated into your program at some 
point, and that's what the linker does. 
So the linker, we don't see this in the picture, but 
the linker, it has access to all the libraries. 
And the linker basically takes the library's code and 
inserts it into your code at the appropriate places. 
It creates links between your code and the library code that you use. 
And then the output of the linker is gonna be some executable program. 
Now, the standard path that we're going to use is from the linker to the programmer, 
which then goes to micrprocessor. 
So the programmer, what that does, is it takes the executable code and 
copies it, writes it from the host machine onto the microprocessor, 
usually into the flash memory of the microprocessor. 
Because in order for the microprocessor to actually execute the code, 
the code has to be sitting on there on its memory. 
So that's what the programmer does, and that actually goes on via USB cable for 
us, right? 
The programmer will take the code, send it across the USB cable, and 
write it into the target, say Arduino for us, or Raspberry Pi, or whatever it is. 
So that's the programmer. 
There can also be another path, a debugging path, 
where if you're using a debugger, which is a little more sophisticated than what 
we're going to deal with, you can take the executable and write it into the target 
platform and write debug code in there too, and control it during execution. 
You can set break points and things like that. 
We won't cover that right now.

Start transcript at 9 minutes 1 second9:01


Thank you. 
[MUSIC]
[MUSIC] 
In this lesson, this lecture will talk about operating systems a little bit. 
What an operating system is? 
Now, they're not always present in IoT devices and in fact with 
the platforms we'll be working on, we'll be working with Arduino and Raspberry Pi. 
With Arduino you do not have an operating system. 
It's really too slow to support that. 
But Raspberry Pi you do, typically. 
So, we'll talk about the role of an operating system and 
an embedded system and an IoT device. 
You may or may not need it. 
So an operating system is an extra layer in between the program, 
your application code, and the actual hardware. 
So generally say we're working on right. 
There's a user at the top, whose using some application, right? 
By application we mean the actual program, right? 
So you've compiled the program and that application, that's the application code. 
Do we know that application code would connect directly to the hardware. 
So it'd go straight from the application to the hardware. 
No operating system at all. 
And the application directly controls the hardware. 
So it signals high and low, and so on. 
But in say RetroPie or more complicated IoT device, you would have something 
like what you see here where the user attacks the application. 
The application code actually may not directly connect to the hardware, 
it communicates with the operating system. 
So, it makes calls from the operating system and it's requesting hardware 
service and then the operating system manages the hardware most directly. 
So that's where an operating system fits in, in the picture. 
That the code that you write and 
compile the application code, that interfaces with the operating system and 
the operating system deals with the details of interacting with the hardware.

Start transcript at 1 minute 56 seconds1:56


So it manages other programs. 
So one thing about an operating system is that it allows you to have not only 
one application but many applications. 
So you can run lots of different applications at one time, and 
the operating system itself manages the hardware. 
So it gives them turns, lets them take turns, and stuff like that. 
And you see this in standard operating systems like Windows or in iOS or 
something like that, you run typically on a laptop, desktop you run 
many programs at one time and the operating system allows you to do that. 
Right? Without an operating system you can only 
run one program at a time.

Start transcript at 2 minutes 30 seconds2:30


So, you can execute a lot of programs together and when you're 
executing them together remember that they're not actually executing together, 
they just seem like it. 
So it's really alternating but very fast, faster than a human would really notice. 
So it looks like they're all running at the same time.

Start transcript at 2 minutes 44 seconds2:44


A nice user interface so often, 
now, how nice a user interface really depends on the operating system. 
If you look at a desktop or a laptop Windows, iOS, Linux, 
something like that, they will have a very nice user interface. 
Graphic user interface, GUI, you can double-click on something. 
Double-click on a file, it'll open it up, that sort of thing. 
That's a full-on operating system. 
The operating systems that you find in an IoT device, they're much smaller and 
stripped back. 
They're not going to have, not likely to have any graphical user interface or 
anything like that, but they will have a user interface, a command line. 
So if you ever use a Windows command line prompt, or iOS you use a terminal window, 
Linux you use a terminal window, 
something like that, I call that a nice user interface. 
It's text-based, but it's nicer than not having it. 
So there's a user interface that's provided of some kind. 
And it needs processing power. 
So one thing about operating systems is that operating system itself 
is a big program, right? 
It's a big program that's running in addition 
to the actual programs that you wanna run on your IoT device. 
So, it's gonna consume clock cycles, right? 
There are some clock cycles that are spent doing operating system tasks, right? 
Some memory that's spent storing the operating system data. 
Things like this. 
So, the operating system itself takes up resources so 
you have to make a decision whether you need one or not. 
Because it's gonna cost you resources, which means cost you money. 
It slows down the system because while the processor is working on the operating 
system, doing executing the operating system code, 
it can't be executing your actual application. 
So it slows things down. 
And so as a result, 
when you use an operating system, you generally need a faster processor. 
That's why, if you look at an Arduino which is running at maybe eight megahertz, 
something like that, usually don't support an operating system with that. 
But if you run Raspberry Pi and you've got like one gigahertz, 
then it's okay to support an operating system, 
because it has enough clock cycles that you can do that.

Start transcript at 4 minutes 43 seconds4:43


A little example of an operating system that actually I had a group 
do something like this a project like this several years ago. 
Where they wanted to have a control car with a camera. 
So it's an RT car controlled through the web. 
So you can go to a laptop, desktop whatever, 
anything that has Wi-Fi, go to a phone. 
Open up a browser and connect to the car. 
And the car has on it a camera and it's own web server, right? 
So you can cancel this web server and control the car to its own web server. 
So as an interface, it looks roughly like what you see down here. 
On the one side, there's the picture, the image, of what the car sees. 
So that's actually coming from the car's camera. 
So like I said, the car on it had a camera. 
It was connected to a web service. 
So, the view from that camera would be streamed through Wi-Fi over to whatever 
your browser device is, right? 
Then, it would have buttons forward, back, left, right, to control the car. 
So you'd click forward, it would move the car forward. 
Click back and move back, and so on. 
So you can take commands to drive the car, through Wi-Fi, to the car's web server, 
and that would directly control the steering and the motors and all that.

Start transcript at 5 minutes 50 seconds5:50


So in a system like this, it is useful to have an operating system 
because there are so many things going on at one time. 
So the car is controlled over the Internet, with Wi-Fi generally. 
The car has its own web server which has an actual URL address.

Start transcript at 6 minutes 5 seconds6:05


And the web interface allows you to control the car and 
see the images and so on. 
Also has an auto brake feature to avoid collision so,

Start transcript at 6 minutes 13 seconds6:13


it'll stop automatically regardless of what your controls are. 
If it sees, if it senses something in front of it, it will stop. 
But the idea that it generally has a lot of tasks to do, a lot of things to do at 
one time, in that type of situation an operating system can be very useful. 
Thank you. 
[MUSIC]

[MUSIC] 
So this lesson, this lecture we'll talk about, 
a little more about operating systems and what they do. 
We'll talk about tasks and process support really, about how 
operating system support multiple tasks executing at the same time and 
how that's useful in more complicated IoT devices. 
So multiple tasks. 
So this is actually going back to the last lecture where we were talking about 
this embedded system that I had my students make. 
Actually, IoT device, it was a web controlled car. 
And through the Internet, you could go to a browser, open up a browser and 
remotely control this car. 
So you could view what its camera was seeing on your web browser. 
Also you could hit some buttons forward, back, left, 
right to control the motion of the car. 
And so the car itself has its own processor and a web server running on it. 
A Wi-Fi web server running on it and a camera and 
it could manage all these tasks. 
These tests could be managed remotely. 
But the idea is that on that car, on its microcontroller, 
it had to do multiple things at once. 
There are multiple tasks that it had to handle in order to do this that it had to 
handle at the same time. 
So let's look at some of these. 
One thing is sending video data. 
So this car, if you were connected to it, it was constantly sending video data 
from its camera to your phone or whatever your web browser was running on. 
So, it had to do that. 
Send video data all the time in the background, 
then servicing the motion buttons. 
So in the interface, you could go to your web browser. 
Hit the forward button, the car would move forward. 
Hit the back button, the car would move back, and so on. 
So the car, its microcontroller has to service those buttons. 
So even while it's playing the video at the same time, 
if somebody presses forward, it's got to respond. 
Go forward, go backward and all that. 
So, it has to do that. 
Detecting obstacles. 
So this thing has an auto brake feature, so 
it has to be constantly detecting obstacles. 
So if there's an obstacle in front of it, it will brake. 
Regardless of what the commands are, that would get overwritten. 
So, it's gotta be constantly detecting obstacles while it's showing its video and 
while it's responding to the control buttons. 
Also, auto brake. 
So that's another thing has to happen concurrently, you can be showing video. 
Somebody can be pressing buttons, you can be responding to them. 
But if you detect an obstacle, you gotta brake, automatically. 
Concurrently, with the video and with everything else. 
So multiple tasks have to be performed by this device. 
And in a situation like this, it is helpful to have an operating system to 
handle the multiple tasks to help you handle them. 
So I just talking about how they can happen together, you get detect and 
auto brake cannot occur together. 
So if you detect, then you auto brake. 
They don't happen together, but everything else can happen concurrently. 
So in a situation like this, 
you need to have multiple things running at the same time. 
Multiple tasks being performed at the same time. 
Now you could, as a programmer write a relatively complicated program that does 
all these things at once and checks. 
While you're sending video data, it's also checking to see if a button is pressed, 
it's also checking for collisions and so on. 
But an operating system makes this easier, because you can write each one of these 
tasks as a separate task and then let the operating system inter-mix them. 
You can write one piece of code that just sends video data. 
Another piece that serves as motion buttons, another that takes obstacles. 
Another one that does auto brake and then you can give them the operating system and 
the operating system will make sure that they all run at the same time. 
You don't have to as a programmer, you can write things separately. 
You can write the sending video data code separately from the servicing motion 
button code and the operating system can interweave them for 
you and that relieves a lot of burden for the programmer. 
So the main job of an operating system is to support a process or 
a task abstraction. 
I'm not gonna differentiate them too well right now, 
but let's just talk about processes. 
A process is an instantiation of a program, so a run of a program. 
So if you got a program, PowerPoint, let's say, 
which is running on this machine right here. 
When you're running PowerPoint, it has a process running. 
And so say on my machine, I open PowerPoint ten times, 
then I've got ten different processes all in different instantiations of PowerPoint. 
So a process is like a runtime instantiation, 
execution of a program and you can have many of them at the same time. 
So the process has to have access to the resources of the processor, the CPU. 
Meaning, the microcontroller itself, the memory. 
A process needs to read from memory and write to memory and so on. 
Other resources, the timers, the ADD converters, the network access, all that. 
The processes all have to access that, but they have to share that. 
So there might be only one ADD converter in this microcontroller and 
there might be three processes that need to use the ADD converter. 
So the operating system, part of its job is to manage all these resources to make 
sure that everything gets used fairly, one at a time. 
So if all three processes wanna use this ADD converter, 
the operating system essentially put them in a line. 
Says, okay, you were first, so you go first. 
You're more high priority, so you go second. 
The operating system's job is to manage all these resources. 
The memory and the CPU and I/O, ADD converters. 
All the resources in the hardware, the operating system takes care of that and 
makes sure that the different processes can use them in a fair order. 
Thank you. 
[MUSIC]

 Explain the use of networking and basic networking hardware


 Describe the structure of the Internet
 Describe the meaning of a “network protocol"
 Explain MANETs and their relation to IoT

“Mobile Networks Prep for the Internet of Things”, Stephen Lawson, IDG News Service, Feb 18, 2015

“Security and the Internet of Things – are we repeating history?”, CSO Jul 13, 2015
So networking is clearly an important part of internet of things, 
internet is right there in the name. 
So in module four we'll talk about networking in general. 
We'll talk about networks, network protocols, we'll focus on the internet 
because that's the network to which we'll most likely be connecting. 
Also we'll talk more specifically about mobile ad hoc networks. 
Mobile ad hoc networks are magnets, sre smaller networks of mobile devices, 
which IOT devices commonly are, and they're ad hoc, 
meaning they're changing all the time. 
Things move in them, things move out of them, 
and that's inevitable when your using mobile devices. 
The configuration network can change very dynamically. 
So we'll talk about magnets, and how there are different protocols used for 
magnets, and how you design and 
implement an interface component with networking in mind. 
[MUSIC]

[MUSIC] 
In this lecture, we'll talk a little bit about networking. 
Networking is a central feature of Internet of Things. 
We'll talk about why it's needed, how it's helpful. 
Also we'll start talking about general structure of networks, 
sort of the broad categories of networks.

Start transcript at 27 seconds0:27


Why is networking needed? 
Well, it enhances devices. 
It makes things better, let's say. 
So it enhances features by giving you access 
to computational complexity outside of the local device. 
So if the Internet of Things device is a camera or a phone or 
a car or whatever it is, the fact that it's connected on a larger network 
means that from that smaller device, you can access much more powerful servers, 
much bigger databases. 
You can access all that through whatever the device is. 
And having access to all this computational power and 
all this data can it be used, 
can it be leveraged to enhance a lot of devices and improve their features. 
So for instance cars, let's say cars an Internet of Things things device. 
If they can communicate with each other on a network to improve traffic flow. 
So wouldn't that be great if cars were all talking on a network and 
they could plan their own routes, and 
consider the fact that other cars were planning their own routes. 
They could collaborate together to make the flow fast. 
Which by the way is possible and probably will happen in a decade or so, 
but it takes a while to get those things worked out. 
But, that's probably going to happen, 
there's no reason why that can't happen and that would be very useful. 
So, it's an example where you're enhancing the feature of a car by using the network. 
And so they can now talk to each other, they can talk to a centralized database 
and get mapping information and things like this.

Start transcript at 1 minute 52 seconds1:52


Online game play, we all know about that, or I do. 
So, there are a lot of games, in fact there is a large segment of games 
where you can't, there isn't much to play by yourself. 
You have to play online, right? 
Call of Duty for example, or Destiny or whatever. 
Those games, you play them online and it opens up a whole new world to you, 
literally right? 
Many new worlds. 
You can connect to different people And 
do all sorts of extra things that you couldn't do locally on one machine. 
Accessing media libraries. 
Netflix for instance, right? 
Or Amazon instant player. 
Whatever library you're using. 
You can only access those. 
Maybe you're using a TV, as your Internet of Things device. 
But it alone doesn't have the library of all movies ever created, right? 
You have to connect through the network to Netflix database, or whoever it is. 
So networking is useful, 
it's very useful, it enhances abilities of any particular device. 
Now, the communication between an Internet of Things device and 
the main network is usually, most commonly, 
follows a client-server model that we're showing here. 
So, the client would be the Internet of Things device. 
That's a smaller machine,relatively less powerful machine, 
connected to some server and 
you see that in the middle of the server it is guarding, protecting some resource. 
Giving access let's say to a resource. 
So you see the resource over there on the side. 
The resource can be any kind of resource, maybe it's a web server. 
And the data for the web pages is in that resource or something like that. 
Then the server gives access to that resource. 
So the client which might be the Internet of Things device, 
that thing is communicating, making requests of, 
the server to get whatever the appropriate information is. 
The server then manages the resource. 
So it handles the request, 
gets whatever it is that is needed from the resource, and sends it back in 
the form of a response to the client which will be your Internet of Things device. 
And maybe you see the web page or you have whatever data you were looking for or 
you get the movie that you wanted to look for, or something like that. 
So this client-server model is very common. 
The client is generally less powerful. 
That is, it's a smaller machine, literally less power. 
It's slower. 
Where the server can be a very large, cloud-based server, very powerful, 
plugged directly into the wall, has lots of power, cooling fans, whatever it has. 
So, and the resource can be whatever you want, a bank of disk drives and 
some machines, whatever you want. 
So this is typically the model that you see Internet of Things devices 
communicating with the network through. 
So, we're gonna talk about three really broad classes of networks right now. 
First, a LAN, local area network, stands for. 
And a local area network is just a relatively small network. 
Usually spans a building, a campus, 
a campus might have just one local area network, a floor of your building. 
You've had experience with local area networks I'm sure. 
And typically the way you access these networks is either through the wall, 
through a wall socket, an ethernet jack in the wall. 
I see one right here. 
Also Wi-Fi routers. 
I see one in here too right. 
So we're familiar with those. 
Local area network is commonly for a building or something relatively small. 
Now, on the other side of that, there is a wide area network, the other extreme. 
Wide area network, the best example of that is the Internet itself. 
That's an extremely wide area network. 
And a wide area network is just a lot more complex than a local area network. 
There is a hierarchy of machines that are communicating together. 
So it's really, a wide area network is really a different class of 
network than a local area network, has different protocols involved. 
And Internet is basically the wide area network that we'll be talking about. 
Now in addition to this we have Mobile Ad Hoc Networks MANET. 
These are actually important to Internet of Things components because 
Mobile Ad Hoc Networks are, they're composed of largely mobile devices.

Start transcript at 5 minutes 36 seconds5:36


Thus the term mobile. 
And a lot of Internet of Things devices are mobile. 
And it's an ad hoc network because it reconfigures itself constantly. 
So that is maybe an Internet of Things device of 
cell phones let's say comes into range of the network then it joins the network. 
But you continue walking and you walk another block and 
you're outside of the network. 
So the network is reconfiguring every few seconds, 
maybe something is walking into the network. 
Something's moving out of the network, it's very dynamic. 
So that's what a MANET is. 
And a lot of Internet of Things devices, 
are part of a network like that, of a MANET. 
And you need different protocols for that, 
you have to assume some of the things are mobiles, so power is a constraint, right? 
Cuz usually you're battery-driven if you're mobile. 
So they have a different class of algorithms for MANETS as well. 
Thank you. 
[MUSIC]

MUSIC] 
The internet is a wide area network, the wide area network, and 
that's generally the network that we want to communicate with eventually. 
So we're going to talk about the general structure of a wide-area network. 
These pictures are pretty high level, but they give you the general picture 
of what a wide-area network like the Internet would be, how it's composed, and 
what the different components are inside there. 
So a wide-area network, like the Internet, 
is a network, it's a combination of local area networks. 
So if you think about the Internet, it's very ad-hoc. 
There's no regularity, meaning like right now, if I wanted to, I could build 
a network right here in this building, and it would be added to the Internet. 
I could give it a name, and it would be part of the Internet. 
And so the Internet isn't one of these networks that's controlled and 
well-structured. 
Unlike the local area networks that you see at your place of work, 
or at a school, where you have some I.T. 
department, I.T. group, and they constrain how the thing is put in there. 
They say, look, every time a machine comes in here, 
you've got to register it this way. 
We only approve of this and that. 
And they put the equipment into the building for you, and all that. 
So it's very structured. 
But, generally, wide area, the internet specifically, 
is pretty unstructured, right? 
There is some minimal structure, there has to be, but it's fairly unstructured. 
So at a low level, at the leaf level, local area network level, there can be 
any number of different local area network types involved in the internet, 
just depending on what people want locally. 
So you start off with local area networks. 
You've got our local area network and 
you've got several hosts, Host one, two, three, and 
these hosts suggest confrontational devices that on the network. 
So basically computers or IOT devices. 
And they are all communicating with a component. 
Now in this picture we have a switch. 
It could be hub or a switch. 
A hub is a network component that has several input ports. 
We're assuming wired right now. 
This can also be all done wirelessly, but let's talk wired for a minute. 
It's got several input ports, input-output ports, like in this case, 
this switch has three ports, right? 
So you could have a hub there that has three. 
And any time a packet is sent on one of the ports it is reflected, 
copied to the other ports. 
So if host one sends a message to anybody, 
that same message is spit out to codes two and three. 
So both of them get the message. 
That's what a hub does. 
A switch is more intelligent. 
A switch says look, it looks at the packet header to see where it's going. 
So if host one sends a message to the switch and it looks at the destination 
message is host three, then the switch there is smart enough to know 
that that message should only be send to host three not to host two. 
So the switch is more intelligent about where it sends messages to, 
where a host is more dumb. 
But you got a host or switch somewhere in there that transmits data 
between the different input ports and output ports. 
So generally, LANs look like this.

Start transcript at 3 minutes 5 seconds3:05


Now, you can have larger LANs, which involve multiple protocols. 
So you see on the left you've got a LAN, 
on the right you've got a LAN, you can combine them with a bridge. 
The bridge can communicate different LAN protocols. 
So maybe you got these LANs and one group, 
one department in the University decides they want to use this particular protocol, 
another department uses another particular protocol, but 
they want their machines to communicate so they put a bridge in between. 
And the bridge basically talks both protocols and 
can do conversions between the two. 
So you can group together these LANs into larger LAN components, let's call them. 
It's not a single LAN any more, 
you can have multiple protocols that are glued together by this bridge.

Start transcript at 3 minutes 46 seconds3:46


Now, a wide area network is a set of these LAN's all put together with routers. 
So if you look at this network, this is by the way is a vastly simplified internet. 
But you got a bunch of LAN's, and they are all communicating to routers. 
And then the routers can communicate with each other to pass data. 
So, one LAN can communicate with a completely different LAN 
through these routers. 
So you notice every message is sent from one machine to another has to, 
has many hops, what are called hops. 
Has to go through several different machines before it reaches 
Is the destination. 
So if you want to go from one LAN to another, you might leave this LAN and 
go to this router, and then go to another router and another router and 
then finally back to the destination LAN and then to the host. 
So there is a sequence of hops, it is called routes, 
actually, of hops that you have to go through to reach your destination. 
And so with these routers, they are organized. 
This is very simple, it's only three, but and realities a vast hierarchy of 
these routers and they have intelligent protocols that determine where they should 
send the packet next to reach its destination most quickly and avoid flow. 
You don't want to have one router that receives too much data, 
maybe all the messages are running through one router, you'd like to spread out that 
data across the entire network, so that the one router doesn't get bogged down. 
So there are lots of protocols along those lines, and 
the internet involves protocols like that to level out the traffic. 
Thank you. 
[MUSIC]

So, we've been talking about networking. 


And we've been talking about the different components that you find inside networks. 
So I thought that since I had some of these components lying around the lab, 
I'd show you some of these and 
let you get a look at what they actually look like in the flesh. 
So first is the hub. 
This is an ethernet hub. 
These are hard to find. 
They don't make many of these anymore, but this is a hub. 
This is a four port hub. 
It's got four ethernet jacks. 
You can plug four things in. 
And it's very simple what a hub does. 
It receives a packet on one port and 
it just copies that out to the other three ports. 
So it's just a repeater in that sense. 
It's very dumb. 
And it's wasteful in terms of bandwidth, right. 
Because if you're sending a message to, sending a message from one, 
from this port to this port. 
It doesn't need to appear on these two ports, but it does anyway. 
So, there's extra traffic with a hub. 
A hub is very dumb and wasteful in terms of bandwidth. 
That's why you don't see them too much anymore.

Start transcript at 1 minute 8 seconds1:08


So that's the hub. 
Next up is a switch. 
This is a switch, it's a bigger switch than that hub. 
This switch has sixteen ports, instead of four that you saw in that hub, 
but you know the number of ports is variable. 
But this is smarter so what it does is it receives packets on, let's say it receives 
a packet on this port, it doesn't just send it out blindly to every other port. 
Instead it learns over time which ports are connected to which IP addresses. 
So it can look at the packet header, and 
determine which port it expects to see the destination on, and 
only send that message on that port, so if it receives something on this port, 
and looks to the header and says, oh, that device is on port ten, 
then it'll only send it out on this port and that saves bandwidth. 
So that's a switch.

Start transcript at 1 minute 56 seconds1:56


This is a router. 
This is actually a wireless router, wi-fi router.

Start transcript at 2 minutes 0 seconds2:00


And it's got some lights on the front. 
You've seen these, you probably have one at home, or 
you've seen them on the wall in your office building or something like that. 
This is a router. 
On the back, it's got an antennae, since it's a wireless router. 
On the back, again, it's got ethernet ports. 
[LAUGH] It's the same as the switch and the hub. 
One thing to notice about these three devices is that they are very similar. 
I mean their interfaces are similar. 
They're just a bunch of Ethernet jacks and some lights. 
Ethernet jacks and some lights. 
This one, Ethernet jacks and some lights. 
Now, this also has a wireless antennae because it's a wireless device, but, 
generally these look basically the same and they only differ in how they function 
and how they respond to the messages and where they reflect messages to. 
[MUSIC]

[MUSIC] 
So this lecture we'll talk a little bit about the internet and structure and 
we'll get into internet protocols. 
Protocols in general. 
We'll talk about what a network protocol is. 
We have to know a little bit about these. 
We don't want to go into detail in protocols. 
But you have to know they exist because the hardware that we buy when we make our 
IOT device, 
the hardware that we buy, we'll buy it matching a particular protocol. 
So we'll pick the protocol and pick the hardware to match that. 
So we need to know at least the existence of protocols and what they are.

Start transcript at 39 seconds0:39


So, internet structure is ad hoc, that is, it's very irregular, right? 
People can join the network, leave the network. 
I can open up a laptop in this room right now and 
suddenly it will be part of the internet, right, and people can send messages to it. 
And then if I shut if off, it is now temporarily no longer part of the network. 
So, the internet is very dynamic. 
Somebody can build up a new network right now, plug it into the wall, and 
bam, there's a new addition to the internet, and that happens all the time. 
It has an unpredictable structure, but it still has to work. 
Actually, it's pretty amazing that it works as well as it does, 
given the fact that it's so crazy.

Start transcript at 1 minute 14 seconds1:14


So it can be changed by anyone at any time, so you have to be able to send 
messages between this wide variety of network types, right. 
So you've got these LANs that maybe use different protocols, 
routers that are speaking different protocols, destination LAN, 
it speaks a different protocol. 
And so you've got this, 
you've got to be able to consistently send messages regardless of everything else. 
That means if I set up a host in my office, I set up a network in my office, 
that thing has got to be able to talk to some LAN on the other side of the world 
without knowing anything about the protocol of that LAN. 
Right? And 
without knowing only minimal about it, right? 
I don't know what type of protocol they're gonna use on that LAN. 
All I know is I wanna send a message to a machine on that LAN, right? 
So you have very little structure, but 
you still have to have some level of uniformity so that everybody can talk. 
So how is it possible to send bits, bits meaning messages, 
across these networks hop to hop through these different networks with different 
sort of different protocols essentially. 
So, we'll talk about these protocols, let's define them. 
Protocols are basically a set of rules, rules of communication. 
If we're talking about for 
network protocols it's a set of rules of communication. 
And there are a lot of rules. 
But generally, it's a set of rules, 
hopefully a minimal set of rules, which as long as everybody adheres to those rules. 
Everybody can communicate, okay? 
And you wanna make these rules minimal so 
that they're not a burden on the local area network. 
So you wanna give people who are building their local area networks as much freedom 
as you can as to how they design their network. 
But there have to be some protocol rules that they adhere to, some minimal rules 
which will allow them to communicate with all the other local area networks. 
Through the internet. 
So the internet has protocols associated with it, which 
if you wanna talk on the internet, your networks have to support these protocols.

Start transcript at 3 minutes 6 seconds3:06


Now just to give you some intuition about what a protocol is, 
it's basically something that you add. 
It usually involves adding data to a method. 
Okay, regular type of data to a message. 
So if you ever watch old movies, or cop movies, 
something like that and they're on the radio, and they say something. 
Something something something over, right. 
Over, they say over at the end of their message right? 
And as soon as they say over, somebody else can start talking. 
Right? And then when they're done they just say 
over and out, right? 
So this is a protocol. 
Cuz what it says is that every time you send a message, 
I don't care what the content is, I don't care what the words are. 
Just make sure that at the end of that message you say the word over, right? 
And no matter what the content of the entire conversation was, 
just make sure that at the end of that conversation you say over and out. 
As long as you follow those rules, everybody can talk. 
Because the goal of those protocols is, the radio protocols with humans talking on 
radio, is so that two people aren't talking over each other, right. 
You want to make sure that one person's talking at a time. 
So whoever is talking can keep talking until they say the word over. 
When they say that, the other person knows oh, now it's my turn, and 
they talk until they say over. 
So over's like passing the baton to the other person to talk. 
And as long as you adhere to those simple rules, it doesn't matter what you say, 
what the content is, you can talk with somebody else. 
Now there are limits to that, right, 
because there's no rule about how long you can talk before you say, over. 
So you could just talk all day and then finally say, over, and 
then you would be a bottleneck to the network and that would be a problem. 
So internet access has rules to handle that, right. 
There are time limits and things like this. 
But you get the idea. 
A protocol is basically extra data that you add, is represented by extra data 
you add to the message, like the word over or the word over and out. 
Right. 
There all kinds of rules that extra data that you put in there 
that are used to enable communication. 
So we call those, that a protocol, that's a set of rules that enables communication 
which minimally constrains the message. 
It adds a little bit of data to the message typically.

Start transcript at 5 minutes 4 seconds5:04


That's what a protocol is, and 
TCP/IP is the most common set of protocols for internet. 
In fact specifically IP stands for Internet Protocol and 
if you're using the internet, if you want your machine to talk on the internet, 
they have to use Internet Protocol. 
They have to adhere to the rules of IP. 
Now TCP/IP TCP is another protocol and that protocol is, 
it also is used in conjunction with the internet. 
So if you use the internet you're either using TCP or UDP, right?

Start transcript at 5 minutes 37 seconds5:37


And you're using IP. 
So I said TCP/IP it could also be UCP, UDP/IP. 
A Universal Datagram Packet, if I recall. 
Protocol, sorry. 
And IP. 
You put those together and that's internet. 
So you can do anything else you want, 
you can add all kinds of other data into the message. 
As long as you adhere to those protocols, you can talk on the internet and 
your machines can communicate with other machines on the internet. 
Thank you. 
[MUSIC]

[MUSIC] 
So we'll talk a little bit about protocols, network protocols, 
Internet protocols specifically and what their responsibilities are. 
We won't go into great depth. 
But we want to give you a flavor of what's contained inside these protocols and 
what they define. 
So what does the protocol do? 
An Internet Protocol, it does a lot. 
An Internet Protocol, meaning IP or TCP or UDP, they do several things. 
One basic thing is provide a naming scheme. 
Actually that's a very important thing. 
So IP, you've probably heard of an IP address. 
That comes from the Internet Protocol and 
it's a unique address that every network component has. 
Every component on the Internet has to have an IP address, and so 
each host and router gets assigned at least one of these Internet addresses. 
Now when you say least one, basically it should be one to every network adapter. 
But a particular machine can have many network adapters. 
By network adapter, I mean hardware interfaces to the network. 
So if you look at a laptop, you'll often have a wi-fi adapter, but 
you'll also have a wired adapter and a wired ethernet jack. 
You might not. 
Depends on your laptop, 
but you might have an ethernet jack where you can plug into the wall, right? 
So, you might have two network adapters there. 
Two ethernet Internet network adapters. 
So you might get two IP addresses, one for each. 
Usually you focus on one, but it's possible to have more. 
So, Internet protocol, one very important thing it does is it 
gives this naming scheme, this unique naming scheme. 
Every machine on the Internet has to have a different name. 
And now there are problems with this, right, 
because IP addresses are not that long. 
IP addresses are four byte numbers, 
four single bytes, so you've seen them referred to as these, 
let's see like 124.254.27.33. 
Okay, and they're four numbers separated by dots. 
So it's four numbers and each number can range from 0 to 255. 
So there aren't that many addresses compared to how many network 
components there are these day, because of IOT. 
There's so many things on a network. 
You need so many addresses. 
So there are a lot of challenges in dealing with that. 
We won't really cover those right now. 
But the idea is everything on the network has to have a unique IP address.

Start transcript at 2 minutes 22 seconds2:22


Also, these protocols provide a delivery mechanism. 
So what we mean by that is that whenever you send a message from one machine 
to another machine, you gotta go through a sequence of machines, okay? 
You've gotta define a packet, a chunk of data, and it's gotta be sent from machine 
to machine to machine because these machines are not directly wired together. 
They're not within radio range directly. 
There has to be a route taken, so it has to hop from one machine to the next. 
So these protocols define methods of doing routing. 
Of how you send a message through a sequence of machines to get to 
the destination you wanna go to, that's one important role. 
Another thing is that it defines the header. 
All right? 
The header and the payload. 
So by header, if you look at any packet. 
You can usually break it up into header and payload, maybe footer too, but 
let's just talk about header. 
So, payload is the actual data that you want to send. 
The header is the information that is sort of metadata. 
It's about the packet, but it's not the actual payload of the packet, 
not the important part of the packet. 
It's not the data you want to send. 
But it has information about the packet. 
Now generally the header information comes from the network protocols. 
So the data in the network protocol, that the network protocol uses, 
it gets put into the header, typically. 
So we'll look at that a little bit, here.

Start transcript at 3 minutes 38 seconds3:38


So yeah and like I said I brought this up last lecture.

Start transcript at 3 minutes 41 seconds3:41


Citizen ban radio, 
you say over at the end of talking and roger means data received and so on. 
So that would be called footer. 
So you say a message and then at the end of your message you say over. 
And that word over is actually added to the end of the message. 
So the payload is the text. 
So say I say something like, hello, my name is Ian Harris, over. 
Hello, my name is Ian Harris, that's the actual payload. 
And then the over is overhead, we call that footer because its at the end. 
But, text that you put, something that you add to the beginning you'd call header. 
And header and footer same thing a beginning and an end but 
its the same thing. 
Excess overhead data is required to help you adhere to the protocol but 
its not the actual data that you want to send.

Start transcript at 4 minutes 24 seconds4:24


So, these rules enable efficient communication. 
These rules, these header and footer rules, 
the data you put in them, you need that so that at the receiving end you know like, 
for instance, with CB, you know oh, I heard the word, over. 
That means I can talk now, right? 
So, in order to establish efficient communication, 
you need that information that's contained in the header and footer. 
And, for instance, with routing and the Internet, 
some of that information inside the header will be important for routing. 
Things like this. 
So, all the different functions that these protocols handle, 
they use information inside the header typically to do that. 
There are many different tasks that are performed by protocols, 
by network protocols. 
A lot of different tasks. 
And we can't go into details of all of those. 
But some of those are routing, you know, figuring out a route sequence of machines 
to send a packet through to get to its destination. 
Flow control, right? 
So making sure that you don't have a bottleneck. 
That all of your traffic isn't going through one router. 
That you spread it out over different routers so 
that you can get good traffic flow. 
Arbitration. 
Arbitration means when you have some kind of a network segment where 
only one packet can travel at a time and two packets want to travel. 
So say two machines want to send messages on this one piece of network segment 
at the same time. 
Then, somehow you have to arbitrate. 
You have to figure out which one gets to go first, right? 
So, there are rules for all these things, and 
all these rules are encoded inside the network protocols. 
So, the protocols define those rules. 
What do you do when two machines want to talk on the same wire at the same 
time, right? 
The set of rules, that's called network protocol. 
When you want to send a machine message from A to B, how do you figure out what 
the next node is that you want to send your message to, right? 
That's defined by the protocols and so on. 
So, these protocols are very complicated in general. 
And because they are so 
complicated, what people have done, is they've divided the protocols into layers. 
So, OSI, open system interconnect model, OSI model. 
It presents what's called a protocol stack.

Start transcript at 6 minutes 22 seconds6:22


Classification protocol. 
So it takes all the things that these network protocols do and 
it divides them up. 
So routing is one layer. 
Flow control is another layer. 
Arbitration is maybe another layer, right? 
It just separates them. 
Now, all these layers have to be taken care of, 
but the separation is generally good for coding frankly. 
Because writing one piece of code that handles all those complex tasks at once, 
it would be one nasty piece of code. 
So it makes a lot of sense to cut that code up, to separate the responsibilities 
across different layers, and then write different pieces of code for each layer. 
And then let the different layers of code work together. 
So that's what the OSI model does. 
It proposes a set of layers. 
Now the Internet uses a similar set of layers, maybe a more compressed version 
of that, but definitely the idea of taking all these complicated tasks and 
dividing them amongst different layers of protocols 
is a good thing to reduce the complexity and make the coding more manageable.

Start transcript at 7 minutes 21 seconds7:21


So each layer has it's own responsibilities, and 
each layer uses different data. 
So different data usually in the header, right? 
So for instance, if you're looking at routing, there's a layer that's doing 
routing, you're gonna need to use routing information in the header, and 
actually place routing information in the header. 
Where, if on the other hand, if your working on float control, right? 
And flow control's maybe at a different layer, then flow control doesn't 
necessarily need to know the routing information, not the details of it. 
But it might need to know the capacity at a node, 
how many messages can a particular node take at one time. 
So that would be different information that also might be present in the header, 
or something like that. 
So each, or not in the header, but they definitely, 
each layer uses different types of information to do its job. 
Thank you. 
[MUSIC]

[MUSIC] 
This lecture we'll talk about what a protocol stack is, 
really define that term. 
We will go into a little bit of detail, 
little bit of information about how a protocol stack is defined. 
Now remember though, that in practice certainly in this specialization, 
in practice you're not gonna be writing a protocol stack, 
making a protocol stack, but you can use a protocol stack. 
So you at least would wanna know what this term is because it gets 
thrown around, right. 
If you want to make a new embedded system you say, well I need to be networked, 
you know Internet, which protocol stack am I going to use, right? 
Which implementation of the protocol stack will I use? 
You need to know what that term means, 
because it gets used a lot when you're actually coding things. 
You should know basically what it means. 
So not all the details that I'm talking about will be important in the long run, 
but you should see it all at once because it'll 
give you a better context about what you're using.

Start transcript at 1 minute 3 seconds1:03


So OSI Layer Concept. 
So the idea about taking these protocols and making a stack, 
different layers of protocol, is that you've got these multiple layers, 
different tasks, different networking tasks that you have to handle. 
These tasks are associated with different layers of protocol stack. 
And each layer is implemented usually in software, 
actually some of the lower layers are implemented in hardware. 
So some are in hardware, some are in software. 
The difference doesn't matter 
too much to us right now certainly the top layers are in software, but 
the idea is that a message, say you want to send a message okay. 
So you make this message, we got our picture up here, this message M. 
M is our message, and that's maybe just the pay load okay. 
That is what the data we want to send. 
So then that is basically an input to a layer. 
Let's talk about the first layer, 
layer R let's say is the first layer, the top layer. 
So that goes into it and into the code, so that code takes the message, 
it makes some kind of a decision, whatever decisions are made at that layer, and 
then it puts the results of that decision into the header of the message 
producing a new message, M prime down there, which is now bigger. 
It has whatever was inside M and 
it has additional header on the outside of that, right? 
So at every level every level that happens. 
So, the first level, for 
instance here, let's see this level is performing routing. 
So the goal of this level is to take a message and figure out a sequence of 
machines that it will hop through to get to its destination. 
So at this level it takes a message, it finds the route, 
it says okay you need to go through machines A, B, C, and D. 
All right, that sequence. 
So it can take a sequence, that whole sequence of nodes, 
put that into the header of the message, and then output this new message, M prime. 
Which is the same old message, 
but now with this extra routing message contained inside the header. 
So that's the general idea, that at every layer the code, or the hardware, 
or whatever it is that's implementing the protocol, will make some decisions like 
routing information, arbitration information, flow control information. 
And then the results of that it'll put into the header, or 
some of the results, it'll put directly into the header, 
and you'll get a new message out, which is bigger than the original one, right? 
Which now has its new header data. 
This is on the sending side.

Start transcript at 3 minutes 14 seconds3:14


So this is the idea, and you have a stack of these layers. 
So that's what they mean by protocol stack, you have layer after layer and 
they call that a stack.

Start transcript at 3 minutes 23 seconds3:23


Now, encapsulation is used to mean that the protocols 
they're separated from one another, in some sense. 
So, each layer, each protocol layer is separated. 
So, all these different tasks that need to be performed, say routing. 
That is mapped to a particular layer. 
That is performed by the protocol information stack at this layer and 
other layers do not have to deal with it. 
So it is encapsulated, it's separating the different layers. 
And the whole point of that is to make it simpler to understand and 
also to write code. 
All right, so as a programmer, if you're dealing with the layer that deals with 
routing, then that's all you have to think about, you don't have to think about flow 
control because flow control is dealt with at another layer. 
So that's what encapsulation generally means. 
And a protocol stack is the implementation of all the different layers put together.

Start transcript at 4 minutes 8 seconds4:08


So a transmission, when want to send a message, 
basically the messages start at the top layer and then they go down. 
So you put the messages into the top layer protocol. 
It makes its decisions, adds to the header, passes it to the next layer, 
which adds, makes some decisions, adds to the header and 
continues, until you get to the bottom layer. 
Now the bottom layer is called the physical layer, and 
at that layer it actually takes the data and puts it on to an electrical

Start transcript at 4 minutes 35 seconds4:35


mechanism, a transmission mechanism, some kind of medium. 
So that means one of two things, either wire, so 
a physical layer, it codes the data onto physical wires, or 
it encodes it onto wireless broadcasts, radio broadcasts, so one of the two. 
So always at the bottom layer there's this physical layer, 
which actually transmits the signal either by wire or through the air through radio.

Start transcript at 5 minutes 1 second5:01


Now, at the receiving end, the message comes in. 
Remember, it's sent physically, right? 
So it's on wires, it's a bunch of electrical signals on wires, or 
it's sent through the radio. 
So at this end, the messages go up through the same protocol stack. 
So that means when it's received, it's received at the physical layer, right? 
Because it's physical signals, either wired or wireless. 
They come in, 
and then they have to get basically recoded back to the original data. 
So now at the receiving end, 
these messages are going through the protocol stack up, from bottom up. 
So the opposite of what happened on transmission happens here. 
At every layer, the message gets received, the appropriate header 
information is read and used, and then the new message that's produced is actually 
smaller than the first message, minus that header information, right? 
And then it goes up to the next layer, which takes the header information 
at that layer it uses that and then produces a new message which is smaller. 
And so by the end at the top all you have is the actual payload and 
all the header information has been stripped off. 
So that what happens at the receiving end and 
it's the reverse of what happens at the transmission side. 
Thank you. 
[MUSIC]

[MUSIC] 
This lecture we'll talk about protocol stack, the Internet standard protocol 
stack which involves TCP/IP and I'll talk a little bit, give a little bit of 
an example about an application layer protocol, what that would look like. 
We're not going in again, not into too much detail, but you should know what this 
protocol stack looks like, because anytime you want to use the internet. 
So, if you want to write code that accesses the internet, 
you're going to be using this stack, this protocol stack. 
So, you want to know something about how it works.

Start transcript at 39 seconds0:39


So, typically, when you're using the Internet, 
this is sort of a standard protocol stack that you see right here. 
This is not the same as the OSI protocol stack. 
The OSI protocol stack has seven layers, and it's more complicated. 
This is simplified, this has four layers in it. 
Top layer is the application layer,

Start transcript at 57 seconds0:57


below that is the transport layer where you see TCP/UDP. 
That's transport layer. 
Then below that you see IP which is, that's called the network layer, and 
that's the Internet protocol is there. 
And then below that is what's called the data link layer. 
Actually, there's really two layers merged there, data link and physical. 
So, the very bottom layer that you don't see there, 
is merged in is physical, where it actually drives it onto the wires, 
drives the signal onto the wires or onto the radio. 
And actually, 
if we look at these layers there's code associated with each layer, right? 
They're typically library functions. 
So, in practice in this specialization when you write network code and 
you will later. 
When you work on network code, we'll be talking about. 
You'll be calling application layer library functions. 
Only top layer, right? 
You don't have to worry about the lower layers at all, almost at all, right? 
Just the top layer is what you're really going to be dealing with but 
this whole stack has already been implemented and it will be given to you. 
So you'll download a free stack that looks like this but 
the functions that you'll be calling will be all top layer application layer. 
But just to say a little bit about some of these layers, there's IP, we already 
talked about that, TCP/UDP, and the data links of physical application layer. 
These are the protocols that directly interact with the applications. 
So whatever kind of application it is you're writing, 
if it's a network application it will have some kind of a network protocol and 
application layer protocol that it works with. 
So, for instance, naming some application protocols. 
SMTP, simple mail transfer protocol. 
That is a protocol used by mail clients. 
Right? 
If you've got an email client, 
it might be using SMTP to communicate with the mail server. 
HTTP, hypertext transfer protocol. 
You've heard of that, HTTP:. 
You've seen this in your URLs, right, and your addresses on the web, 
http:// whatever. 
So, anything that's HTTP, that's web interaction, 
which is most likely what you, which is most commonly used for, 
actually, in this class that's what we'll be using later on. 
And then, LPD, it's another one. 
Line Printer Daemon, printers talk to each other using that protocol. 
But there are a lot of these protocols. 
File transfer protocols, a bunch of them. 
If you want to transfer files, maybe you will use file transfer protocol. 
Hopefully you use SFTP, secure file transfer protocol, 
because it's better than FTP. 
But the idea is that every network application has its own protocol at 
the application layer that it uses.

Start transcript at 3 minutes 33 seconds3:33


So, to give you an example what one of these protocols looks like, 
let's look a little bit at HTTP. 
This is HTTP, this is a typical request on the web. 
Little hard to see, but if you look at the, 
actually the one we're looking at right here, this is the response message. 
So, it has several lines. 
Actually, that code right there has six lines. 
The top three lines, the ones in green, those are the header. 
And the bottom lines in white, those are the body, or the data, right, the payload. 
Whatever term you want to use. 
So the header are gonna be basically those top three lines.

Start transcript at 4 minutes 9 seconds4:09


Now, the header information, it gives information about the message but 
it's not the actual content. 
So for instance, we look at the first line, it gives you the protocol version, 
also the message type. 
200 OK is if you look at HTTP protocol which you can Google it and 
get a very large protocol document. 
200 OK has a particular meaning. 
Every response message is gonna have a particular code. 
200 OK is sort of your standard response, right? 
So then the next line there has a date, the date they were transmitted and so on. 
The next line has a content length, so that's how big the data is. 
That's inaccurate, but that's an example. 
It'll have the content length, and there are a lot of different pieces of header 
information you could stick in the header. 
And then the body, the data that you see there, that's the actual body, 
the context of the message. 
Now in this example which is very common, if this is a web, your asking for 
a webpage what happens is your machine, your IOT device let's say, sends a request 
out to a web server and the server sends back the contents of the webpage right? 
And so that your IOT device can render the page and draw it for you on the screen. 
And so that, what you see there, is HTML code, which is the content of a webpage. 
So, you know, this is summarized, but you can see it starts with HTML, 
ends with HTML and has a bunch of HTML tags, if you're familiar with those, but 
that would describe a web page. 
So if you had a web browser on your IOT device, it would read that data and 
then draw the webpage represented that it's supposed to be represented for you. 
But you can see here that this protocol, this HTTP protocol, 
is application specific. 
It's for web transfers. 
It's got header. 
There's some header lines which may or may not be useful to you, but 
the data is actually what you wanna send. 
Thank you. 
[MUSIC]
[MUSIC] 
Now we'll talk about MANETs, Mobile Ad Hoc Networks and 
how there used in Internet of Things to connect Internet of Things objects to 
bigger networks, to the Internet itself. 
And a we'll talk a little bit about how the code that we're gonna write. 
That your gonna write in class, and how it a, you won't directly have to know 
the details of these thing because you'll be writing generally high level code, but 
still it's important for you to be familiar with these concepts.

Start transcript at 35 seconds0:35


So a Mobile Ad Hoc Network, a MANET, is a self-configuring network. 
By self-configuring we mean that the hosts in the know, in the network 
configure themselves because they're moving around all the time. 
So their connections, their connectivity can change across time. 
So for instance in this picture, you see a bunch of nodes, 
you see cell phones, some cell phones, a car, right. 
Whatever the IoT device is there are a set of them, and 
then at the top middle is this access point. 
So this access point is the thing that connects our MANET to 
the main Internet, okay? 
Now a MANET could be just independent and not connected to the Internet at all, but 
most commonly we're going to be connecting to the Internet some way through 
an access point. 
Now the access point is typically, usually not mobile. 
It might be, it could be mobile, but commonly it's not mobile, 
and often wired, right? 
And so it'll have wireless connections to all the IoT devices, but 
it might have a wired connection to the main and Internet. 
So, the access point maybe isn't mobile but 
everything else is, and the way I've drawn the diagram up there. 
I have lines between two nodes if they can connect, 
if they can communicate directly to each another. 
Meaning if they're in radio range and they have communication, right? 
So sometimes, for instance, 
you look at the cell phone all the way on the left versus the cell phone all the way 
on the right, they don't have an edge directly between them. 
Because maybe they're out of range of each other. 
But they're both within range of the same access point, so 
they can communicate to each other through that access point but 
not directly in this particular configuration. 
So, the connections between these components changes all the time, 
because these things are moving, right? 
So maybe, these two cell phones which couldn't talk to each other before, not 
directly anyway, the people who have the cell phones, they walk near each other and 
suddenly, there's a connection directly between them. 
But, maybe the car can no longer connect to them because it just got out of range, 
because it drove past. 
So these networks, their connections are coming and going overtime. 
So that's what a Mobile Ad Hoc Network is.

Start transcript at 2 minutes 41 seconds2:41


Now, important aspects of MANET, one is a power budget. 
So you really have to worry about power when you're talking about MANET, 
because MANETs each one of the devices mobile, these IoT devices, they're all 
mobile They're all running off of batteries and the batteries can run out. 
So you have to generally change the protocol to be more power 
restrictive, right? 
It has to save power somehow. 
So that changes a lot of the way you do networking. 
So you send less data, for instance. 
You're restricted to sending less data because every piece of data you send 
that's gonna be some kind of power that you use to drive the antenna, right? 
So the battery is really important cuz the batteries are heavy, right? 
I mean batteries are often the heaviest component, or 
usually the heaviest component in these systems. 
I mean I think about my quad copter. 
The battery weighs as much as the rest of the whole copter. 
I mean it's so big, right? 
And that thing lasts for 15 minutes of flight time. 
It's ridiculous. 
But you get the same thing with cell phones and all this so where the battery 
is if not as heavy and everything else, at least it's the heaviest component in 
the system, and the biggest single component in the system. 
So battery power is really important when you're talking about MANET so 
you change the protocol to save power.

Start transcript at 3 minutes 53 seconds3:53


In addition, you typically have lower data rate

Start transcript at 3 minutes 57 seconds3:57


because you're using less power you have to send data more slowly. 
So, you have less of a data, lower data rate. 
An example, sort of a ball park example, is take Bluetooth. 
So, you're familiar with Bluetooth right? 
Bluetooth and compare that to Bluetooth low energy. 
So, Bluetooth is a network protocol, wireless. 
Bluetooth low energy is another, is also a network protocol derived from Bluetooth 
but is a low energy version of Bluetooth. 
So Bluetooth, you can send video across Bluetooth. 
You can get enough data rate sent to transmit video reasonably well, okay?

Start transcript at 4 minutes 29 seconds4:29


Now Bluetooth low energy, there's no way you get the same data rate. 
It uses a lot less power but you get a lot lower data rate. 
So you can't send video. 
So the fact that you're going to low power restricts you in terms of your data 
rate and that restricts your functionality in a lot of different ways.

Start transcript at 4 minutes 46 seconds4:46


Security, often security costs you in terms of power, right? 
So say you wanna do encryption, right? 
You wanna take all your messages and encrypt them before sending or 
something like that takes power, right? 
It takes power to do those operations, to encrypt the date, decrypt the data. 
So security, has a cost in terms of power and since your power constraint 
maybe you can't do as much security as you wanted to do. 
Also things like anti virus tools, right? 
You never see anti virus tools for 
cellphones or I think such a thing exists but it's not common, right? 
But if you talk about an IoT device, like a watch or something. 
They don't have antivirus for that because the computational power just isn't there. 
It doesn't have the extra cycles to be able to do antivirus tasks 
at the same time as doing its regular tasks. 
The reason for that is because these IoT devices, 
and we talked about this before, they're designed to be much more efficient. 
Meaning a desktop laptop 99.9% of the time, it is being underutilized. 
Very rarely are you fully utilizing that processor. 
So, it has extra cycles, extra power, to be spent doing antivirus tasks or 
something like that. 
Embedded systems, 
which IoT devices are they don't have those excess cycles, right? 
They use all the power they have, right? 
Or most of it. 
So they don't have extra cycles to just be doing anti-virus, 
without hurting the regular function of the system. 
So security often suffers in an IoT device, because you don't have the power 
budget to do it, and maybe also you might not have the cost, 
you might not have the money to pay for the extra hardware that you would need.

Start transcript at 6 minutes 22 seconds6:22


Now in practice [COUGH] when we do network programming later in specialization.

Start transcript at 6 minutes 29 seconds6:29


There are levels in the stack, right? 
There are different layers in the stack, Application, TCP/UDP and all this. 
But we don't have to touch those directly in our coding. 
So, when we use an Arduino or 
a Raspberry Pi you will be calling library functions at the application layer. 
So, your code is gonna be at the application layer, 
almost exclusively at the application layer. 
So, you call very simple functions which will take care of the details for you. 
So, for instance, as an example, you might have a function called send message 
an application layer function that sends an message to an IP address. 
Maybe you get, actually typically you'd get an IP address and a port number, 
which we'll talk about later, you call, send a message, and 
it'll send that message to that IP address and that port number. 
And all the details of TCP/UDP, IP and data link. 
That's all handled by the protocol stack, all you do is call the library function. 
Same thing on the receive, maybe there's a ReceiveMessage that does a similar thing. 
So you're making these calls at the application layer of the simple library 
function, and the details are being handled by the library code itself, so 
you don't have to worry about that. 
Thank you. 
[MUSIC]
[MUSIC] 
We've been talking about capturing packets on the network interface. 
I've mentioned it before and now we're gonna just try a little bit, 
let you see how to do it. 
Actually that will be one of the assignments too, you can give it a try. 
So we'll start out by starting the WireShark application, 
which is gonna be our packet capture tool.

Start transcript at 28 seconds0:28


So WireShark, I have the icon down here on the bottom. 
It's this shark fin one. 
So I'll start that.

Start transcript at 36 seconds0:36


So network packet protocol analyzer. 
So if we look at WireShark, let's pull it up a little bit, first thing it does is, 
right on the front screen, it gives me a list of devices. 
Interface list here. 
Let's click on interface list to see the interfaces. 
Now right here's listing four interfaces. 
Four different rows in this little window that's popped up. 
Now each one of these interfaces is a network interface they can capture on 
Bluetooth, wi-fi, wired ethernet and so on. 
It's a little bit hard to tell which one's the right one, 
but I already know that it's the bottom one, mostly because the number of packets. 
Notice that it's already catching a few packets on that interface and 
the other ones are basically dead. 
So I will click that interface. 
Just like that. 
Now, notice the start button. 
When I select start, it will start capturing. 
So I'll hit start, and WireShark should start capturing packets. 
Now notice that WireShark is blank at the moment. 
That's because there are no packets, right now, at this moment. 
On this interface. 
There go a few, okay it's noticing a little bit of noise. 
But what I'll do is, hm I'm curious what those are but I'll look at those later. 
So right now.

Start transcript at 1 minute 51 seconds1:51


I see that they are, one's a ARP. 
So what I'll do now is I'll force some packets under the interface. 
What I'll do is I'll start my web browser. 
So that my web browser can talk to a web server. 
And then this will record the packets that are transferred back and forth. 
So let's start my browser. 
Mozilla Firefox.

Start transcript at 2 minutes 13 seconds2:13


Okay, now as it's starting, let's just move it outta the way for a second. 
Yeah, see in the background here, we've got WireShark capturing lots of packets. 
So I'm gonna tell it to stop, we've captured enough. 
Click on capture. 
Stop right here. 
Okay now it's stopped. 
So we've already gotten over 3,600 packets just in that short amount of time. 
Now, notice that what's showing here in the main window, it shows one row for 
every packet that it captured. 
And it's just a one row summary, it's not the whole message. 
We can select each one and look at it in more detail. 
We'll do that in a second. 
So first let me sort these according to protocol. 
There's this column here, protocol, and you can see a lot of these messages RTCP,

Start transcript at 2 minutes 58 seconds2:58


which is an internet protocol. 
Also, you've got HTTP. 
Which is web traffic. 
So, let's click on protocol and sort according to protocol.

Start transcript at 3 minutes 8 seconds3:08


Now, DNS domain name service, ARP address resolution protocol and so on. 
So, lot's of different protocols being used. 
We're going to go straight to the HTTP messages. 
So let me just scroll down to HTTP. 
So if you remember, HTTP is basically world wide web. 
So let's take a look at the first HTTP message, 
that's this one right here, so I select it. 
So I've highlighted that line. 
And the window below, it gives me more information about that particular packet. 
Actually if we look all the way to the bottom window down here, 
you'll see basically Hex. 
What's called a Hex dump. 
Hex digits 001907D4 and so on. 
So it's digits and letters A through F. 
This is the representation of the message in hexadecimal, so just the bare zeros and 
ones represented in hexadecimal. 
It's showing me that, which I'm not too interested in looking at right now, but 
sometimes you want to look at the bare hex.

Start transcript at 4 minutes 6 seconds4:06


Now, above that, over in this window, it basically has taken this hexadecimal and 
broken it down into fields according to the protocol. 
So, if we look here, notice here in light blue, it says Hypertext Transfer Protocol. 
So I'll click the plus sign next to that, and what it does is, 
it says look, I'll scroll down a little bit so we can see. 
What it does is it realizes that this is an HTTP protocol packet, and 
so, given that it's in that protocol, it knows the format of the message. 
So, it knows this first piece of information should be the get, 
then the next one should be the next header. 
Next should be the next. 
So it organizes it in that way so I can read it. 
So the first one we see here is the get. 
GetHTTP141. 
That's just the get requesting the webpage. 
Get slash, so it's just selecting 
whatever webpage is available there at the top level directory. 
And its giving you the protocol number, 
this is how any kind of a get message starts is with a generic line like that. 
So it's requesting a website.

Start transcript at 5 minutes 11 seconds5:11


And that's what happens when you start up a web browser it goes 
to its default website and that's what its doing. 
And then you can look at the line below it host/..org, 
and that's because my default website is /..org. 
So the first thing it did was it went to /..org, requested the web page. 
And line after line, if we scroll down a little bit, 
we can see more headers, user agent, accept. 
So you can see I'm using Mozilla, you can see what version and so on. 
You can see all the information inside the packet.

Start transcript at 5 minutes 43 seconds5:43


So, that is Packet Capture for you. 
And you can store it and do all kinds of nice things. 
To look at lots of details about each packet if you're interested in that, 
thank you. 
[MUSIC]

You might also like