Sensors - which one to use

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
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]
Info
Channel: Electronoobs
Views: 1,153,689
Rating: undefined out of 5
Keywords: sensors, example, Arduino, PIR, IR, color, Adafruit, tutorial, pulse, HMC5883L, gas, BMP180, distance, laser, fire, LDR, thermistor, temperature, ADC
Id: DlG6LY84MUU
Channel Id: undefined
Length: 17min 6sec (1026 seconds)
Published: Sun Feb 03 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.