100% found this document useful (1 vote)
269 views89 pages

Unit2 Iot

This document discusses IoT hardware and software, specifically focusing on transducers and sensors. It defines transducers as devices that convert one form of energy into another. It describes different types of transducers including sensors, which measure physical quantities, and actuators, which convert electrical energy into motion. The document then discusses various types of sensors in more detail, including their characteristics and classifications. It provides examples of position, temperature, humidity, ultrasonic, motion, pressure, and gas sensors.

Uploaded by

Bulbul Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
269 views89 pages

Unit2 Iot

This document discusses IoT hardware and software, specifically focusing on transducers and sensors. It defines transducers as devices that convert one form of energy into another. It describes different types of transducers including sensors, which measure physical quantities, and actuators, which convert electrical energy into motion. The document then discusses various types of sensors in more detail, including their characteristics and classifications. It provides examples of position, temperature, humidity, ultrasonic, motion, pressure, and gas sensors.

Uploaded by

Bulbul Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 89

Internet of Things

UNIT 2
IoT Hardware and Software

Presented by: Shruti Sharma


Assistant Professor
Department of Computer Science Engineering
AIET, Jaipur
Transducer
• A transducer is defined as a device that converts (or transfers)
on form of input energy into another form of output energy.
Example: A microphone converts sound into electrical impulses
and a loud speaker converts electrical impulses in to sound.

2
Transducer types
Sensors
Devices that measures physical quantities and convert
them into signals which can be read by instruments.

Actuators
Devices that actuates or moves something. More
specifically, they converts electrical energy into motion
or mechanical energy
Transducer types
Quantity
Input Device Output Device
being
(Sensor) (Actuator)
Measured
Light Dependant Resistor (LDR), Lights & Lamps, LED's &
Light Level
Photodiode, Phototransistor, Solar Cell Displays, Fiber Optics
Thermocouple, Thermistor,
Heater, Fan, Peltier
Temperature Thermostat, Resistive temperature
Elements
detectors (RTD)
Force/Pressur Strain Gauge, Pressure Switch, Load Lifts & Jacks,
e Cells Electromagnetic, Vibration
Potentiometer, Encoders, Motor, Solenoid, Panel
Position
Reflective/Slotted Opto-switch, LVDT Meters
Tacho-generator, Reflective/Slotted AC and DC Motors, Stepper
Speed
Opto-coupler, Doppler Effect Sensors Motor, Brake
Carbon Microphone, Piezo-electric
Sound Bell, Buzzer, Loudspeaker
Crystal
4
Characteristic of Sensors

• Sensitivity
• Linearity
• Range
• Response time
• Accuracy
• Precision

5
Characteristic of Sensors
• Sensitivity is a measure of the change in output of the sensor relative to a unit
change in the input (the measured quantity) Example: The speakers you purchase
for your home entertainment may have a rated sensitivity of 89 dB Signal Pressure
Level per Watt per meter.

• Linearity is determined by the calibration curve. The static calibration curve


plots the output amplitude versus the input amplitude under static conditions. Its
degree of resemblance to a straight line describes the linearity.

• Range It is the minimum and maximum value of physical variable that the
sensor can sense or measure.

• Response Time It is generally expressed as the time at which the output


reaches a certain percentage (for instance, 95%) of its final value, in response to a
step change of the input.
Characteristic of Sensors
• Accuracy of a system is the difference between the actual and the measured value.
The distinction between accuracy and resolution is important. While resolution is the
smallest change in measurement value that can be indicated, the accuracy is determined
by the actual indication of the sensor and the real value of the measured entity. Thus
while resolution depends solely on the sensor hardware, the accuracy is a function of the
sensor hardware as well as the measurement environment and other extraneous factors
that modify the sensor behavior.
• Precision is a statistical measure. It is usually indicated by the standard deviation (or
variance) of a set of readings of the sensor for the same input. The distinction between
accuracy and precision is clarified by the following figure.
Classification of Sensors
In passive sensing, sensor measures the energy that
is naturally available, such as thermal infrared,
surface emissions.

In active sensing, sensors provides energy on their


own as a source of illumination. The energy reflected
by the target is detected and measured.
Classification of Sensors
1. Position Sensor

2. Temperature Sensor

3. Humidity Sensor

4. Ultrasonic Sensor

5. Motion Sensor

6. Pressure Sensor

7. Gas Sensor

8. Smoke Sensor etc.


Position Sensors
• Position sensors are devices that can detect the movement of
an object or determine its relative position measured from an
established reference point.
• These types of sensors can also be used to detect the presence
and absence of an object.
• There are several sensor types that serve similar purposes to
position sensors for example motion sensor and proximity
sensor.
• The distinction a position sensor has is that they are not only
concerned with the detection of an object but also with the
recording of its position and therefore involve the use of a
feedback signal that contains positional information.
Potentiometer

Processing circuit

11
LVDT

Linear Variable Differential Transformer 12


Inductive Proximity Switch
• Detects the presence of metallic objects (non-contact) via
changing inductance
• Sensor has 4 main parts: field producing Oscillator via a
Coil; Detection Circuit which detects change in the field;
and Output Circuit generating a signal (NO or NC)
Used in traffic lights (inductive loop buried under the road). Sense
objects in dirty environment.
Does not work for non-metallic objects. Omni-directional.

13
Rotary Encoders
• Incremental and absolute types
• Incremental encoder needs a counter, loses absolute
position between power glitches, must be re-homed
• Absolute encoders common in CD/DVD drives

14
Temperature Sensors
• The temperature sensor is used to detect the heat
energy which is produced from an object or
environment.
• These sensors are applicable for the Internet of Things
(IoT), which includes from manufacturing to farming.
• The main role of these sensors in manufacturing is for
temperature monitoring of machines.
• Similarly, in the agriculture field, these sensors are used
to monitor the temperature of plants, soil, and water.
Thermocouple
• Thermocouples are the most commonly used type of temperature
sensor. They are used in industrial, automotive, and consumer
applications.
• Thermocouples are self-powered, require no excitation, can
operate over a wide temperature range, and have quick response
times.
Thermocouple
• Thermocouples are made by joining two dissimilar metal
wires together. This causes a Seebeck Effect.
• The Seebeck Effect is a phenomenon in which a
temperature difference of two dissimilar conductors
produces a voltage difference between the two substances.
• It is this voltage difference that can be measured and used
to calculate the temperature.
• In thermocouples the measuring of temperature can be
challenging because of their small output voltage, which
requires precise amplification, susceptibility to external
noise over long wires, and cold junction.
Resistance Temperature Detector
• RTD’s are precision temperature sensors made from high-
purity conducting metals such as platinum, copper or nickel
wound into a coil and whose electrical resistance changes
as a function of temperature.
• As temperature changes, the resistance of any metal
changes as well. This difference in resistance is what RTD
temperature sensors are based on.
• Resistive temperature detectors have positive temperature
coefficients (PTC) their output is extremely linear producing
very accurate measurements of temperature.
• However, they have very poor thermal sensitivity.
Thermistor
• Thermistor is a special type of resistor which changes its
physical resistance when exposed to changes in
temperature like RTD sensor.
• This thermistor offers higher sensitivity than the resistor
temperature detectors.
• Thermistors are made from manganese and oxides of
nickel, which make them susceptible to damages.
• Most of the thermistors have a negative temperature
coefficient. It means, when the temperature increases the
resistance decreases.
• Thermistors are passive resistive devices which means we
need to pass a current through it to produce a measurable
voltage output.
Infrared temperature Sensor
• Infrared sensors are mainly used to measure the heat
which is produced by objects.
• Infrared temperature sensors sense electromagnetic
waves in the 700 nm to 14,000 nm range.
• These sensors are used in the various applications of
IoT like healthcare for monitoring the flow of blood, BP,
etc.
• These sensors are used in smartphones for controlling,
wearable devices for detecting the amount of light,
detection of blind-spot within vehicles, etc.
Thermometer
• A thermometer is a device used
to measure the temperature of
solids, liquids, or gases.
• Thermometer contains a liquid,
which is mercury or alcohol in its
glass tube.
• The volume of the thermometer
is linearly proportional to the
temperature – when the
temperature increases, the
volume of the thermometer also
increases.
Humidity Sensors
• Humidity is defined as the amount of water present in the
surrounding air.
• A humidity sensor is an electronic device that measures
the humidity in its environment and converts its findings
into a corresponding electrical signal.
• The units for measurement of humidity is RH (relative
humidity), D/F PT (Dew/frost point) & PPM (parts per
million).
• Humidity sensors can be divided into two groups, as each
category uses a different method to calculate humidity:
relative humidity (RH) sensors and absolute humidity (AH)
sensors.
Important Terms Related to Humidity
Relative Humidity(RH): is the amount of moisture in the
air compared to what the air can hold at that temperature.
Moisture: means water content of any material or
substance. But practically, the term Moisture refers to the
water content in solids and liquids.
Dew Point: is the temperature at which the relative
humidity is 100 %
When air temperature reaches the dew point temperature:
 100 % relative Humidity
Condensation or precipitation occurs
Classification of Humidity Sensors
• Capacitive Relative Humidity Sensors

• Resistive Humidity Sensors (Electrical Conductivity


Sensors)

• Thermal Conductivity Humidity Sensors


Capacitive Relative Humidity Sensors
In Capacitive Relative Humidity (RH) Sensors, the electrical
permittivity of the dielectric material changes with change in
humidity.
Capacitive Relative Humidity Sensors
Advantages of Capacitive Humidity Sensors

•The output voltage is near linear.


•They provide stable results over long usage.
•Can detect wide range of RH.

Disadvantages of Capacitive Humidity Sensors

•The distance from the sensor and signalling circuit is very limited.

Applications of Capacitive Humidity Sensors

•HVAC Systems
•Printers and Fax Machines
•Weather Stations
•Automobiles
•Food Processing
•Refrigerators, Ovens and Dryers
Resistive Humidity Sensors
• Resistive Humidity Sensors are another important type of Humidity
Sensors that measure the resistance (impedance) or electrical
conductivity.
• The principle behind resistive humidity sensors is the fact that the
conductivity in non – metallic conductors is dependent on their water
content.
Resistive Humidity Sensors
Advantages of Resistive Humidity Sensors

• Low cost
•Small Size
•The distance between the sensor and signal circuit can be large (suitable for
remote operations).
• Highly interchangeable as there are no calibration standards.

Disadvantages of Resistive Humidity Sensors

•Resistive Humidity Sensors are sensitive to chemical vapors and other


contaminants
•The output readings may shift if used with water soluble products.

Applications of Resistive Humidity Sensors

Resistive or Electrical Conductive Humidity sensors are low cost sensors with
relatively small size. They are often used in several industrial, domestic or
residential and commercial applications.
Thermal Conductivity Humidity Sensors
• Thermal Conductivity Humidity Sensors are also known as Absolute Humidity
(AH) Sensors as they measure the Absolute Humidity.
• Absolute Humidity doesn’t take temperature in to account but it changes with
temperature and pressure.
• Thermal Conductivity Humidity Sensors measure the thermal conductivity of
both dry air as well as air with water vapour. The difference between the
individual thermal conductivities can be related to absolute humidity.
Thermal Conductivity Humidity Sensors
Advantages of Thermal Conductivity Humidity Sensors

• Suitable for high temperature environments and high corrosive


situations.
• Very durable
• Higher resolution compared to other types

Disadvantage of Thermal Conductivity Humidity Sensors

• Exposure to any gas with thermal properties different than Nitrogen


might affect reading measurement.

Applications of Thermal Conductivity Humidity Sensors

• Drying kilns
• Pharmaceutical plants
• Owens
• Clothes dryers and drying machines
Ultrasonic Sensor
• An ultrasonic sensor is an
instrument that measures the
distance to an object using
ultrasonic sound waves.
• In IoT ultrasonic sensors are used for
non-contact detection of solid and
liquid objects.
• These sensors are used for a wide
variety of functions from monitoring
the level of water in a tank to fluid
identification/concentration, to
detecting object proximity.
Ultrasonic Sensor
• Ultrasonic sensors work by sending out a sound wave at a
frequency above the range of human hearing.
• It sends an ultrasonic pulse out at 40kHz which travels through the
air and if there is an obstacle or object, it will bounce back to the
sensor.
• Ultrasonic sensors have two main components: the transmitter
(which emits the sound using piezoelectric crystals) and the
receiver (which encounters the sound after it has travelled to and
from the target).
• In order to calculate the distance between the sensor and the
object, the sensor measures the time it takes between the emission
of the sound by the transmitter to its contact with the receiver.
Motion Sensor
• A motion sensor or motion detector is an electronic
device that is designed to detect and measure
movement.
• Motion sensors are used primarily in home and business
security systems.
• There various kinds of motion sensors are available in
the market. They are namely PIR, Ultrasonic, Microwave,
Tomographic and combined types.
What is an Arduino ?
• Open Source electronic prototyping platform
based on flexible easy to use hardware and
software.
What is an Arduino?
• A microcontroller board, contains on-board power
supply, USB port to communicate with PC, and
an Atmel microcontroller chip.
• It simplify the process of creating any control
system by providing the standard board that can
be programmed and connected to the system
without the need to any sophisticated PCB design
and implementation.
• It is an open source hardware, any one can get the
details of its design and modify it or make his own
one himself.
Arduino Boards
Arduino Uno
Getting started with Programming
Arduino IDE
Arduino IDE
Arduino IDE
Code Structure
void setup() {
// put your setup code here, to run once:
}

void loop() {
// put your main code here, to run repeatedly:
}
Code Structure
• setup : It is called only when the Arduino is
powered on or reset. It is used to initialize
variables and pin modes

• loop : The loop functions runs continuously till


the device is powered off. The main logic of
the code goes here. Similar to while (1) for
micro-controller programming.
PinMode
• A pin on arduino can be set as input or output
by using pinMode function.

• pinMode(13, OUTPUT); // sets pin 13 as


output pin

• pinMode(13, INPUT); // sets pin 13 as input


pin
Reading/writing digital values
• digitalWrite(13, LOW); // Makes the output
voltage on pin 13 , 0V

• digitalWrite(13, HIGH); // Makes the output


voltage on pin 13 , 5V

• int buttonState = digitalRead(2); // reads the


value of pin 2 in buttonState
Analog to Digital Coversion
• What is analog ?
• It is continuous range of voltage values (not
just 0 or 5V)

• Why convert to digital ?


• Because our microcontroller only understands
digital.
ADC in Arduino Uno
Converting Analog Value to Digital
Quantanization the signal
ADC in Arduino
• The Arduino Uno board contains 6 pins for
ADC.

• 10-bit analog to digital converter.

• This means that it will map input voltages


between 0 and 5 volts into integer values
between 0 and 1023.
Reading/Writing Analog Values
• analogRead(A0); // used to read the analog
value from the pin A0

• analogWrite (2,128);
Serial Communication
ADC Example
• // These constants won't change. They're used to give names to the pins used:
const int analogInPin = A0; // Analog input pin that the potentiometer is attached to
const int analogOutPin = 9; // Analog output pin that the LED is attached to
int sensorValue = 0; // value read from the pot
int outputValue = 0; // value output to the PWM (analog out)
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
}
void loop() {
// read the analog in value:
sensorValue = analogRead(analogInPin);
// map it to the range of the analog out:
outputValue = map(sensorValue, 0, 1023, 0, 255);
// change the analog out value:
analogWrite(analogOutPin, outputValue);
// print the results to the serial monitor:
Serial.print("sensor = " );
Serial.print(sensorValue);
Serial.print("\t output = ");
Serial.println(outputValue);
// wait 2 milliseconds before the next loop
// for the analog-to-digital converter to settle
// after the last reading:
delay(2);
}
Advantages
• Very easy to get started.
• It can be used for real-time applications for
both hardware, software and IDE is open
source.
• Not much programming knowledge needed to
do basic stuff.
• It is very easy to extend and has tons of user-
contributed shields and libraries. Shields are
available to do attractive much anything.
Disadvantages
• It is not very powerful when compared with
Raspberry Pi
• You need to program using either Arduino or
C/C++
• Connecting to the internet is slightly difficult,
but not impossible. Parsing of Arduino with
YQL and JSON is possible.
What is an Raspberry Pi ?
• Raspberry Pi is a small single board computer. By connecting
peripherals like Keyboard, mouse, display to the Raspberry Pi, it
will act as a mini personal computer.
• Raspberry Pi is popularly used for real time Image/Video
Processing, IoT based applications and Robotics applications.
• Raspberry Pi is slower than laptop or desktop but is still a computer
which can provide all the expected features or abilities, at a low
power consumption.
• Raspberry Pi Foundation officially provides Debian based Raspbian
OS. Also, they provide NOOBS OS for Raspberry Pi. We can install
several Third-Party versions of OS like Ubuntu, Archlinux, RISC
OS, Windows 10 Core, etc.
• Raspbian OS is official Operating System available for free to use.
This OS is efficiently optimized to use with Raspberry Pi.
What is an Raspberry Pi ?
• Raspbian have GUI which includes tools for Browsing, Python
programming, office, games, etc.
• We should use SD card (minimum 8 GB recommended) to store the
OS (operating System).
• Raspberry Pi is more than computer as it provides access to the on-
chip hardware i.e. GPIOs for developing an application. By
accessing GPIO, we can connect devices like LED, motors, sensors,
etc and can control them too.
• It has ARM based Broadcom Processor SoC along with on-chip
GPU (Graphics Processing Unit).
• The CPU speed of Raspberry Pi varies from 700 MHz to 1.2 GHz.
Also, it has on-board SDRAM that ranges from 256 MB to 1 GB.
• Raspberry Pi also provides on-chip SPI, I2C, I2S and UART
modules.
Versions of Raspberry Pi
Raspberry Pi 3 Raspberry Pi 2
Features Raspberry Pi zero
Model B Model B

SoC BCM2837 BCM2836 BCM2835

Operating Freq. 1.2 GHz 900 MHz 1 GHz

RAM 1 GB SDRAM 1 GB SDRAM 512 MB SDRAM

GPU 400 MHz Videocore IV 250MHz Videocore IV 250MHz Videocore IV

Storage micro-SD Micro-SD micro-SD

Ethernet Yes Yes No

Wireless No No No
Raspberry Pi 3
Raspberry Pi 3
• HDMI (High-Definition Multimedia Interface): It is used
for transmitting uncompressed video or digital audio data to
the Computer Monitor, Digital TV, etc. Generally, this
HDMI port helps to connect Raspberry Pi to the Digital
television.
• CSI Camera Interface: CSI (Camera Serial Interface)
interface provides a connection in between Broadcom
Processor and Pi camera. This interface provides electrical
connections between two devices.
• DSI Display Interface: DSI (Display Serial Interface)
Display Interface is used for connecting LCD to the
Raspberry Pi using 15-pin ribbon cable. DSI provides fast
High-resolution display interface specifically used for
sending video data directly from GPU to the LCD display.
Raspberry Pi 3
• Composite Video and Audio Output: The
composite Video and Audio output port carries
video along with audio signal to the Audio/Video
systems.
• Power LED: It is a RED colored LED which is
used for Power indication. This LED will turn ON
when Power is connected to the Raspberry Pi. It is
connected to 5V directly and will start blinking
whenever the supply voltage drops below 4.63V.
• ACT PWR: ACT PWR is Green LED which
shows the SD card activity.
Raspberry Pi GPIO Access
GPIO (General Purpose Input Output) pins can
be used as input or output and allows raspberry
pi to connect with general purpose I/O devices.
• Raspberry pi 3 model B took out 26 GPIO pins
on board.
• Raspberry pi can control many external I/O
devices using these GPIO’s.
• These pins are a physical interface between the
Pi and the outside world.
Raspberry Pi GPIO Access
• We can program these pins according to our needs to
interact with external devices. For example, if we want to
read the state of a physical switch, we can configure any of
the available GPIO pins as input and read the switch status
to make decisions. We can also configure any GPIO pin as
an output to control LED ON/OFF.
• Raspberry Pi can connect to the Internet using on-board Wi-
Fi or Wi-Fi USB adapter. Once the Raspberry Pi is
connected to the Internet then we can control devices, which
are connected to the Raspberry Pi, remotely.
• Some of the GPIO pins are multiplexed with alternate
functions like I2C, SPI, UART etc.
• We can use any of the GPIO pins for our application.
Raspberry Pi GPIO Access
Advantages
• It is very easy to connect to the internet.
• Entire Linux software stack is available.
• Can be programmed using a variety of
programming languages.
Disadvantages
• Accessing hardware is not real-time. If the
CPU is busy, then interfacing with the
hardware can be delayed.
• Does not have enough power to drive
inductive loads.
• There is no inbuilt Analog to Digital converter
available.
• The hardware design is not open source. Even
though it is not a big deal, for some people it
might a deal-breaker.
LiteOS
•LiteOS is a real-time operating system (RTOS).

•It is developed by Huawei Technologies.

•LiteOS is a Unix-like operating system that fits on memory-constrained sensor nodes.

•This operating system allows users to operate wireless sensor networks like operating Unix, which

is easier for people with adequate Unix background.

•LiteOS provides a familiar programming environment based on Unix, threads, and C.

•It follows a hybrid programming model that allows both event-driven and thread-driven

programming
LiteOS Architecture
LiteOS
Programming Model:
•LiteOS is a multitasking OS and it supports multithreading.
•processes run applications as separate threads.
•LiteOS also provides support for event handling. Application programmers can register event
handlers using a callback facility provided by LiteOS.
•To avoid potential race conditions, LiteOS provides atomic_start() and atomic_end()
functions. Whenever shared data among different threads is accessed or modified, it is highly
recommend to use these functions.
LiteOS
Scheduling:
•LiteOS provides an implementation of Round Robin scheduling and Priority-based
scheduling.
•The tasks run to completion or until they request a resource that is not currently
available.
•When a task requires a resource that is not available, the task enables interrupts and
goes to sleep mode.
•Once the required resource becomes available, the appropriate interrupt is signaled
and the task resumes it execution from where it had left. When a task completes its
operation it leaves the kernel.
•When there are no active tasks in the system, the sensor node goes to sleep mode.
Before going to sleep mode the node enables its interrupts so that it can wake up at
the proper event or time.
LiteOS
Memory Protection and Management
•Inside the kernel, LiteOS supports dynamic memory allocation through the use of
C-like malloc and free functions.
•User applications can use these APIs to allocate and de-allocate memory at run-
time.
•Dynamic memory grows in the opposite direction of the LiteOS stack.
•The LiteOS kernel compiles separately from the application, therefore the address
space is not shared between the kernel and the application.
Similarly, each user application has its separate address space. Processes and Kernel
memory safety is enforced through separate address spaces.
LiteOS
Communication Protocol Support
•LiteOS provides communication support in the form of files
•LiteOS creates a file corresponding to each device on the sensor node.
•Whenever there is some data that needs to be sent, the data is placed into the
radio file and is afterward wirelessly transmitted.
•At the network layer LiteOS supports geographical forwarding.
• Each node contains a table that can only hold 12 entries.
LiteOS
Resource Sharing

LiteOS suggest the use of APIs provided for synchronization whenever a thread
wants to access resources that are shared by multiple threads. The LiteOS
documentation does not provide any detail on how system resources are shared
among multiple executing threads.
LiteOS
Support for Real-Time Applications
•LiteOS does not provide any implementation of networking protocols that support
real-time multimedia applications.
•It provides a priority-based process scheduling algorithm but once a process is
scheduled it runs to completion
•This can result in a missed deadline of a higher priority process that enters the ready
queue once a low priority process has been scheduled.
LiteOS
Additional Features

•Lite File System (LiteFS)


LiteOS provides support for a hierarchical file system called LiteFS. LiteFS
provides support for both files and directories. LiteFS is partitioned in three
modules. It keeps open file descriptors, memory allocation bit vectors, and
information about flash memory layout in RAM.
Simulation Support
LiteOS supports wireless sensor networks simulations through AVRORA.
Language Support
LiteOS supports application development in the LiteC++ language.
REQUIRMENTS OF IoT NETWORK
 Low Power, Low Cost and Low memory footprint (RAM and
ROM)
 Should have provision for IPv6, with 6LoWPAN Adaptation Layer
 Separate Routing Protocol for Low Power networks
 New light Weight Application Layer Protocol unlike http but
should have a support for http also
 Header compression for IPv6 against IEEE 802.15.4 MAC
OS DESIGN for CONSTRAINED DEVICES

Structure of the Kernel


 Monolithic : lacks modularity and becomes complex once the size exceeds a limit
 Layered Approach: one has to segregate between the kernel mode and user mode
 Micro Kernel: This method is preferred as only limited set of tools runs under Kernel
Mode and most other drivers and modules runs under User mode which very easy to
handle and kernel will not be overloaded.
Programming Model
 No memory segmentation
 Every process run in its own thread and has its own memory stack
CONTIKI OS

 Layered architecture
 Uses C and Partial C++ support
 Provides device drivers, communication and sensor data
handling as services
 Also comprises uIP Stack, a device driver loader and a
Protothreading system
 Protothreads are simple light weight multi threading
system that uses a stack-less implementation
 Contiki is an open source operating system for the Internet of Things.
 runs on networked embedded systems and wireless sensor nodes.
 Contiki is a highly portable OS and it is build around an event-driven
kernel.
 Contiki provides preemptive multitasking that can be used at the
individual process level.
 Polling mechanism is used to avoid race condition.
 Any scheduled event will run to completion, however, event handlers
can use internal mechanisms for preemption.
Contiki OS Architecture
Functional Aspect:
 It’s kernel functions as an event-driven kernel; multithreading is supported by
an application library. In this sense it is a hybrid OS.
 Contiki realises the separation of kernel of the basic system support form the
rest of the dynamically loadable and programmable services (called
processes).
 The services communicate with each other through the kernel by posting
events.
 The ContikiOS kernel does not provide any hardware abstraction; but it
allows device drivers and application directly communicate with the
hardware.
 Each Contiki service manages its own state in a private memory space and the
kernel keeps a pointer to the process state.
Programming Model:
 Contiki supports preemptive multithreading. Multi-threading is implemented as a library
on top of the event-driven kernel.
 The library can be linked with applications that require multithreading. The Contiki
multithreading library is divided in two parts: a platform independent part and a platform
specific part
 Contiki uses protothreads.
 Protothreads are designed for severely memory constraint devices because they are stack-
less and lightweight.
 The main features of protothreads are: very small memory overhead (only two bytes per
protothread), no extra stack for a thread, highly portable (i.e., they are fully written in C and
hence there is no architecture-specific assembly code). Since events run to completion and
Contiki does not allow interrupt handlers to post new events, no process synchronization is
provided in Contiki.
Scheduling
Contiki is an event-driven OS, therefore it does not employ any sophisticated scheduling
algorithm. Events are fired to the target application as they arrive. In case of interrupts,
interrupt handlers of an application runs w.r.t. their priority.

Memory Management and Protection:


Contiki supports dynamic memory management. Apart from this it also supports dynamic
linking of the programs. In order to guard against memory fragmentation Contiki uses a
Managed Memory Allocator.
Communication Protocol Support:
Contiki supports a rich set of communication protocols. In Contiki, an application can use both
versions of IP i.e., IPv4 and IPv6. Contiki provides an implementation of uIP, a TCP/IP protocol
stack for small 8 bit micro-controllers. uIP does not require its peers to have a complete protocol
stack, but it can communicate with peers running a similar lightweight stack.

Contiki provides another lightweight layered protocol stack, called Rime, for network-based
communication. Rime provides single hop unicast, single hop broadcast, and multi-hop
communication support. Rime supports both best effort and reliable transmission.
Resource Sharing
Since events run to completion and Contiki does not allow interrupt handlers to post new
events, Contiki provides serialized access to all resources.

Support for Real-Time Applications


Contiki does not provide any support for real-time applications, hence there is no
implementation of any real-time process scheduling algorithm in Contiki.
RIoT OS

 Micro Kernel Approach


 Tickless scheduler (It switches to idle thread during idle)
 Designed in such a way that the kernel functions are
scheduled under a low clock speed.
 Full support of C and C++ is available
 Full support for RPL, 6LoWPAN, IPv6, TCP,UDP, etc. Its
completely modular
RIoT OS
TINY OS
 Monolithic Kernel
 Uses a programming language nesC
 It provides algorithms, protocols, device drivers, file
systems and a shell
 Stopped its support and is not extensively maintained
 Few 100 bytes of RAM and ROM is enough to load the OS
into the Motes
 Support multi threading
COMPARISION TABLE

You might also like