Okay, so in this next part, we're going to be talking about sensors. And I'm going to level with you, this lecture is going to be a bunch of lists. I'm going to list out all the different kinds of sensors that you can use in your different systems and give a bunch of different examples. So is not going to be a lot of really deep conceptual stuff in this lecture. But bear with me, these lists are really important because they give you breath in understanding of all the different sorts of sensors and sensor types that you can use in your systems, help you build your toolbox so you know what to use. So let me throw some scenarios at you. Suppose you're working for an agricultural company and you got this assembly line where you have a whole bunch of tomatoes coming through. And these tomatoes are coming through and you want to build something that kind of looks at the tomatoes and figures out if they're ripe or not. You know, like how red they are. How would you do that? Well, it turns out there are sensors that can detect color. So there's these things called color sensors and what they do is they measure the range of visible colors. It's like a one pixel camera, and you can point it at something, you might have little lights on it, light it up, see what color it is. Very useful for seeing tomatoes and a bunch of other things you might want to do. Reading medical test strips, very accurately or measuring ambient light conditions or doing color matching. Let me throw another example at you. Suppose you want to build something where you want to sense if you're close to something. Maybe you're building a robot that has to dock like a Roomba going back to its charger. You want to see if you're close to something or see if a door is closing or something like that. Well, it would be great if you kind of put a magnet on something and see if you're close to that magnet. Well, there are sensors for that too, there are sensors that can detect the presence of magnetism. They're called hall effect sensors. And what these sensors do is they vary their output voltage in response to a magnetic field. So the more magnetism they are, the more voltage goes through. And they're useful for proximity sensing and doing alignment to figure out if you're precisely aligned with a certain location, measuring speed of a wheel. And you can also detect current, because when current goes through a wire, it makes electricity go through the wire but electricity also induces a magnetic field around the wire. So you can sense if electricity is going through a certain location or certain wire at distance. Here's another example. Suppose you want to build a shopping center where you want to watch your customers and you want to listen to what they're talking about. Maybe there's a lady in a certain aile who's talking about chocolate and how much she'd like to eat chocolate. Wouldn't that be great if you could listen to her and then hear that and then start showing pictures of chocolate all around her to make her want to buy that chocolate? Well, you can do that too with sensors because there are sensors that can detect noise and these are called microphones. So microphones, as we all know are little devices that convert sound into electrical signals and they're useful for recording audio, but they can also be used to detect the presence of audio and can be hooked together with back-end systems to perform speech recognition, to detect wake phrases and perform echolocation. So if you want to figure out where you are in a certain environment and there's no light to see, you can actually use sound waves to do that. So as another example, suppose you're building something and I think needs to detect if it's falling, maybe it's a piece of sensitive electronics and if it drops it needs to kind of lock itself together and shut down sensitive parts of itself so it doesn't get damaged when it's dropped. Wouldn't that be great if you kind of detect acceleration or freefall or things like that? There are sensors for that as well. They're called accelerometers. Accelerometers measure the physical acceleration experienced by an object. These things are great for you can put them on human bodies and you can kind of figure out what the human's doing, is the human running around, are they sleeping, are they dancing? You can figure out what they're doing, you can figure out if things get dropped, you can figure out if someone's in a room by dispensing vibrations in the room. You can also detect which way is down because gravity pulls it down and that has a similar effect to acceleration. And you can also monitor health of things like motors and buildings and cars by monitoring properties of their acceleration in real time. So that's acceleration. But here's another example. Suppose you want to detect where you're pointing and kind of a 3D space whether you're pointing up or whether you're tilting in a certain direction. There are sensors for that too. They're called gyroscopes. And what gyroscopes do is they measure rotation? For example, there are 3D gyroscopes that can measure tilt and pitch and yaw, and the way they're rotating at three different dimensions. These are also great for monitoring human activities and they're often paired with accelerometers to detect things like walking and running. They're also used for 3D motion control perhaps some sort of controller like a game controller. I could rotate it in three dimensions and control a character on the screen or give input to some sort of device. As another example, suppose you want to detect the makeup of air. Maybe somebody kind of walks in a room and they have alcohol on their breath, you want to figure out if they've been drinking or maybe you want to detect if there's harmful chemicals in the air like a gas leak. Well, there are sensors for that too. They're called gas sensors. And what gas sensors can do is they can actually detect the makeup of the air that we're breathing. And there's many different kinds of gas sensors that can measure things like carbon monoxide, methane benzene, and propane and so on. And these are widely used in safety devices and environmental monitoring to figure out if there's been gas that's been linked to the environment. As another example, suppose you want to build something that can kind of watch an environment in the dark, maybe it's a burglar alarm or some sort of system where you want to detect occupancy or somebody moving around and there's not enough light to do it. Well, one sensor you could use for this is called the infrared sensor. Because even when it's dark in terms of the visible spectrum, often in an environment things will be emanating light in the infrared spectrum. And what these devices can do is they can sense this infrared light and they're widely used for motion detection. And if you've ever walked in a room and the lights kind of go on, these are the things that are in the ceiling they are sensing you walk in the room. They are used for remote control and communication, your TV remote uses these things to send information to your television to change the channel. They're often also used for maze navigation and boundary sensing in robotic devices as well. Finally, I want to talk about proximity sensors. So proximity sensors are used in environments where you want to detect how close you are to something. Maybe you're building a robot that's walking around and you don't want it to bump into walls or you want to figure out, maybe you're building some sort of interactive display and you want to figure out if a user is stepping up close to that display so you can react to the user. Proximity sensors are used for that. This particular proximity sensor I'm showing to you is an ultrasonic proximity sensor. So what it does is it emanates sound waves and it measures the amount of time it takes for those sound waves to be reflected back, a similar principle to sonar. These are used in cars. They're used for parking assistance systems to make sure when you do parallel parking automatically that you don't bump into other cars. They're used in automated driving systems for cars, measuring speed and interactive displays. So let me give you a few more examples of sensors. Maybe you're building an agricultural system for a farm that waters crops. Now, running a farm is a very sensitive operation. Farms often don't make large amounts of money, there aren't high yields. And so there's a lot of pressure to reduce costs as much as possible. So one innovation that's been happening recently is the application of IoT to farming systems. Where you don't just water crops, but what you do is you sense the soil and you figure out how much humidity is in the soil and then you precisely allocate as much water as you actually need to save water. Or pesticides or other sort of liquids. So how would you do this? Well, there are sensors called humidity sensors. And what these humidity sensors can do is they can analyze the soil, they can sit there and measure how much water is in an environment, inside the air or inside of soil. And this information could be used to adjust watering systems. Humidity sensors are used for soil monitoring and weather monitoring. Okay, now, suppose you want to build something that senses touch, maybe you want to build some sort of interactive touchscreen or recognize if a user is picking up an object or something like that, there are sensors for that too. These are called touch sensors. And the way they work is they measure capacitance. So humans are basically big bags of water. When we touch something, we're very good at sucking up electricity. And the way these touch sensors work is they kind of put a little bit of electricity on their surface and they detect when electricity kind of leaks out in something. That's how touch is measured. And touch sensors measure anything that's conductive, it could be human, but it could also be something that's metal or has some sort of dielectric that's different than air. And they're using touch screens and fingerprint identification and all sorts of systems like that. Now, another kind of sensor I can tell you about is called a photoresistor. So what these do is they measure the intensity of light. If you're building some sort of system that needs to recognize how much light is in the room, maybe wants to detect movement or something caught between it and a light source, you can use a photo sensor or a photoresistor. And these are useful for telling a system it should go to sleep because it's night or turning on lights in a smart building because it's getting dark. Another challenge that you may encounter is detecting how heavy something is. Maybe you want to detect if a user is standing on something or if there's some sort of mechanical stress being placed on your device. For that, you can use a load cell. And what these do is they measure force applied to an object or weight and they could be used for many sorts of different things like detecting presence of something or arrival of a person. They could be used for measuring weight if you need to know how many pounds something weighs. May be used for measuring impact if something is hit hard, you can measure how hard that was and it could be used to measure mechanical strain on your device. Maybe there's some sort of mechanical strain that's about to break your device. So you can measure that with a load cell. Now suppose you're building some sort of farm system that's watering crops. We talked about humidity sensors, how can you detect how much humidity is in the soil? But how do you control how much water you're disseminating to these crops? For that, you can use a flow sensor. A flow sensor is something that takes in some sort of liquid going through a pipe and it measures how much liquid actually goes through the pipe. So if you're doing micro application of pesticides or water or things like that, you can use a flow sensor. They work for fluids and they also work for gas. And they're used for many applications in industrial systems, farming, they're used for gas meters for houses to measure how much gas is going in, and for green building resource usage as well. Flow sensors are used to measure flow rate of gas or fluids traversing through a pipe. If you want to measure flow rate of a gas in just plain air, so if you want to measure things like wind, for example, use an anemometer. These things measure wind speed, you can pair these with a vane to measure what direction the wind is blowing in. And these are used for weather monitoring, microclimate monitoring, and detecting if you build something, is it going to get blown over by the wind if you mount it outdoors? You can use these to monitor structural safety as well. Speaking of weather, if you want to monitor how hot something is or what the temperature is outside, there's temperature sensors. And these are devices that can measure the temperature of the ambient air or environment. You can apply these to the surface of objects to measure how hot a particular element is or a particular device. And these are things that are useful for detecting if your device itself is overheating if your circuits are getting too hot, if you want to monitor industrial machines, if you're doing industrial IoT or if you want to monitor plants to see if your growing plants in the soil is getting too hot. Finally, if you want to do things more generally like facial recognition or presence detection or things like that or you just generally need to see you can use cameras. So there's all sorts of cameras that are built, you can buy them on these little circuit boards, they can be very cheap. And what these can do is they can capture pictures or video and you can pair them with computer vision and spatial recognition detect faces and objects and track motion. And these are widely used for things like crop analysis. You want to take a picture of growing crops when you're flying over in your drone and detecting if anything looks like bugs are on them or the plants are dying or things like that. They're useful for customer identification. You have a grocery store, or maybe some sort of clothing store and someone comes in if you can kind of recognize faces, then kind of pair those up with credit card information and say, hey, that guy that just walked in that guy has a lot of money I should send my staff over there to help them out. And try and get get a sale from that guy. You can do things like that with cameras and so on. So these are a bunch of sensors that you have available to you and there's a lot of variations on these sensors. I also wanted to tell you about some emerging sensor technologies that are just becoming practical which are currently kind of expensive but in the next few years may become practical for you to use in your circuits. One of these kinds of sensors is called an electronic nose. So if you've ever gone to an airport, and you've seen those dogs kind of sniffing around looking for bombs or drugs or things like that. They're doing that because dogs noses are very good at smelling things. If you have objects, these objects can kind of iminate odors in the environment, little tiny bits of them that dogs can sense. And we're starting to get good at building electronic devices that can sense things. And these things are useful for more than just counterterrorism. They're building these things for restaurants. So I can bring this into a restaurant and detect how well the restaurant smells to my customers, because that affects the food that they're eating. And these things can also be used to detect human health because when you breathe out, you breathe out certain smells that can be detected by these noses. And you can detect certain diseases like cardio pulmonary diseases using these devices. Another sort of sensor that we're starting to get good at creating are tactile sensors. And these are sensors that can kind of sense touch and we talked about touch sensors already. Those are more binary. They detect if something is being touched or not. But tactile sensors are much more powerful. They tell you what the thing that is touched feels like. So if I take my hand and I kind of touch my shirt, for example, kind of feel soft. I know what that feels like. If I touch concrete it feels very different. So tactile sensors can actually detect the differences between different kinds of touch. They can help your device feel texture and stiffness, how much friction there is when you kind of rub along it, thermal conductivity and things like that. And these are starting to be used in different kinds of robotics where these, for example, robotics where you interact with people, or take care of people. If you want them to be friendly, these devices might kind of touch the person and kind of console them and things like that. And they're useful for object recognition, sometimes we people kind of pick things up and kind of feel it to figure out what it is. Now your IoT devices can do that as well. So I was mentioning medical applications of IoT. One really interesting one that's emerging right now are blood gas sensors. So these are really exciting technology because they allow you to detect medical problems inside of people. Because in our bloodstream we have blood but we have a bunch of other stuff in the blood such as arterial gases, oxygen, carbon, dioxide, sugar. There's different pH levels in our blood. And we can detect this is take a blood sample out of the person. But there's actually a much less invasive way we can do this, is we can monitor their breath when they breathe out. And so people are kind of building these smart shirts that just kind of sit on you and kind of detect your breath coming out and they can detect all sorts of stuff. You know, whether you're getting more prone to diabetes or heart disease all these different sorts of things. And they're being used in home health check-up systems. You can kind of just breathe into a device and they'll tell you information about your health and detecting asthma and things like that. Another sort of technology that's emerging are brain wave sensors. So these are interesting because when you think you've got a brain, your brain actually works by using electricity because you have all these different neurons inside your brain and information travels along through your brain through electrical impulses. And as we discussed if you have some electricity that's moving that actually induces a changing magnetic field. And so you can actually read information about your brain externally. And we've been able to do this for a long time and we can read these different waves coming out of your brain and detect roughly information about, maybe you're a little bit stressed out or things like that. But we're starting to get really good at this, and we've been able to kind of construct brain sensors that can actually triangulate inside your brain to figure out not just electrical activity but the precise sort of electrical activity and where in your brain is lighting up. And so this gives us a lot more abilities to kind of read people's thoughts and their intentions and things like that, even if they don't say them. And so this is useful for things like, you're seeing new devices that are emerging that work through the use of mental control. It's also used for medical applications because we can diagnose information about faults inside of people's brains and whether they're subject to certain mental disorders. Another really powerful thing is understanding user intent like what the user wants to do before they even say it. This can make very responsive IoT devices and so on. Okay, so this is kind of a summary of a lot of different sensors out there. I went through a big list. There's a lot of different sensors out there, but hopefully this gives you a good picture of all the different sorts of tools you can have when building IoT systems. When you sit down and you need to build something, try and write down a list of the things you want to detect and then you can consult this list to get a sense of what sort of actual devices and what sort of sensors you can use in your designs.