IoT. Lecture 2. Sensors Introduction and IMU

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 27

Sensors

A gentle introduction
Definition

A sensor is a device or element that detects or


measures physical properties, events, or changes in
its environment and converts this information into
signals suitable for processing, display, recording,
or control.
Sensors are integral components in various systems,
from simple consumer electronics to complex
industrial processes and scientific instruments.
It is necessary to check:
Functionality, detection method, transduction
mechanism, output signal, accuracy and precision,
interface, application.
Sensor types: Functionality
A sensor is designed to sense or detect specific physical phenomena or environmental changes.

Environment, Electric current,


Ionizing radiation,
weather, moisture, Chemical electric potential,
subatomic particles
humidity magnetic, radio

Position, angle,
Navigation displacement, Optical, light,
Pressure
instruments distance, speed, imaging, photon
acceleration

Thermal, heat,
Sensor technology Others
temperatura
Detection method

Sensors employ different detection principles


depending on the property they are sensing…
This could involve measuring changes in
electrical resistance, capacitance, voltage,
current, frequency, magnetic fields, acoustic
waves, or optical properties, among others.
Transduction
Mechanism:

Sensors convert the detected physical


phenomenon into an electrical signal,
which can be easily processed by
electronic circuits…
This transduction mechanism is often
based on fundamental physical
principles such as piezoelectricity,
photoconductivity, thermoelectricity,
or electromagnetic induction.
Output Signal
Sensors produce an output signal that
corresponds to the measured quantity.
This signal may be analog or digital in
nature, depending on the sensor's design
and application requirements
Analog signals typically vary
continuously with the sensed parameter,
while digital signals provide discrete
values representing specific
measurement levels.
Accuracy and Precision:
Sensors are characterized by their
accuracy (closeness of measured value
to the true value) and precision
(repeatability of measurements).
Calibration and testing procedures
ensure that sensors meet specified
performance criteria under various
operating conditions.
Interface
Sensors often feature standardized interfaces for
communication with external devices or systems. This
includes analog interfaces (e.g., voltage or current
output), digital interfaces (e.g., serial communication
protocols like I2C or SPI), or wireless interfaces (e.g.,
Bluetooth, Wi-Fi, or Zigbee).
Application
Sensors are utilized in a wide range of applications
across industries such as automotive, aerospace,
healthcare, environmental monitoring, industrial
automation, robotics, consumer electronics, and more.
Different applications may require sensors with
specific characteristics tailored to their unique
operating conditions and performance requirements.
Sensor specifications
and parameters
1. Measurable Quantity: Determine the specific physical
property or parameter that the sensor needs to measure,
such as temperature, pressure, humidity, light intensity,
motion, proximity, gas concentration, etc.
2. Measurement Range: Check the range of values over
which the sensor can accurately measure the target
quantity. Ensure that the measurement range covers the
expected operating conditions of the application.
3. Accuracy: Evaluate the sensor's accuracy, which
indicates how closely the measured value corresponds to
the true value of the quantity being measured. Consider
both absolute accuracy and accuracy across the entire
measurement range.
Sensor specifications
and parameters
4. Precision/Resolution: Assess the sensor's
precision or resolution, which refers to the smallest
change in the measured quantity that the sensor can
detect and reliably report. Higher resolution
sensors provide more detailed measurement data.
5. Sensitivity: Determine the sensitivity of the sensor,
which indicates the change in output signal per unit
change in the measured quantity. A higher
sensitivity means the sensor can detect smaller
changes in the measured parameter.
6. Response Time: Check the response time of the
sensor, which is the time taken by the sensor to
detect a change in the input and produce a
corresponding output. Faster response times are
crucial for applications requiring real-time
monitoring or control.
Sensor specifications and
parameters
7. Linearity: Evaluate the linearity of the sensor's response, which
indicates how well the sensor's output corresponds to changes in
the input over its measurement range. Ideally, the sensor's
response should be linear across its entire range.
8. Environmental Conditions: Consider the environmental
conditions in which the sensor will operate, including
temperature, humidity, pressure, vibration, and exposure to
chemicals or other contaminants. Ensure that the sensor is rated
for these conditions to maintain reliable performance.
9. Calibration and Stability: Check if the sensor requires
calibration and assess its long-term stability to ensure consistent
and accurate measurements over time. Some sensors may drift
or require periodic recalibration to maintain accuracy.
10. Compatibility and Interface:
Ensure that the sensor is compatible
with the interface requirements of
the system or controller it will be
interfacing with. Consider factors
such as analog or digital interfaces,
communication protocols, signal
levels, and power requirements.
11. Size and Mounting: Consider the
physical size and mounting options of
the sensor to ensure it fits within the
available space and can be securely
installed in the application
environment.

Sensor specifications and parameters


A C C E L E R O M E T E R

EXAMPLE WITH
MPU6050

Thanks to: https://naylampmechatronics.com/blog/45_tutorial-mpu6050-acelerometro-y-giroscopio.html


Connection diagram
MPU6050
1. It is an Inertial
Measurement Unit with 6
DoF
2. It mix:
1. Accelerometer of 3 axis and
2. Gyroscope of 3 axis
3. This sensor is widely used
in navigation, goniometry,
stabilization, etc.
Acceleration and accelerometers
1. Acceleration is the change in speed per unit of
time, that is, the rate of change in speed with
respect to time:
2. Likewise, Newton's second law indicates that
in a body with constant mass, the acceleration
of the body is proportional to the force acting
on itself:
3. Accelerometers internally have a MEMS
(MicroElectroMechanical Systems) that, similar
to a mass spring system, allows acceleration to
be measured.
Acceleration and accelerometers
1. With an accelerometer we can measure this
acceleration,
1. considering that even though there is no
movement, the accelerometer will always be
sensing the acceleration of gravity.
2. With the accelerometer we can make indirect
measurements such as,
1. for example, if we integrate the acceleration in
time, we have the velocity and
2. if we integrate it again, we have the displacement,
3. in both cases needing the velocity and the initial
position, respectively.
Let’s watch something interesting

1. https://www.youtube.com/watch?v=IQ-GWWAmjAY

2. https://www.youtube.com/watch?v=7l1xiJICGus

3. https://www.youtube.com/watch?v=IQ-GWWAmjAYk

4. https://youtu.be/mPsLanVS1Q8

5. https://www.youtube.com/watch?v=1Y1Qi821n-s
MPU6050 Accelerometer and Gyroscope Module
1. Module communication is by I2C
2. The SCL and SDA pins have an on-board pull-up
resistor for direct connection to the microcontroller or
Arduino.
3. We have two I2C addresses to work:

4. The ADDR pin internally in the module has a resistor


to GND, so if it is not connected, the default address
will be 0x68.

5. The module has a 3.3V on-board voltage regulator,


which can be powered by 5V from the Arduino.
MPU6050 Accelerometer and Gyroscope Module

1. The MPU Accelerometer module has a


three-axis gyroscope with which we can
measure angular velocity and a 3-axis
accelerometer
2. with which we measure the X, Y and Z
components of acceleration.
3. The direction of the axes is indicated in
the module, which must be considered
so as not to make mistakes in the sign of
the accelerations.
Connections between Arduino and the MPU6050
Angular velocity and gyroscope
1. Angular velocity is the rate of change of angular
displacement per unit time,
2. that is, how fast a body rotates around its axis.
3. Gyroscopes use a MEMS (MicroElectroMechanical
Systems) to measure angular velocity using the
Coriolis effect
4. With a gyroscope we can measure the angular
velocity, and if the angular velocity is integrated
with respect to time,
1. the angular displacement is obtained (angular position
if it is known where the turn started)
Libraries to use
1. MPU6050: Link

2. I2C Library: Link

3. It is required to install it in the Arduino IDE


Yaw, pitch and roll
Yaw, pitch and roll

CALCULATE TOTAL ACCELERATION CALCULATE TILT ANGLE (PITCH): CALCULATE TILT ANGLE (ROLL): YAW ESTIMATION:
THE PITCH ANGLE (Θ) REPRESENTS THE ROLL ANGLE (Φ) REPRESENTS
THE ANGLE OF INCLINATION THE ANGLE OF INCLINATION
ABOUT THE X-AXIS (TILT FROM THE ABOUT THE Y-AXIS (TILT FROM THE
HORIZONTAL PLANE) HORIZONTAL PLANE)

You might also like