SENSORS AND ACTUATORS
ANALOG VS. DIGITAL SIGNALS
• analog signal
• various in a smooth way
over time
• digital signal
• maintains a constant level
then changes to another
constant level
ANALOG VS DIGITAL
• Analog means continuous
• Analog parameters have continuous range of values
- Example: temperature is an analog parameter
• Temperature increases/decreases continuously
• Like a continuous mathematical function, No discontinuity points
• Other examples?
ANALOG VS DIGITAL
• Digital means using numerical digits
• Digital parameters have fixed set of
discrete values
• Example: month number {1, 2, 3, …, 12}
• Thus, the month number is a digital parameter (cannot be 1.5!)
• Other examples?
ANALOG VERSUS DIGITAL SYSTEM
• Are computers analog or digital systems?
Computer are digital systems
• Which is easier to design an analog or a digital system?
Digital systems are easier to design, because they deal with a limited set
of values rather than an infinitely large range of continuous values
• The world around us is analog
• It is common to convert analog parameters into digital form
• This process is called digitization
DIGITIZATION OF ANALOG
SIGNALS
• Digitization is converting an analog signal into digital form
• Example: consider digitizing an analog voltage signal
• Digitized output is limited to four values = {V1,V2,V3,V4}
Voltage
Dr. Zaid Bataineh
Time
Voltage
Time
• Some loss of accuracy, why?
• How to improve accuracy? Add more voltage values
input analog
ADC AND DAC CONVERTERS signals
Analog-to-Digital
• Analog-to-Digital Converter (ADC) Converter (ADC)
input digital
signals
• Produces digitized version of analog
Digital System
- Analog input => Digital output
output digital
signals
• Digital-to-Analog Converter (DAC)
Digital-to-Analog
Converter (DAC)
• Regenerate analog signal from digital
output analog
signals
• Digital input => Analog output
INTERFACING TO ANALOG
WORLD
• Transducer: A device that converts the
physical variable into analog electrical signal
(current or voltage)
• A thermister produces continuously variable
voltage proportional to temperature
• Flowmeter to measure flow
• Tachometer for speed measurement
• Piezoelectric transducer for measuring pressure
• Actuator: is a device to control the physical
variable
• electrically controlled valve
DIGITAL TO ANALOG CONVERTER (DAC)
V+ref ( High Reference Voltage)
• Output voltage = Vout(n)
Input code n
(NMAX bit Binary code)
0110001
0100010 NMAX
0100100 (bit length)
0101011 DAC
:
:
V-ref (Low Reference Voltage)
Calculating the Output Voltage
•For an 8-bit multiplying DAC like the one in previous
slide, the output voltage is given by the following
equation, where Din is the number (between 0 and 255)
present on the digital inputs:
Vref
Vout Din
256
•This gives the ideal value. In practice, various factors can
cause the actual value to deviate from this predicted
value.
OUTPUT VOLTAGE
Vref is 10V.
To get 5V output voltage, for a 12-bit DAC, the required binary
value is
(OutputVoltage – LowerRange)
= ------------------------------------- * FFF
Full Scale
= ( (5-0 )/10) * FFF
= 7FF
i.e. 0 V = 000
5 V = 7FF
10 V = FFF
Resolution
➢ The number of bits making up the input data word that will
ultimately determine the output step voltage as a percentage of full-
scale output voltage.
• Number of bits, n
• Number of output codes, = 2n, or number of steps in the output,
= 2n − 1
• Percentage resolution, = 1 / (2n − 1), expressed as a
percentage
n
• Step size, = Vref / 2 − 1
Resolution
➢ An 8 bit input and 10V A/D (D/A) output has 255 steps of
0.039V
between 0 and 10V.
▪Example: Calculate the resolution of an 8-bit DAC.
Solution:
Resolution = 8 bits
1 1
Percentage resolution = 100% 100% 0.381%
2 1
8
255
Resolution: Examples
Formula 4-bit DAC 10-bit DAC
Number of bits n
Number of output 2n
codes
Number of steps in 2n−1
the output
Percentage 1 / (2n−1)
resolution
Step size (assuming Vref / 2n−1
5 V reference
voltage)
Accuracy
Due to the incremental nature of the digital input word, an error can be tolerated but
it should not exceed ½resolution.
Example. The error at full-scale for an 8-bit DAC with 10V maximum output is
50mV. Calculate the error and compare it with the resolution.
Solution: Error =
Resolution = ; ½ Resolution = 0.195%
0.05
100% 0.5%
10
1
100% 0.391%
256
ANALOG TO DIGITAL CONVERSION
ADC
V+ref
•
Input voltage = V)
output code = n
0110001
N (MAX) bit 0100010
ADC 0100100
0101011
:
:
:
V-ref
INPUT VOLTAGE
For differential analog inputs, range is –10V to +10V
For single ended analog input, range is 0V to 10V
Let us say input voltage is 5V for differential analog input range of
-10V to +10V. For a 16-bit ADC, the converted binary value is
(InputVoltage – LowerRange)
= ------------------------------------- * FFFF
Full Scale
= ( (5-(-10)) )/20) * FFFF
= BFFF
i.e. -10 V = 0000 + 5V = BFFF
- 5 V = 3FFF +10V = FFFF
0 V = 7FFF
RESOLUTION
• The resolution of an ADC is determined by the reference input and by the
word width
• Resolution can be improved by reducing the reference input
• Changing that from 5V to 2.5V gives a resolution of 2.5/256, or 9.7mV.
However, the maximum voltage that can be measured is now 2.5V instead
of 5V.
• The only way to increase resolution without10reducing the range is to use
an ADC with more bits. A 10-bit ADC has 2 , or 1024 possible output
codes
• So the resolution is 5V/1024, or 4.88mV
• A 12-bit ADC has a 1.22mV resolution for this same reference
SAMPLING RATE
Analog
input Sampling
signal circuit
Sampling
pulses
Sampled
version of
input signal
In order to recover a signal, the sampling rate must be greater
than twice the highest frequency in the signal.
fsample > 2fa(max
SENSORS AND ACTUATORS
• I/O is a commonly used term referring to data input and output
Devices
• Disk drives, video displays, keyboards and mice are
• In the automation industry, the term I/O refers to a device that
permits a computer to monitor and control physical elements in
the physical world
• To allow systems to reach into the physical world, I/O units are
coupled with sensors and actuators
SENSORS AND ACTUATORS
• Sensors
are electronic devices attached to inputs; they convert quantities
in the physical space into quantities computers understand
• Actuators
attached to outputs, are devices that translate computer
commands into responses in the physical world.
SPECIFICATIONS OF SENSORS
• Accuracy: error between the result of a measurement and
the true value being measured.
• Resolution: the smallest increment of measure that a device
can make.
• Sensitivity: the ratio between the change in the output signal
to a small change in input physical signal. Slope of the input-
output fit line.
• Repeatability/Precision: the ability of the sensor to output
the same value for the same input over a number of trials
Dr. Zaid Bataineh ELE 574
24 SENSORS
• Sensors can be classified into two basic categories:
1. Analog (continuous)
• Examples: thermocouple, strain gauges,
potentiometers.
2. Discrete
• Binary (on/off)
• Examples: Limit switch, photoelectric switches.
• Digital (e.g., pulse counter)
• Examples: photoelectric array, optical encoder.
SENSORS
• Optical sensors: photoconductors, diodes, transistors, Charge-
coupled device (CCDs).
• Temperature sensors: thermistor, diode, thermocouple
(thermoelectricity)
• Magnetic sensors: Hall sensor, Flux-gate sensor, SQUID
(superconducting quantum interface device) for measuring small
values of magnetic field.
• Mechanical sensors: strain gauge, pressure sensor,
accelerometer, gyroscope
• Acoustic sensors: microphones, piezoelectric sensors
• Chemical sensor: gas sensors, pH-sensor
HUMAN SENSING AND ORGANS
• Vision: eyes (optics, light)
• Hearing: ears (acoustics, sound)
• Touch: skin (mechanics, heat)
• Odor: nose (vapor-phase chemistry)
• Taste: tongue (liquid-phase chemistry)
SLOTTED OPTICAL SWITCH
• A LED is mounted in a plastic housing, facing a phototransistor,
but separated by a gap
• If something moves into the gap, it blocks the light path
between the LED and the phototransistor.
• Slotted switches are often used to detect motor speed by
placing a slotted wheel on the motor shaft
OPTICAL AND MAGNETIC
SENSORS
• Sensors provide the windows through
which microprocessor-based systems
can observe their environment
• Optical and magnetic sensors are used
to detect the presence, absence, or
motion of an object
• Typical applications include sensing
when a door is open or closed, or
measuring the speed of a rotating shaft
REFLECTIVE SENSOR
• Typically used to detect motor motion by painting or
anodizing the motor shaft black
PHOTORESISTOR
• While there are a variety of light sensors, a very popular one is
the photoresistor in that it is easy to use and inexpensive.
• As the name implies, it is a resistor that reacts to light. The
active ingredient Cadmium Sulfide (CdS) allows electrons to
flow more easily when light energy hits it, thus lowering it
resistance (opposition to current flow).
• The brighter the light
the lower the resistance.
BASIC CIRCUIT
• As the photoresistor’s resistance
changes with light exposure, so does
the voltage at Vo. As R gets larger,
Vo gets smaller, and as R gets
smaller,Vo gets larger.
V0
• Vo is what the PIC I/O pin is R
detecting when it is functioning as
an input.
HALL EFFECT SENSOR
• Transducer that varies its output voltage in
response to changes in magnetic field
• Hall sensors are used for
• proximity switching
• positioning
• speed detection
• current sensing applications
• Accelerometer: Analog device used to measure vibration
and shock.
• Ammeter: Analog device that measures the strength of
electric current
• Bimetallic thermometer: Analog
temperature measuring device consisting
of bimetallic coil that changes shape in
response to temperature change.
• Fluid flow sensor: Analog measurement of liquid flow rate.
• Fluid flow switch: Binary switch activated by increase in fluid
pressure.
• Manometer: Analog device used to measure pressure
of gas or liquid.
• Ohmmeter: Analog device that measures electrical
resistance.
• Optical encoder: Digital device used to measure
position and/or speed, consisting of a slotted disk
separating a light source from a photocell.
• Photoelectric sensory array: Digital sensor consisting of linear
series of photoelectric switches. Array is designed to indicate
height or size of objects.
• Photoelectric switch: Binary noncontact sensor (switch)
consisting of emitter (light source) and receiver (photocell)
triggered by interruption of light beam.
• Photometer: Analog sensor that measures illumination and light
intensity.
• Piezoelectric transducer: Analog device based on piezoelectric
effect of certain materials in which an electric charge is
produced when the material is deformed. Can be used to
measure force, pressure, and acceleration.
• Potentiometer: Analog position sensor consisting of resistor
and contact slider. Position of slider on resistor determines
measured resistance.
• Proximity switch: Binary noncontact sensor is triggered when
nearby object induces changes in electromagnetic field.
• Radiation pyrometer: Analog temperature-measuring device
that senses electromagnetic radiation.
• Resistance-temperature detector: Analog temperature-
measuring device based on increase in electrical resistance of a
metallic material as temperature increases.
• Strain gauge: Widely used analog sensor to measure force,
torque, or pressure.
• Tachometer: Analog device consisting of DC generator that
produces an electrical voltage proportional to rotational
speed.
• Thermistor: Analog temperature-measuring device based
on change in electrical resistance of a semiconductor
material as temperature increased.
• Thermocouple: Analog temperature-measuring device based
on thermoelectric effect.
• Ultrasonic range sensor: Used to measure distance or
simply to indicate presence of object.
Ultrasonic Transducer
• Ultrasonic transducer (piezoelectric transducer) is
device that converts electrical energy into ultrasound
• Upon receiving sound echo (pressure wave) back
from surface, ultrasound transducer will turn sound
waves into electrical energy which can be measured
and displayed
• Ultrasound are sound waves above normal range of
human hearing (greater than 20K hertz).
Ultrasonic Transducer
▪Since piezoelectric crystal generates voltage when force is applied
to it, same crystal can be used as an ultrasonic generator and
detector
▪ Some systems use separate transmitter and receiver components
while others combine both in single piezoelectric transceiver
Pulse echo
sensor
Transmit-Receive
sensor
Ultrasonic Transducer
• Sound is transmitted through propagation of pressure
in air
• Speed of sound in air is normally 331 m/sec at 0oC
and 343 m/sec at 20oC for dry air
• Digital signal processor embedded in sensor
calculates distance between sensor and object
Ultrasonic Transducer
▪ X = vsound . t
▪ Where:
▪ Vsound is known
▪ t = (time of flight)
▪ X is distance between sensor head and object
▪ Range of sensor varies between 5 cm to 20 m
▪ Sensor is not appropriate for very short distance
measurements
▪ Frequency response (distance measurement update rate)
varies with distance measured
• In general, it is about 100 Hz
Ultrasonic Transducer
▪ Technology can be used for measuring:
• wind speed and direction (anemometer),
• speed through air or water
• fullness of tank
• amount of liquid in tank
• sensor measures distance to surface of fluid.
• Other applications include:
• in robots for obstacle avoidance
PING))) ULTRASONIC DISTANCE
SENSOR
Dr. Zaid Bataineh ELE 574
INPUT/OUTPUT RELATION OF
SENSORS
S f (s )
where S = output signal; s = stimulus; and f(s) = functional relationship
For binary sensors: S = 1 if s > 0 and S = 0 if s < 0.
The ideal functional form for an analogue measuring device is a simple proportional
relationship, such as:
S C ms
where C = output value at a stimulus value of zero
and m = constant of proportionality (sensitivity)
EXAMPLE
• The output voltage of a particular thermocouple sensor is
registered to be 42.3 mV at temperature 105C. It had
previously been set to emit a zero voltage at 0C.
Determine
• (1) the transfer function of the thermocouple, and
• (2) the temperature corresponding to a voltage output of
15.8 mV.
SOLUTION
S C ms (1)
42.3 mV = 0 + m(105C) = m(105C)
or m = 0.4028571429
S = 0.4 (s)
SOLUTION
(1)
S C ms 42.3 mV = 0 + m(105C) = m(105C)
or m = 0.4028571429
S = 0.4 (s)
(2)
15.8 mV = 0.4 (s)
15.8 / 0.4 = s
s = 39.22C
ACTUATORS
Actuators: are hardware devices that convert a
controller command signal into a change in a
physical parameter.
• The change is usually mechanical (e.g., position or
velocity).
TYPES OF ACTUATORS
1. Electrical actuators
• Solenoids
• Relay
• Electric motors (linear or rotational)
• DC servomotors
• AC motors
• Stepper motors
2. Hydraulic actuators
• Use hydraulic fluid as the driving force
3. Pneumatic actuators
• Use compressed air as the driving force
OTHER ACTUATORS
• Solenoids: a movable plunger inside a stationary wire coil.
• Used to open and close valves in fluid flow systems, e.g.,
chemical processing equipment.
OTHER ACTUATORS
• Electromechanical relays: is an on-off electrical switch.
• Operated by low current levels. Hence, safer to use.
DIFFERENCE BETWEEN RELAY AND
SOLENOID
• Solenoids: Operate similar to relays.
• Relays controls electrical current
• Solenoid controls electrical movement.
ELECTRIC MOTORS
Motors convert electric energy
to mechanical motion.
Either an AC or DC electrical
energy source serves as the
input to the motor.
Electric motors
➢The type of motor chosen for an application depends on the
characteristics needed in that application. These include:
◦ How fast you want the object to move,
◦ The weight, size of the object to be moved,
◦ The cost and size of the motor,
◦ The accuracy of position or speed control needed.
The different types of motors possess different operating
characteristics.
◦ Heavy Industrial applications: AC motors
◦ Mobile robotics & hobby robots: dc motor, dc servo motor, and
stepper motors
DC MOTORS
• DC motors are widely used:
• Convenience of using direct current.
• E.g. motors in automobiles.
• Linear Torque-Speed relationship.
• One special type of DC motors is Servomotors.
• A feedback back loop is used to control speed.
AC MOTORS
• Most used in industry.
• Advantages:
• Higher power supply
• Ease of maintenance
• Two types:
• Induction motor
• Synchronous motor
STEPPER MOTORS
• Provides rotation in the form of discrete
angular displacement (step angles).
• Each step angle is actuated by a discrete
electrical pulse.
• Are used in open loop control systems.
STEPPER MOTORS
Step angle is given by: : 360
ns
where ns is the number of steps for the stepper motor (integer)
Total angle through which the motor rotates (Am) is given by:
where np = number of pulses received by the motor.
2f p Am n p
Angular velocity is given by: where fp = pulse frequency
ns
60 f p
Speed of rotation is given by: N
ns
EXAMPLE
• A stepper motor has a step angle = 3.6.
• (1) How many pulses are required for the motor to rotate through
ten complete revolutions?
• (2) What pulse frequency is required for the motor to rotate at a
speed of 100 rpm (rev/min)?
SOLUTION
360
3.6 = 360 / ns; 3.6 (ns) = 360;
ns
ns = 360 / 3.6 = 100 step angles
Am n p
60 f p
N
ns
(1) Ten complete revolutions:
10(360) = 3600 = Am
Therefore np = 3600 / 3.6 = 1000 pulses
SOLUTION
360
3.6 = 360 / ns; 3.6 (ns) = 360; ns = 360 / 3.6 = 100 step angles
ns
Am n p (1) Ten complete revolutions: 10(360) = 3600 = Am
Therefore np = 3600 / 3.6 = 1000 pulses
60 f p
N
ns
(2) Where N = 100 rev/min:
100 = 60 fp / 100
10,000 = 60 fp
fp = 10,000 / 60 = 166.667 = 167 Hz
MOTOR CONTROL
• PWM
• We chose to use Pulse Width Modulation to
control the speed of the motors because it is
simple to implement.
• H-Bridge
• H-bridges will be used to control the direction
and the speed of the motors.
PULSE WIDTH MODULATION
➢What is it?
• Output signal alternates between on and off within specified
period
• Controls power received by a device
• The voltage seen by the load is directly proportional to the
source voltage
DEFINITIONS
• Duty Cycle (D): on-time / period
• Vlow is often zero
VAVG DVHI (1 D)VLOW
Like Low Voltage
(slow)
Like High Voltage
(fast)
APPLICATIONS TO DC MOTORS
• The voltage supplied to a DC motor is proportional to
the duty cycle
• Both brushed and brushless motors can be used with
PWM
• Both analog and digital control techniques and
components are available
Dr. Zaid Bataineh ELE 574
72
Dr. Zaid Bataineh ELE 574
73 H-BRIDGE BASICS
• H-Bridges are used to control the speed and direction of a motor.
• DC motors only have two leads. The direction it spins is
determined by which terminal has power applied and which is
connected to ground.
• An H-bridge consists of four switches (Transistors) and
depending on which two are closed, allow the motor to operate in
either direction
H-BRIDGE BASICS
• Allows low voltage logic
while driving external
power to motors.
• Easily control current in
both directions, allowing
motors to move forwards
and backwards.
• Useful for DC motors,
stepper motors, servos,
solenoids, etc.
H-BRIDGE BASICS
• -EN pins enable output (1 EN pin per pair)
• -A’s are control inputs
• -Y’s are outputs
• -Vcc1 is circuit logic voltage
• -Vcc2 is the motor supply
• -Grounds go to ground
H-BRIDGE BASICS