Sensors - which one to use
Summary
TLDRThis video script offers an extensive guide to various sensors compatible with Arduino and other microcontrollers, perfect for project enthusiasts. It covers a range of sensors from light-based to movement detectors, explaining their applications and providing example code. The script also distinguishes between sensors and detectors, emphasizing the importance of each in creating interactive projects. Viewers are encouraged to subscribe for more informative content and support the creator on Patreon.
Takeaways
- πΉ The video provides an overview of various sensors suitable for use with Arduino and other microcontrollers.
- π The presenter categorizes sensors into groups such as light-related, magnetic, pressure, gyro, acceleration, and general-purpose sensors.
- π A color sensor based on the TCS3200 chip is introduced, which can detect red, green, and blue colors by applying white light and sensing the reflected frequency.
- β€οΈ A heart rate sensor is demonstrated, which combines an optical heart rate sensor with an amplification circuit for reliable pulse readings.
- π The PIR (Passive Infrared Radiation) sensor is explained, which detects movement by sensing changes in infrared radiation.
- π Infrared and laser-based distance sensors are showcased, which use reflected light to measure distances accurately.
- π₯ An infrared sensor is used to detect fire by sensing the high amount of infrared light emitted by flames.
- π The LDR (Light Dependent Resistor) is introduced, which changes its resistance based on the light intensity it receives.
- π§ IMU (Inertial Measurement Unit) modules and a magnetometer are presented for detecting orientation, angle, and magnetic fields.
- π‘οΈ Atmospheric pressure sensors are discussed for measuring altitude and pressure, useful for weather stations or drones.
- π₯ Gas sensors are mentioned for detecting changes in air composition, which can indicate air quality or the presence of specific gases.
- πΆ An ultrasonic distance sensor is explained, which uses sound waves to measure distances to objects.
- π‘οΈ Thermocouple and thermistor sensors are introduced for temperature measurement, with the thermocouple being suitable for high-temperature environments.
- π A current sensor is demonstrated, which measures the electrical current used by a load when connected in parallel.
- 𧲠A Hall effect sensor is presented for detecting magnetic fields, useful in various applications like switches or encoders.
- π’ An ADC (Analog-to-Digital Converter) is highlighted for high-precision analog readings, offering 16-bit resolution for various applications.
Q & A
What is the main purpose of the video?
-The main purpose of the video is to introduce various types of sensors that can be used with Arduino or other microcontrollers, provide example code for each, and discuss their applications.
What is the difference between a sensor and a detector as explained in the video?
-A sensor is the device that gives information or data according to the surroundings or situation, while a detector is a device, such as an Arduino, that processes the sensor's data to give a detection output, indicating if something is or is not present.
What type of sensor is used to detect movement in the video?
-A PIR (Passive Infrared Radiation) sensor is used to detect movement by sensing changes in infrared radiation.
How does the color sensor based on the TCS3200 chip work?
-The color sensor applies white light and senses the response frequency of each color that is reflected. Different colored objects absorb different frequencies, allowing the sensor to detect the color.
What is the purpose of the heart rate sensor in the video?
-The heart rate sensor combines an optical heart rate sensor with an amplification and noise-cancellation circuit to provide reliable pulse readings.
How does the infrared distance sensor measure the distance to an object?
-The infrared distance sensor sends an infrared beam, detects the reflected beam, and measures the distance based on the angle at which the light touches the sensor.
What is the VL53L0 chip used for in the video?
-The VL53L0 chip is used in a laser-based distance sensor to measure distances up to 2 meters with high precision.
What is the function of the direct infrared sensor in the video?
-The direct infrared sensor uses an infrared LED to send light and a photo transistor to detect the reflected light. It can be used as a switch or to detect the presence of an object.
How does the LDR (Light Dependent Resistor) work?
-The LDR changes its resistance value according to the amount of light it receives, which can be measured by creating a voltage divider and observing the voltage drop.
What is the purpose of the IMU (Inertial Measurement Unit) module in the video?
-The IMU module, such as the MPU6050 or MPU9265, senses gyro forces and accelerations, which can be used to calculate angles and detect movements or changes in orientation.
How does the magnetometer sensor work?
-The magnetometer sensor, like the HMC5883, measures the Earth's magnetic field, which can be used to create a compass and determine orientation or direction.
What is the atmospheric pressure sensor used for in the video?
-The atmospheric pressure sensor measures air pressure to determine altitude or to be used in weather station projects.
How does the gas sensor detect changes in the air quality?
-The gas sensor detects changes in the normal air percentage of gases, which can indicate the presence of specific gases or air quality changes.
What is the principle behind the ultrasonic distance sensor?
-The ultrasonic distance sensor sends a sound wave, measures the time it takes for the wave to bounce back, and calculates the distance based on the speed of sound.
How does the thermocouple voltage sensor measure temperature?
-The thermocouple creates a small voltage drop when heated, and by knowing the temperature versus voltage drop relation, the sensor can measure temperature.
What is the function of the thermistor in the video?
-The thermistor is a temperature-dependent resistor that changes its resistance value with temperature changes, allowing temperature measurement when used with a voltage divider.
How does the current sensor module work?
-The current sensor module, using the MAX471, measures the current that a load uses when connected in parallel with it.
What is theιε°δΌ ζε¨ (Hall sensor) used for in the video?
-The Hall sensor detects magnetic fields and can be used as a switch or an encoder on a motor shaft, providing a linear output based on the magnetic field strength.
What is the purpose of the 8-bit ADC mentioned in the video?
-The 8-bit ADC is used for analog-to-digital conversion, providing 256 points for a range from 0 to 5 volts, but the video also mentions a 16-bit ADC for higher precision.
How does the 16-bit ADC improve precision in analog readings?
-The 16-bit ADC provides 65,536 points for a range from 0 to 5 volts, offering a resolution of only 75 microvolts, which is much more precise than a standard 10-bit converter.
Outlines
π Introduction to Sensor Types for Arduino Projects
The script introduces a variety of sensors suitable for use with Arduino and other microcontrollers. It aims to provide examples, sample code, and discuss the applications of each sensor. The narrator emphasizes the difference between sensors, which gather data from the environment, and detectors, which process this data to indicate the presence or absence of certain conditions. The video is sponsored by JLCPCB, offering affordable PCB services, and encourages viewers to subscribe for future content.
π Exploring Light-Related Sensors and Their Applications
This section delves into various light-related sensors, including a color sensor based on the TCS3200 chip, a heart rate sensor with an optical detector, and a PIR (Passive Infrared Radiation) sensor for motion detection. The script explains how these sensors work, for instance, the color sensor analyzing reflected light frequencies and the PIR sensor detecting changes in infrared radiation. It also mentions the need for additional software like Processing for certain sensors and provides schematics and code for testing these sensors with Arduino.
π‘ Discussing Advanced Sensor Modules for Motion and Environment Sensing
The script moves on to discuss more complex sensors such as the IMU (Inertial Measurement Unit) modules, which can detect gyro forces and accelerations, and magnetometers for measuring the Earth's magnetic field. It also covers atmospheric pressure sensors for altitude measurements and gas sensors for detecting changes in air composition. Each sensor's functionality is explained, along with potential applications like drone navigation, weather stations, and air quality monitoring. The importance of using specific libraries and the process of connecting these sensors to Arduino are highlighted.
π§ General Purpose Sensors and Their Versatile Uses
The final part of the script covers a range of general-purpose sensors, including distance sensors using ultrasonic pulses, thermocouples and thermistors for temperature measurement, current sensors for measuring electrical load, and Hall effect sensors for detecting magnetic fields. The script provides insights into how these sensors can be used in various projects, such as creating a POV clock or an electronic speed controller. It also mentions the use of an ADC (Analog-to-Digital Converter) for higher precision in analog readings. The video concludes by encouraging viewers to support the project on Patreon and to engage with the content by subscribing, liking, and sharing.
Mindmap
Keywords
π‘Sensors
π‘Arduino
π‘Microcontrollers
π‘Digital Output
π‘Analog Output
π‘I2C Communication
π‘Magnetic Sensor
π‘Gyro Sensor
π‘Atmospheric Pressure Sensor
π‘Thermistor
π‘Current Sensor
π‘Analog-to-Digital Converter (ADC)
Highlights
Introduction to a variety of sensors compatible with Arduino and other microcontrollers.
Explanation of the difference between sensors and detectors, emphasizing the role of the sensor in data collection and the detector in processing.
Demonstration of a movement detector module using a PIR (Passive Infrared Radiation) sensor to detect changes in infrared radiation for motion sensing.
Overview of light-related sensors, including a color sensor based on the TCS3200 chip that senses reflected frequencies of red, green, and blue colors.
Introduction to a heart rate sensor that combines optical sensing with amplification and noise cancellation for reliable pulse readings.
Discussion on the use of PIR sensors for detecting movement and their applications in various projects such as lighting and alarms.
Explanation of infrared distance sensors and their use in measuring distances with high accuracy, suitable for projects like 3D scanners.
Introduction to a laser-based distance sensor with the VL53L0 chip, highlighting its small size and ability to measure distances up to 2 meters.
Description of an infrared sensor used for detecting the presence of objects and its potential applications in switches and remote controls.
Presentation of an LDR (Light Dependent Resistor) and its use in detecting light changes for applications like light-following robots.
Overview of IMU (Inertial Measurement Unit) modules like the MPU6050 and MPU9265 for sensing gyro forces and accelerations.
Introduction to a magnetometer for measuring the Earth's magnetic field, useful for creating compasses and drone navigation.
Discussion on atmospheric pressure sensors for measuring altitude and their potential use in weather stations and drones.
Overview of gas sensors for detecting specific types of gases or changes in air quality, with demonstrations of their sensitivity to gas leaks.
Explanation of ultrasonic distance sensors and their method of measuring distances by timing the echo of a sound wave.
Introduction to thermocouple voltage sensors for measuring temperatures in high-temperature environments up to 700 degrees.
Description of thermistors as temperature-dependent resistors for temperature measurement in projects requiring precise temperature sensing.
Overview of current sensors using the MAX471 for measuring the current used by a load, useful for projects involving power management.
Introduction to Hall effect sensors for detecting magnetic fields, with applications in switches and encoders for motor shafts.
Discussion on the use of 16-bit ADCs for high-precision analog readings, highlighting their advantage over the 10-bit ADCs in Arduinos.
Transcripts
if you remember a few weeks ago I've
made a video about types of displays
that you could use in your project
well I like to do the same but with
sensors that you could use with Arduino
or other microcontrollers obviously
there are a lot of sensors and I can get
them all but I would like to show you
the sensors that I have around my
workshop show you an example code for
each and talk about the use of each of
these sensors we have a lot of sensors
and some of these have a digital output
or an analog output or some sort of I
square C or SPI communication this will
be another basic video but in this way
you could make an idea of what projects
you could start with an Arduino and some
sensors I hope this will help beginners
or for those who are not beginners well
see some more sensors that we have on
the market before we start make sure you
hit the subscribe button and the
notification bell in order to see my
future videos also thanks to all my
patrons for the support so let's get
started
[Music]
this video is sponsored by gel CPCB
that offers the most economic prices for
PCB services right now with only two
dollars for ten PCBs of ten by ten
centimeters the finish of their PCB is
very professional and high quality so
just upload the Gerber files to GL CPC
b.com select the thickness the size the
quantity and so on and place your order
for amazing prices what's up my friends
welcome back so I have a bunch of
sensors here my table a breadboard my
oscilloscope and an Arduino for tests I
won't go with each other we know code
step by step but I'm sharing below the
schematic for each example and the code
with comments for each line so make sure
you read that before uploading the code
so what could be a sensor I mean even a
push button could send something it
could detect if I push the button or not
that's pretty obvious but we don't
usually refer to a push button as a
sensor more as a detector so a detector
is the result after the sensor process
to say if something is or is not for
example this entire module is a
so-called movement detector if it
detects movement it gives a high output
if we don't have movement the output is
low so we couldn't call this a sensor
but inside this module we have a PIR
sensor or a passive infrared radiation
sensor this will sense the amount of
infrared radiation and give that amount
to an integrated chip this one here and
that will calculate the difference and
say if there was movement or not so the
detection process needs a sensor a
device or module that could sense the
events or changes from the environment
and then send that information so let's
just make the difference between the
sensor and a detector the sensor is the
device itself that gives information or
data according to the surroundings or
situation and the detector will be a
device so let's say an Arduino for
example that will give the detection
output I've tried to separate my sensor
in three packs here I have those who are
light related sensors then I have the
magnetic the pressure the gyro and
acceleration sensors and this final
group well is just general sensor with
all kind of purposes
let's start with this back here first we
have a color sensor that is based on the
TCS 3200 chip with photo dial turns for
red green and blue colors
this module will apply white light and
sense the response frequency of each
color that is reflected of course a red
object will absorb all the colors but
the red one and so on so you should run
this example that will print the
response for each color and place a red
green and blue color in front of the
sensor and note on the ranges of each
color so you could then detect the
colors for example here I place the blue
side of this Ruby cube and I can see
that a blue response is getting lower
note down the values for each color you
have the schematic an example code and
the full tutorial about this below okay
guys next we have this heart pole sensor
it combines a simple optical heart rate
sensor with an amplification and noise
cancellation circuit making this fast
and easy to get reliable pulse readings
you will also need to install processing
for this example make the connections
and upload the Arduino code to the
Arduino then run the processing and get
the serial data from the Arduino and we
could print the heart pulses to the
screen this is pretty nice right
ok guys next we have the PIR sensor or a
passive infrared radiation sensor
detects radiation changes and since our
bodies radiate heat in the form of
infrared radiation we can detect
movement by detecting these changes in
the infrared radiation so make the
connections to the Arduino and run the
example code the sensor will give the
high output each time it detects
movement in this example I turn on this
led each time that I detect movement as
you can see here I move my hand and I
turn on the LED this sensor could be
used in so many application where you
could turn on lights set an alarm
activated by movement and so on
ok the next light based sensor is this
infrared distance sensor as you can see
infrared light is used very often that
is because we are usually already
surrounded by visible light and that
will result in a lot of noise
okay this module will send an infrared
beam then it detects the bounce beam of
light and depending on where the light
touches the sensor it can detect the
bounce angle and by that the distance to
the object these sensors can be quite
accurate I have one that goes from 15
centimeters up to 1 meter and another
one that goes from 1 centimeter to 10
centimeters it will give an analogue
output according to the distance here I
have it connected to my low scope and as
you can see by moving an object in front
of the sensor the output value will
change I've used this kind of sensor in
my 3d scanner project since it has some
decent precision when measuring small
distances connected to an Arduino and a
plot example code and you could bring
the distance to the serial monitor or to
the LCD screen you will need the
distance to voltage graph in order to
know how to map the distance in the
Arduino code read the code for more ok I
also have this laser based distance
sensor with the VL 53 L 0 chip this is
one of the smallest packages on the
market for a laser based distance sensor
as you can see it is very small so you
could place this one on any kind of PCBs
and detect the distances or gestures it
uses a nice cuesta communication to send
the data and it could measure up to 2
meters in perfect conditions it measures
the distance by detecting the reflected
laser beam connect it to the Arduino
install the needed library that you
could also find below and run the code
that will print a distance in
millimeters to the serial monitor or to
the LCD screen if you have one this
module has a very good precision for
distance so have this chip in mind when
preparing your project it is also quite
cheap just a few dollars another light
weight sensor is this direct infrared
sensor this module has an infrared LED
that will send an infrared light then we
have the photo transistor that will
detect the light it reflects on an
object in front of it this kind of
sensor could also be used as a switch as
these small modules do where the emitter
and the receiver are one in front of
each other and could attack when
something is in between them I've used
this sensor in a lot of projects such as
the encoded DC motor to come
apps or the infrared remote to send and
receive data using infrared light as you
can see almost lost hope more infrared
light we get the higher will be the
output or if we have the module into
digital mode it will switch to high when
we are close enough to the sensor this
module has an amplifier and by setting
the threshold with this potentiometer we
could detect stuff
for example fire emits a lot of infrared
light so we could sense fire if we want
download the example code and upload it
to the Arduino and you could print the
analog output to the serial monitor or
to the LCD screen and then you could
activate stuff for example turn on LED
when we detect fire finally the last
light based sensor is this LDR or light
dependent resistor this resistor will
change its value according to the amount
of light that it receives so if I create
a voltage divider and apply 5 volts to
it we could measure the voltage drop and
see how it changes according to the
light we can connect this to an Arduino
and detect the visible light and maybe
create a light falling robot or any
other idea that you have you have the
schematic and a simple example code
below together with the full tutorial on
my webpage electronic comm ok guys now
we have this other group here I have an
IMU module and a magnetometer we've seen
this immune module in a lot of past
tutorials this is the APU 6050 and I
also have the APU 9265 module it can
sense gyro forces and accelerations with
these values we could calculate the
angle as well below this video you have
a few examples this module uses a nice
Christi communication to send the data
to the microcontroller so connected to
the Arduino and you could for example
print the orientation angle to the Shura
monitor or to the LCD screen you could
also print the raw values of
accelerations or gyro data you could use
this sensor with drones that must fly
horizontal also you could detect
accidents by sensing the accelerations
and when the peak is detected well that
must be a fast change of acceleration so
it might be an accident
you could also detect if something moved
if you detect gyro or acceleration
changes that means that the object on
which the module is placed moved this is
a very interesting module okay guys I
also have this magnetometer this module
is the h MC
58 83 and it uses a nice racy
communication to send the data this
measures the earth magnetic field so we
could create a compass and attack where
is north and by that orient us in space
this could also be used with drones
together with a GPS module so we could
know the location of the drone you could
also use this to make measurements of
the earth magnetic field
connect the I square see pins as in the
schematic below and upload the example
code that will print the magnetic values
and that's it ok guys now I have this
atmospheric pressure sensor it will
measure the pressure so with that we
could get the altitude the higher in the
air we are the lower will be the
pressure since we have less air above us
pushing us downwards the module has a
nice Cristy communication as well so
connect that to the Arduino and then
install the needed libraries that you
could also find below run the code that
will print the pressure and approximated
altitude you could use this module for a
weather station project or for a drone
so you could implement the altitude hold
configuration for that drone check more
details in the link below ok guys we
finally have the last group of sensors
which are quite general let's start with
this gas sensor now depending on the
type of sensor you could detect specific
types of gases as for example in
flammable gases air quality or alcohol
detection in the air that you excel but
in this case this sensor will detect the
changes in the normal air percentage of
gases it uses an amplifier it could have
an analog signal as well or directly the
detection signal which could be high or
low meaning that the normal valves of
air are not right or that the air is
clean connect this module to the Arduino
and upload the code it will print the
angle grid from the sensor and by
setting the threshold values
could detect the air quality changes or
any other gas by using a specific gas
sensor as you can see when I release
guess from this lighter the analog
output increases and that means that we
have a gas leak
okay the next example is the common
distance sensor using ultrasound pulses
it sends a sound wave the text the
bounced wave and it calculates the time
it took this out to get back and by
knowing the speed of sound we can get
the distance to the object in front of
the sensor I've made a full tutorial on
how to make a sensor like this one so
check that video for more details
connect the module and upload a code and
it will print a distance in centimeter
onto the serial monitor or to the LCD
screen if you have one read more about
this on my webpage and read the lines in
the example code for more okay now I
have a thermocouple voltage sensor the
thermocouple is a component that will
create a small voltage drop on these
connectors when it's heated up by
knowing the temperature versus the
voltage drop relation we can measure
temperatures since the voltage drop is
very very small we need this kind of
sensor that uses the Mac sixty 675
amplifier so connect a k-type
thermocouple to this module and make the
connections to the Arduino then upload
the code and run it and it will print
the temperature as you can see I heat up
the thermocouple and I get the real
value of the temperature this kind of
component is very useful when working
with high temperatures since it would
withstand up to 700 degrees okay now in
the same way I have this thermistor
which is a temperature dependent
resistor as in the example with the
light dependent resistor we could create
a voltage divider and we will see that
the output voltage will vary depending
on the temperature if we know that our
mister response we can measure the
temperature with the Arduino as you can
see when I heat up the thermistor the
resistance will change and as you can
see on the oscilloscope the voltage
divider output will change as well more
information below okay I also have this
current sensor this module uses the max
471 current sensor
connect this module in parallel with the
load and it will measure the current
that the load uses I make the
connections and I add a resistor as a
load and I use this power controller to
variety applied voltage from the battery
after I upload an example code it will
print the current values and as you can
see I increase the voltage and the
current increases as well and that gets
printed onto the screen this is another
very useful sensor for your projects
now here we have a whole sensor the
small component could detect magnetic
fields I've used this kind of sensor for
my POV clock project and for the sensors
electronic speed controller this is the
49 a hole sensor and this one has a
linear output if I make the connections
to 5 volts and ground as you can see
when I place a magnet goes to this
module the output will increase or
decrease I could connect this analog
output to an Arduino and by dead the
tech magnetic fields you could use this
as a switch or an encoder on a motor
shaft or any other idea that you have
once you know how to measure the output
you could use this for any project it is
very easy to use you also have the
digital type where the output is high or
low and that means that the magnet is
close to the component or not ok so
finally I have an 8 DC now you could say
that this is not a sensor but
technically it sends the unlock value
you could use the ADC of the Arduino but
that is only a 10 bit converter for more
precision I have this 16 bits ABC this
will give me 65 thousand points for a
range from 0 to 5 volts that is a
resolution of only 75 micro volts it
uses a nice crazy communication as well
and it has four different analog inputs
this is a great module if you want
procedure I make the connections and now
as you can see it prints the analog
value from this potentiometer to the
screen or to the serial monitor with
very high precision so have this module
in mind when you want good precision for
your analog reads so that's it my
friends these are more or less the
sensors that I have right now laying
around my workshop there are much more
on the market so I hope that this video
helped you to make an idea of the amount
of sensors and how to use each one of
them consider supporting
my project on patreon if you liked this
video make sure to subscribe and
activate your notification bell for
future videos also click the like button
like crazy and share this video with
your friends and remember that you'll
help on patreon means a lot for me and
will keep these kind of videos going so
thanks again and see you later guys
[Music]
Browse More Related Video
Sensors || What Is Sensor?
Let's build a room sensor - Part 1 - Temperature, Humidity, and Bluetooth
Build a Self-Driving Arduino Car | Science Project
INTEGRATION OF SENSOR AND ACTUATORS WITH ARDUINO-I
#411 Ten Fluid Level (Water Level) Sensors and how to use them (Arduino, ESP32, ESP8266)
Simple Fire Alarm Circuit
5.0 / 5 (0 votes)