0% found this document useful (0 votes)
14 views95 pages

Lec 2

Uploaded by

umerhanif298123
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
0% found this document useful (0 votes)
14 views95 pages

Lec 2

Uploaded by

umerhanif298123
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/ 95

IoT Devices

(Sensors and Actuators)


Week -2
Dr. Shafa-at Ali Sheikh
[email protected]
Flash back

2
What to expect ?
• Roadmap to build IoT systems
• Some basic electrical components - An overview
• Characteristics of IoT Systems
• Sensors
• Actuators

3
How do you build IoT things?

4
How do you build IoT things?
• IoT is a synthesis of hardware and software

• IoT Hardware - Computers, sensors, actuators, communication interfaces,


memory, microcontrollers, storage, and every other physical component of the
IoT

• All electric and electronic components work with electricity.

5
Some basic electrical components
6
Hardware revolution
• Low-cost, componentized hardware enables rapid prototyping without
advanced electrical engineering knowledge

7
Background: Atoms

• Made of protons, neutrons, and electrons

• In materials, nucleus held in fixed


position

• Some electrons are also fixed

• But some electrons may be free to ‘move’

8
Background: Electrical Current
• Usually free electrons hop
around randomly
• However, outside forces can
encourage them to flow in a
particular direction
• Magnetic field, charge
differential this is called
current
• We can vary properties of
current to transmit information
(via waves, like dominos, as
electron drift velocities are
very slow)

9
Making an Electrical “Circuit”

10
Electrical Current Can Be Manipulated
• It is possible to take current and change it

11
Flowing Electricity is Like Flowing Water

12
Water Analogy: Capacitance

13
Electrical Components

14
How to draw a circuit
• Need to remember our designs, show to others
• Need to clearly describe what each component is, properties of
component, which pins are connected, etc.

15
Electronic Symbols

16
Resistors and Potentiometers

• What they do:


• resist the flow of current

• Useful for:
• Protecting components from getting too
much current
• Increasing and decreasing voltage
• Measuring things (e.g., light intensity)

17
Resistors and Potentiometers
• Key metrics:
• Resistance: how much they resist current (Ohms)

• Tolerance: how accurate their resistance rating is (%)

• Power rating: how much current they can handle


(Watts)

• Maximum voltage: how much voltage difference


across their input/output they can handle

18
Capacitors
• What they do:
• store charge

• Useful for:
• Temporarily holding some charge (like
a tiny battery)
• Smoothing out voltage spikes
• Measurement (humidity, pressure,
touch sensors)

19
Capacitors
• Key metrics:
• Capacitance: how much charge it can store (farads)

• Tolerance: how accurate their capacitance rating is (%)

• Maximum voltage: how much voltage they can handle (before


they short out or burn up)

• Leakage current: amount of current that leaks through dielectric

• No “current rating” –you can’t have a sustained current through a


capacitor aside from leakage

• Equivalent series resistance (ESR): capacitors aren’t


perfect and have tiny amount of resistance (usually less
than 0.01Ω)
20
Diode
• What it does:
• allows current to go in forward direction,
but not reverse direction
• Useful for:
• Reverse current protection

• “Rectifying” signals (pulling out positive


parts) - Converting AC to DC

• Measurement (temperature, radiation)

21
Diode
• Key metrics:
• Maximum forward current: how much
current can go through in the forward direction
(amps)
• Maximum reverse voltage (breakdown
voltage): how much voltage can be withstood
in reverse direction
• Maximum forward voltage: voltage difference
between input/output when current going
through forward direction (ideally should be
zero, no resistance to current)

22
Transistors
• What it does:
• acts like a switch; when voltage
applied to one wire, forms
connection between other two wires

• Useful for:
• Acting like a switch
• Amplifying a signal

23
Transistors
• Key metrics
• Type: does applied current turn on connection
(NPN) or turn off connection (PNP)
• Maximum reverse voltage (breakdown
voltage): how much voltage can be withstood in
reverse direction
• Maximum forward voltage: voltage difference
between input/output when current going
through forward direction (ideally should be
zero, no resistance to current)
24
Electric Motors

• What they do:


• Converts electricity into motion

• Main Idea:
• Get two big magnets, one north and one south

• Run electricity through a curved wire


• Alternatively pushes/pulls against magnets

• Rotates a mechanical shaft

25
Common types of Electric Motors

26
More types of Electric Motors

27
References
• At SparkFun.com you can buy electronics materials and there are also excellent tutorials
including; What is Electricity, What is a circuit, What is Voltage, What is current, What is Electric
power….
• JIMBO. n.d. “What is Electricity.” Sparkfun Electronics. https://learn.sparkfun.com/tutorials/what-is-
electricity
• Learn Engineering. 2016. “How Does a Diode Work.” YouTube video,
https://www.youtube.com/watch?v=JNi6WY7WKAI
• Learn Engineering. 2016. “Transistors, How do they Work?” YouTube video,
https://www.youtube.com/watch?v=7ukDKVHnac4
• MITK12Videos. 2015. “What is a Semiconductor.” YouTube video,
https://www.youtube.com/watch?v=gUmDVe6C-BU
• RimstarOrg. 2014. "How to Read a Schematic." YouTube video
https://www.youtube.com/watch?v=_HZ-EQ8Hc8E
• Techquickie. 2017. “Capacitors, Resistors, and Electronic Components.” YouTube video
https://www.youtube.com/watch?v=JNi6WY7WKAI
• Electronics Tutorials. n.d. “Semiconductor Basics.” Aspencore https://www.electronics-
tutorials.ws/diode/diode_1.html
• Diodes: https://www.electronics-tutorials.ws/diode/diode_3.html
28
Characteristics of IoT Systems
29
Characteristics of IoT Systems
• They can perceive one or more aspects of the world; i.e. they can hear, see, feel,
smell or taste something.
• They can produce an action in the world; i.e. they can move, turn on, or activate
something.
• They have a bit of ‘intelligence’, that uses sensed information to make decisions
about when and how to produce an action.

30
Characteristics of IoT Systems

• Example:
• You can design a system that
unlocks the door of a house when
it recognizes the face of someone
who lives there.

• The house recognizing its occupants


can be represented as
• From a technical perspective, this
diagram represents an open-loop
control system.
• These are reactive systems because
they control the world based on
current information only. 31
Characteristics of IoT Systems
• To add a bit more information to the decision-making process, actions on the world can
also be monitored, as shown in the following diagram. These are called closed-loop
systems.

• Example:
• ??
• The air conditioner is a closed-loop system: You set the desired temperature and the air
conditioner ‘knows’ when to start and stop operation to keep the room temperature as
close to the desired value as possible
32
IoT System to IoT Hardware

Micro
Sensor Controller
Actuator

33
Sensors
34
What is a Sensor?

• Input (Measurand) • Output


• Pressure Sensor • Electric (voltage /current)
• Temperature • Displacement
• Acceleration • etc
• Mechanical

35
Human Sensors
• Touch
• A very much mechanical sense converting mechanical energy into bioelectrical
signal that our brain interprets.
• Hearing
• Mechanized pressure waves reaching on ears and triggering a signal cascade
• Proprioception (Balance)
• Relying on sort of a gyroscopic detection. For instance, inner ear function to detect
mechanical tilt in in different direction
• Vision
• Although it is not mechanical per se, but we have light impinging on a sensor that is
being converted to a biological signal and than our brain is interpreting all these
signals.

36
Human Sensors (touch)

37
Human Sensors (touch)

38
Human Sensors (touch)

39
Phone Sensors

• Try using an App that lets


you see phone sensors
collecting data:
• PowerSense for iPhone

• Sensor Box for Android

40
Sensors

41
Sensors

42
Sensors

43
Sensors

44
Sensors

45
Sensors – References
• Temperature: Thermistors, thermocouples, resistive temperature detectors and many
others.
• Pressure: Fibre optic, vacuum, elastic liquid-based manometers, linear variable differential
transformer and electronic.
• Flow: Electromagnetic, differential pressure, positional displacement, thermal mass.
• Level Sensors: Differential pressure, ultrasonic radio frequency, radar, thermal displacement.
• Proximity and displacement: Linear variable differential transformer, photoelectric,
capacitive, magnetic, ultrasonic.
• Biosensors: Resonant mirror, electrochemical, surface Plasmon resonance, Light addressable
potentio-metric.
• Image: Charge coupled devices, CMOS.
• Gas and chemical: Semiconductor, infrared, conductance, electrochemical.
• Inertial Measurement Units: Gyroscopes, accelerometers, magnetometers.
• Others: Moisture, humidity sensor, tilt sensor, force, viscosity.
• List of sensors

46
Cases of 'indirect' sensor measurements
• we can sense a great many things indirectly, from sensors not intended
for that particular purpose, or by using multiple sensors to determine a
seemingly unrelated property.
• CASE: Water salinity
• The level of dissolved salt in water is a critical measurement in many industries,
particularly agriculture.
• However there isn’t a sensor available (at a reasonable cost, easy portability, etc.)
that will directly measure NaCl (the type of salt we are interested in).
• So, the common approach is to approximate this value by measuring something
that is a by-product of salinity levels: in this case, conductivity.

47
Cases of 'indirect' sensor measurements

TYPE OF WATER APPROXIMATE RESISTIVITY IN OHMS(Ω)


Pure Water 20,000,000
Distilled Water 500,000
Rain Water 20,000
Tap Water 1,000-5,000
Brackish River Water 200
Coastal Seawater 30
Open Seawater 20-25

48
Generic Sensing Application

49
Generic Sensing Application

• Filtering Analog to Digital


• Amplification Conversion

50
Generic Sensing Application

51
Generic Sensing Application
• Smart Sensors
• At a minimum, a smart sensor is made of a
• sensor,
• a microprocessor and
• communication technology of some kind.

• The compute resources must be an integral part


of the physical design
• A sensor that just sends its data along for remote
processing isn't considered a smart sensor.

52
Sensor Nodes
• The overall architecture of a sensor node consists of:
• The sensor node processing subsystem running on sensor node main CPU
• The sensor subsystem and
• The communication subsystem

• The processor and radio board includes:


• TI MSP430 microcontroller with 10kB RAM
• 16-bit RISC with 48K Program Flash
• IEEE 802.15.4 (LR-WPAN) compliant radio at 250 Mbps
• 1MB external data flash
Crossbow Mote
• Runs TinyOS 1.1.10 or higher TPR2400CA-TelosB
• Two AA batteries or USB
• 1.8 mA (active); 5.1uA (sleep)

53
54
55
56
57
58
Desirable Sensor Characteristics
• Linearity: The output should change linearly with the input

• High resolution: Resolution is the smallest change in the input that the device can detect.
(1.0 or 1.001 )

• Response: Should be capable of responding to the changes in minimum time

• Accuracy: No deviation from exact quantity

• Repeatability : Deviation from reading to reading when they are taken for a number of
times under identical conditions

• Less noise and disturbance

• Less power consumption


59
Sensor Terminology/ Specifications
Term Description

Sensitivity Min input of physical parameter that will create a desirable output change

Linearity An expression of the extent to which the actual measured curve departs from the ideal

Precision The reproducibility of the result. (Repeatability)

Accuracy The max difference between the actual value and the value indicated at the output

Range Difference between max and min values that can be measured

Response time Output state changes to a new state over a period of time

Resolution Smallest change in the input that the sensor can detect

60
Sensor Terminology/ Specifications
• Sensitivity = slope = dV/dp

(Voltage) (Voltage)

(Pressure) (Pressure)
Ideal Sensor Real World Sensor
–Linear Relationship – Non-linear relation (even with offset)

61
Sensor Terminology/ Specifications
• Non-linearity - How to handle it
• Piece-wise linear relationship
• Three different slopes

62
Sensor Terminology/ Specifications
• Non-linearity - How to handle it
• Best-fit line – Most common
• % error = how much it is going to vary

• Full scale output (FSO) = 100 Mpa

• Max error is found in terms of percentage

• Then the Error is defined as percent of FSO

• A number 1% of FSO is the error i.e 1 MPa

1 % error

100
63 Mpa
Sensor Terminology/ Specifications
• Hysteresis
• Another component of non-linearity
• History driven behavior
• Different behavior for increase/decrease of pressure
• May be due to phase change, trap charge,

• The hysteresis of a sensor cannot be adjusted with


tools or equipment; only the manufacturer can
make such corrections.

• Precision (Repeatability)
• Solution – Best fit curve
64
Sensor Terminology/ Specifications
• Drift - how voltage varies with time at one pressure point
• Reasons – thermal as well as electrical

65
Causes of Non-linearity
Non-ideal sensors Hysteresis

Drift
Repeatability issues
(Precision)

66
Sensor Terminology/ Specifications
• Non-linearity
• Check out foot-notes of the % full scale
output
specification sheets

• How to specify non-linearity


Voltage
• Parabolic model

• Best fit line

• Join last two points to fit line

• Indicate % Full scale output Pressure

67
Sensor Terminology/ Specifications
• Overall Error (Error Band)

68
Sensor Terminology/ Specifications
• Accurate - Average of sampled output is close to real value (AC
errors and noise)

• Precise - Sampled output is consistently tightly grouped with


consistent offset from real value (DC errors)

• Calibration can help us take from “Precise but inaccurate” to


“Precise and Accurate” – BIST (Built-in self test) can be used to
measure the deviation and calibrate it using software

• Imprecise and Inaccurate Sensors – smart phone to detect


gravity 1g from top to down to tell the screen which way to go
so less accurate and less precise sensor is good

69
Sensor Terminology/ Specifications
• Span/ Range
• Manufacturers specify the span or
operating range of the sensor that is
guaranteed for.

• The linear behavior is guaranteed for a


maximum pressure in this example.

• Beyond this point, there will be an


output, but the sensitivity is not
guaranteed.

70
Sensor Terminology/ Specifications
• Response - Real sensors need time to collect the signal and
response to the signal which is affected by
• Signal Conditioning
• Filtering
• Sampling rate – at what frequency should we collect the information

• Input : Step Signal (Stimulus)

• Response to input:
• Final value : final stable value required to be achieved
• Overdamped response : system is resisting and takes time/effort to
reach the final resting value
• Underdamped response: Oscillations to reach the final position
• Critically damped response: we get to the resting position as fast as
possible without any offshoot 71
Sensor Terminology/ Specifications
• We have some types of sensors, or we want some
sensors that are stiff and are overdamped

• For accelerometers, we want them to reach the


final value as quickly as possible, so they come
under category of critically damped

• And for some sensors we need underdamped


characteristics

72
Sensor Terminology/ Specifications
input

Ideal – nothing is ideal

Delay

Decay – due to leakage

Decay and delay

73
Sensor Terminology/ Specifications
• Bandwidth (BW) :
• It refers to the range of frequencies over which a
sensor can accurately detect and respond to the input
signal.
• There isn’t a universal formula that applies to
calculate all sensors bandwidth
• BW can be calculated using delay and decay time
• if we assume a signal to be composed of a various number
of frequencies, then Bandwidth is defined as the difference
between the highest frequency (fh) and the lowest
frequency (fl) of the signal.

74
Electronic Noise Sources

75
Electronic Noise Sources

76
Sensor Terminology/ Specifications
• Resolution: Smallest signal that the sensor can
resolve or produce for a particular set of operating
conditions.
• If there is no output signal, even then we can see
some activity due to noise
• Sensor output can only be detected if we can go
above the noise floor
• Noise has some frequency distribution
• Signal to Noise ratio of the signal
• Depends upon BW

77
Sensor Specifications
1.Environmental condition: Usually has limits for temperature/humidity.
These environmental factors can even have an effect on the readings and
need to be factored into the calculations. E.g. accelerometers are sensitive to
temperature and often have a temperature sensor incorporated into the
device.
2.Calibration: Essential for most of the measuring devices, as the readings
change with time.
3.Sensors can be classified based on power or energy supply requirement:
• Active sensor: Requires a power supply. Examples include IMUs, LiDAR (Light
detection and ranging), CCDs.
• Passive sensor: Examples include some RFID tags, thermistors, and temperature
dependant resistors.

78
Reading a Sensor Spec Sheet Early Smart phone accelerometer

79
Reading a Sensor Spec Sheet

80
Reading a Sensor Spec Sheet

81
Reading a Sensor Spec Sheet

82
Actuators
83
84
85
86
Analog front-end to control a motor (actuator)

• An electric motor is a rotating device whose speed is determined by the load the weight of the object
attached to the motor shaft and the DC voltage applied to it’s terminals.
• A digital to analogue converter receiving numbers from a computer and then generating an analogue
voltage that is fed to a pre amplification stage and from there to a motor driver that drives perhaps high
current and high voltage and from there to the actual motor.
• The voltage produced By a DAC can be used after proper conditioning to control the speed of an electric
motor.
• Motor driver serves as an interface between a microcontroller or other control system and the motor itself,
enabling precise control of the motor's speed, direction, and other parameters.
• If we can put all these blocks together and we can call them an actuator. 87
Actuator

• For practical purposes all the blocks after the DAC in the figure above can be represented as a single block.
89
90
Actuator vs Sensors
For every sensor there is an opposite actuator
• Light sensors measure the light coming in, LED sends light out
• Microphone measures the volume of sound coming in, and speaker sound going
out
• Button or on-off switch that detects whether you have pressed it to not. We have
a relay that turns off and on based on the electrical signal
• Cameras to capture visual information, screens to show this information
• Rotation sensors to show how much something rotates, we have stepper motors
where we control the rotation

91
Actuator vs Sensors
• How following sensors and actuators are inverse of each other
Physical Phenomenon Sensors Actuators
Temperature Thermocouple; Thermistor; Thermostat; Heater; Fan; Peltier pumps
Resistive Temperature Detectors (RTDs)
Speed Tacho-generator; Reflective/Slotted Opto-coupler AC and DC Motors
Doppler Effect Sensors Stepper Motor; Brake

Position Potentiometer; Encoders Motor


Reflective/Slotted Opto-switch Solenoid
Linear Variable Differential Transformers (LVDTs) Panel Meters
Sound Carbon Microphone Bell; Buzzer
Piezo-electric Crystal Loudspeaker
Force/Pressure Strain Gauge; Pressure Switch Lifts and Jacks
Load Cells Electromagnet
Light level Light Dependant Resistors (LDRs) Lights and Lamps
Photodiode LEDs and Displays
Photo-transistor Fibre Optics
Solar Cell
Components that make light

93
94
thanks

95

You might also like