Arduino Tutorial 2: Understanding How Light Emitting Diodes (LEDs) Work

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys this is polemic order from top tech boy comm and we are here today with lesson number two in our new improved exciting series of tutorials on the Arduino microcontroller and if you tuned in to lesson 1 you already wrote your first few programs where we wrote a program that will make this LED blink and so what I want to do in today's lesson is I really want to go in and talk about how an LED works because in this series of lessons I want us to start sort of looking under the hood and not think about computer chips or microcontrollers or things like the Arduino it's just something that we type commands into I want us to pull open that hood and start understanding how these devices actually work and so today we're gonna start by understanding health and LED works now if you are following along with this series you need do have you're a lego super starter kit and link below in the description and if you get one of these 35 bucks you can follow along in this entire series of tutorials but if you look in if you already have this and look in your most excellent super starter kit you will find this little envelope of interesting interesting things and these are LEDs let me on let me get out of your way and you can see that you have this packet of LEDs and we are going to be doing all types of interesting and exciting projects based on those LEDs but today we are actually going to learn how an LED works and so let's jump in and do that so first of all what I always like to do when I teach is I like to kind of go back to something you understand or something you're familiar with and so what we'll talk about is the kind of simplest thing that you might know of how light works a light bulb there light bulb was invented by Thomas Edison in 1879 in a light bulb basically works like this you have a socket that socket has a wire the wire comes up like this goes back down and then this whole thing is in a piece of glass now what happens if I apply a voltage I get a little bit of current to flow current is represented by the letter AI current flows if I apply more voltage I get more current and as I continue to turn up the voltage this begins to get really really hot because it's a resistor in that current going through that wire starts generating heat as you turn it up more it not only is hot but it gets red hot okay it gets red hot and as it gets red hot you can begin to see light come off of it and it's kind of like red light but you get a little light coming up you turn the voltage up even more and it turns white hot and as it turns white hot you start getting a lot of light off of it that is how a light bulb or it's basically taking a wire and heating it up to the point that it gets white-hot what is the problem with this well the problem with the light bulb is is that at its fundamental core it is not a light generating device it is a heat generating device and if you let it generate enough heat you will get a little bit of light out of it but what is the problem as you put energy in and remember energy is money as you put energy in about 95% of it goes to generating Heat and five percent goes to generating light so you're paying a lot of money to heat your ummah so most of the money that go in energy that goes into light bulb goes into heat not white very very inefficient second thing is all that heat accumulates in your room like let's say I'm making a video here and I have lights on all these lights start heating up the room that means I have to turn the air conditioner on the air-conditioner works harder it's working harder that means the air conditioner will wear out and break quicker and I'm having to pump a lot more electricity into the air conditioner to get it to take away the heat that was generated by the light bulb so light bulbs been used for the last 140 years but it has wasted an incredible amount of electricity in generating heat and then even more wasted electricity and trying to deal with that heat so we need a better system to generate light and that better system is the LED now I'm gonna explain how an LED works but I have to sort of explain some solid-state physics I'll do it in a way that you can understand it's not going to be a lot of math but you'll develop an intuitive understanding about how these LEDs work but to do it we have to understand about a magical material called a semiconductor material and again to understand semiconductors I need to start and explain something that you understand so before we talk about semiconductors let's talk about conductors what's the simplest conductor a wire like a copper wire conducts electricity what's around the outside of the wire like a rubber or plastic layer that is an insulator does not conduct electricity so you can think about conductors wires insulators plastic or rubber okay the semi conductor is sort of intuitively you could think of it as being between a conductor and an insulator so something that would not be a good conductor and would not be a good insulator and if you did that that's kind of right but the magic of semiconductors is much more than it just being material properties between a conductor and a insulator the magic of the semi conductor is based on the manufacturing technique you can manufacture it to be a very good conductor or you can manufacture it to be a very good insulator so it is a material that you can tailor the properties of and even more magical than that is you can manufacture it such that depending on the electrical signals that you put on it it could be a very good conductor or it could be a very good insulator so you can switch it from conducting to insulating and with an electrical signal and then if you think of zeros in one kind of conducting is a one insulating as a zero all the sudden you can start thinking a little switches little zeros and ones and then all sudden you're doing math and you've got a microcontroller like the most excellent Arduino I think a little bit more that most digital electronics are built in silicon the semiconducting material that you use is silicon this is a silicon wafer and I can put the wafer here for you to look at and you can see on the surface of the silicon wafer it is covered with tiny computer chips and so this thing has been manufactured hundreds of computer chips at a time you could think of this as maybe six hundred Arduino 's it's not an Arduino but it kind of the equivalent six hundred microcontrollers the next step would be to come in and a machine slices this wafer into individual chips each one being let's say a microcontroller and then if you think of something like the Arduino and right here you've got this dual inline package or this packaged chip if you could pop the lid off of it you would see that there's a tiny chip inside of here which was a slice off of a silicon wafer okay so that means that just about everything in the world of electronics is based on semiconductors including LEDs but if I'm going to explain to you how an LED works need to go in and explain how semiconductor works this is the way that you can think about a semiconductor you have to think of let's say something maybe in physics that you have if you've had any physics or chemistry and you have an atom you know that that atom has certain energy levels that an electron can be at in their discrete levels it would be like if this is energy and you have an atom you could have an electron here an electron here or an electron here say the electron can't be it entered any energy level it can only be at certain specific energy levels well a semiconductor is a crystal material in a crystal material basically the atoms come and they're like in a perfect lattice okay they're not in there in random orientation okay the crystals line or the atoms line up perfectly in a crystal and then that unit cell is repeated over and over and over as we have these individual atoms and as we bring them together to form a crystal because of something called the Pauli exclusion principle these discrete energy levels from adjacent atoms begin to smear and what we end up with is we end up with instead of discrete energy levels we end up with allowed bands and so this entire band of energy is allowed and this entire band of energy levels is allowed so this from here to here is allowed and from here to here is allowed and nothing between here and here is allowed and so between here and here this is called the band gap band gap or the forbidden region so you could have an electron anywhere in here or you could have an electron anywhere in here these are the allowed bands in a crystalline material alright so now let's start talking about this semiconductor business or about the conduction now I want you to think in a lot of these things you can kind of think of an electron is a marble and if you put a marble in a bowl whereas the marble gonna want to go it's gonna want to go to the lowest energy level when you have an electron in a semiconductor material where is it going to want to go it's gonna want to go to the lowest energy levels where are the lowest energy levels they are down here in this band which we call the valence the valence band okay and so all your all your electrons end up in this valence band and so let's draw them like this okay all these are here and then this band which is called the conduction band conduction band the conduction band is all empty all the electrons are down here so now if we apply a voltage if you're thinking about marbles applying a voltage would be like tilting this okay are the marbles going to flow or are they not going to flow that's like asking are we going to have a current or are we not going to have a current so if I have this semiconductor material and I apply a voltage am I going to get any current flow well the first thing let's think about the conduction band think of it as a tube the tube is empty void of marbles no marbles I tilt that tube do I get marbles moving no there's no marbles therefore there's no conduction there's no conduction because there's no electrons here but you say wait a minute wait a minute there's a bunch of electrons down here true there's a bunch of electrons down here but now let's think of a second tube so this one tube is empty now we have this other to this other tube is completely full completely full of marbles if I tilt that tube to the marbles move no it's full so when I'm in this state which is an intrinsic semiconductor I get virtually no current flow at all because this one's completely empty this one is completely full no current flow but now let's think of some way that we might get an electron from here up to here well let's say that I start bringing some temperature into this system I start increasing the temperature what's going to happen if I increase the temperature I'm pouring more energy into this system and I'm gonna get a lucky electron that is going to absorb that thermal energy and he's going to hop across the band gap or the forbidden region and he's going to end up up here okay now I'm gonna make a little better picture here because there's something more specific when that happens okay so again I'm gonna have my we'll just call it the valence band and then I'm going to have the conduction band and then I have all of these electrons down here okay and now I apply some thermal energy and I get this one lucky electron that jumps up here now if you think of this second tube of marbles down here when that electron jumps up when that marble jumps up what am I left with I am left with a hole here that is where that electron used to be now let's think about this we're going to apply a voltage and that is going to be like tilting the semiconductor so what is this electron going to do it is going to roll downhill and so I'm now going to get conduction from this electron that's in the conduction band like one marble in the top tube I tilt it that marble is going to roll downhill now what's going to happen down here when I tilt it well really what happens is this electrons going to move here this electrons going to move here this electrons going to move here this electrons going to move here so I am going to get conduction in the valence band too so not only am I getting conduction from the electron I'm getting conduction down here now you could go in and think about where every single electron moves but what would be easier think of this as a hole and think about the hole moving okay and this works perfectly well mathematically and physically rather than thinking of all the electrons think about the hole the only difference is electrons roll downhill and holes roll uphill think about like a level have you ever used a level it's a tube with water in it and there's a little bubble okay when you tilt it the bubble goes uphill but as you're tilting it and watching the bubble move you're not paying about the water moving you're just thinking about the bubble moving exactly the same thing with semiconductors if you have an electron go from the valence band to the conduction band I've got one charge here that can conduct electricity and then I've got one charge here that can conduct electricity so it's like I've got two particles that are conducting electricity a negatively charged electron and this hole is missing an electron so you could think of this as a positive charge so the way to think of it is a hole has a positive charge and electron has a negative charge a hole can conduct electricity and an electron can conduct electricity okay so this was the case of the case of an intrinsic semiconductor where the valence band is full the conduction band is empty the only current that flows is from these luckylucky thermally generated carriers now the higher the temperature the more electrons that you're going to get leaving behind the lucky holes the more electron hole pairs are going to get so as you increase the temperature the conductivity of a semiconductor goes up it increases because you've got more carriers too you've got more carriers to conduct electricity but now let's think that is generating a crystal material a semiconductor with no impurities valence band is fall conduction band is empty what if we put some very specially designed very carefully placed impurity atoms in this crystal ok so again I'll draw the band gap like we did before this is the what this is the valence band this is the conduction band but instead of just using silicon atoms or whatever atom that I'm building the crystal from I'm going to put in a very many tiny amount of impurity atoms and for this first type of impurity atom it's going to be an atom that has an X electron about at the energy level is of the conduction band so I'm going to put these impurity atoms in and I can do this with my manufacturing facility these have an extra electron and now it's very easy for that impurity atom to donate it is a donor atom and what does the donor atom do the donor impurity donates an electron to the conduction band okay so now these four donor atoms these impurity atoms donate an electron to the conduction band so now my tube up here it's not empty it has four marbles as I tilt it those electrons move those marbles roll downhill and I've got electricity flowing all the sudden this acts like a conductor okay now what's going on in the valence band the thing that you have to see in the valence band though is it remains full of electrons why because the electrons did not come from the valence band they came from the donor from the donor atoms so this donor type semiconductor it is called n-type in type in typ it's called n-type because n represents an electron and so your conduction is happening by electron so we call it n-type you don't have any hole conduction because there are no holes the valence band remains full okay so this is an n-type semiconductor well just like with an n-type semiconductor there is a different type of semiconductor again we could imagine this being silicon atoms this is the band gap this is the valence band this is the conduction band this time we are going to put impurity atoms but these impurity atoms instead of having an extra electron they have a missing electron and that missing electron is in an energy level very close to the valence band and so what is going to happen this impurity is going to accept so it's called an acceptor type impurity it is going to accept one of the electrons okay so for each acceptor atom it is going to accept an electron from the valence band when it grabs an if you in effect steals that electron from the valence band what is left behind holls holls okay what do we have in the conduction band we have no electrons up here because these electrons were grabbed by these acceptor impurities and it leaves holes behind now as we tilt the semiconductor by applying a voltage what happens these holes role where holes roll uphill electrons roll downhill so now we have conduction not by electrons but by holes and so this is called p-type p-type the conduction happens by whole movement which we get by putting acceptor impurities in the crystals if we put donor impurities in the crystals we get some electrons in the conduction band it is n-type conduction versus p-type conduction okay so now we have two types we've got three types of semiconductors we have intrinsic which have no impurities valence band is full conduction band is empty no current flow except just the random lucky ones that are thermally generated we can have n-type material where we put donor atom and we end up with electrons we can put acceptor atoms which creates p-type material which then gets whole conduction what on earth does this have to do with a diode okay I am going to try to show you now how this leads to an LED alright now this is where things get interesting what if I bring an n-type material I'll kind of try to show you a picture here what if I have a p-type material and I bring it next to an n-type material a p-type material next to an n-type material no it's not two separate things that I press together and glue it together it just as I manufacture it I have this piece of semiconductor material and I put donor atoms over here and I put acceptor atoms over here then what happens okay I think I will draw it like this we will say that here I put in type material which means these are donor impurities and then over here I put acceptor type impurity so P and so I can have a wire and I can have a wire and I have n-type material here donors p-type material here acceptors now let's look at the energy vans and let's see what the energy bands are going to look like well what happens when you do that is you get this strange thing that happens that you get this offset in the bands okay this is a p-type material this is n-type material so since this is n-type material what do you have going on if we go back and look at the earlier pictures we have some electrons up here in the conduction band okay and then the p-type material what do we have we have some holes in the valence band okay so I have electrons here I have holes here but now if I'm just sitting here is there any current flowing no because these electrons can't get up over the hop it's like a wall right the electrons want to run down here also the electrons stay here the holes want to run uphill so the hole stay here and so I have electrons in the n-type region I have holes in the p-type region and absolutely nothing happens okay now what if I apply a voltage well if I apply a voltage let's say that I put a positive voltage on the P side in a negative voltage on the inside what this positive thing does is it pulls this down it pulls this down and so what I end up with is something like this you see this step becomes much less now I still have electrons here and I still have holes here but has the wall become higher or lower it's become lower because I've applied this voltage okay so like imagine me and I can jump if you go outside and you have a 6-foot if you have a six-foot fence like this is six foot I cannot jump it but if you pull that fence down and make it three feet I can jump it and so what happens when I put this positive voltage here this electron some of these electrons can make it up here and some of these holes can make it here okay so now I've got a few electrons here I have a few holes here these are the holes that jump that barrier these are the electrons that jump that barrier now you've got a hole you've got an electron over a hole okay remember in our tube I've got a few electrons up here I have a few bubbles down here what can happen that marble can go down into that hole this electron can come here and it's like when an electron and a hole come together they annihilate each other because now this becomes an electron which is sort of what you would have here you know a full valence band in this p-type material so this is called electron hole pair recombination you have an electron and a hole recombine well this electron was at a high energy level and now it pops down to a low energy level that energy has to go somewhere right you cannot produce electric a not consume energy you can only transition it so what happens to the energy as this electron and hole recombine it is emitted as a photon so how do you get light out of an LED you forward bias it to reduce this barrier and then you have electrons coming into the p-type region you have holes coming into the n-type region and you have them begin to start recombining okay they start electron hole pair ehp electron hole pair recombination and each one of these that occurs you emit a photon well if you want it to be brighter what do you want to do you want to lower the barrier further so you're ending up with more electrons here and more holes here you get more recombination you get more photons it is brighter okay that is how an LED works but now let's think what happens if you put a negative voltage so instead of this what happens if I put the voltage on backwards if I put the voltage on backwards instead of lowering the energy barrier I increase the energy barrier because I hooked it up backwards okay so now this negative is moving this side up and this positive is moving this side down now remember this was in top so we have all of these electrons none of them are going to be able to come up here I have all these holes none of them so instead of making the the fence from six foot to three feet I took the fence and I went from six feet to 12 feet there is no way I'm gonna jump over that so there is no current at all and there's no light emitted so this kind of helps you see one of the real fundamentals of a diode and light emitting diode it only works in one direction as you apply a voltage in the correctly biased way where you put the positive voltage on the p-type material you lower the barrier you get electrons and holes going into the other regions they recombine you see current flow and you see light emitted if you hook it up backwards you made the barrier larger you will get no current flow you will get no light emitted and that is why when you have a diode okay when you have a diode you have to hook it up correctly right the positive has to go to the p-type material and the negative has to go to the n-type material and then you will get this magic happening you will get current flowing and you will get light emitting so one of the characteristics is very important of a diode you've got to put it in the circuit correctly and this is the key of the kind of takeaway here for hooking up a diode there's a long leg and a short leg the long leg goes to the p-type material the short leg goes to the n-type material the long leg always has to be hooked towards the voltage towards the positive voltage okay and that will mean that it is connected correctly long leg is the p-type short leg is the entire material all right now there's one more thing that we need to look at that's important if I just look at the current in the diode as a function of the voltage let's go back and look at some of these magical charts that we put together okay let's see this was the one where we applied a positive voltage we lowered the barrier well the thing is this lowering of the barrier the amount of electrons or holes that can make it over the barrier is exponentially related to the VIP barrier and so what that means is when you start moving that barrier you get exponential increase in these electrons and holes moving which means that you get exponential changes in current and so if I look at voltage versus current like for a resistor right it's very linear that as you increase voltage you increase current very nice in a very controlled way diode not that in the reverse direction if you have a negative voltage there is in effect no current at all that flows just a tiny amount of leakage current but you don't get any real current flow and then as you start positively biasing it lowering this barrier you get a very quick and rapid exponential increase in current what this means is is that if you just come in and do something like this and you hook a diode like this what's going to happen if you apply that voltage you're gonna get a very large current as you start getting that current you very well could start heating this diode up and then that's going to lead to even more carriers and the thing is just going to run away and it's going to burn out so you never hook a voltage directly across a diode because it's too unstable that you can end up with a runaway condition and then you will let the smoke out okay if you let the smoke out of the diode burn it up in effect it'll never work and once you let the smoke out you can never get the smoke back in and so the diode is going to be burned out so you never hook a diode up like this you always put a current limiting resistor in series okay so this is the circuit that you want to do because of this instability you want to put a diode and you can do a lot of calculations but usually a 330 ohm resistor maybe a 200 ohm resistor that will limit the number of current but the amount of current that can flow because this is a fixed resistor and therefore you will never burn out your led okay ladies and gentlemen that is how an LED works you have a p-type semiconductor n-type semiconductor you have this barrier by applying a voltage you lower the barrier you end up with electrons in the p-type material you end up with holes and the n-type material electron holes combine and then that will generate a photon okay now let me ask you what color does the LED generate because we have different colors right what color does the LED generate well let's look at this electron in this hole and they recombine and they emit this photon and the photon is like a packet of energy they emit this Photon what is the energy of the photon well it is exactly this energy gap okay you have this energy gap that is how far the electron fell and therefore that is the energy of the photon that is the energy of the photon now the energy of the light we know that energy is related to frequency that the energy of this photon is this AG so we have the energy of the photon is equal to the energy gap here and then that is equal to H times the frequency and H is Planck's constant we're not going to worry about that but you can just see the larger this band gap of the material that you're working with is the higher the frequency and then we also know that frequency is 1 over wavelength of the light and so you can see the higher the frequency the lower the wavelength is going to be so if we look at frequency as frequency goes up you start going towards like purple and violet and then ultraviolet okay the very high frequency colors which are the short wavelength colors if you have the frequency coming down you start going towards red and then you go into infrared which you cannot see and these are the low frequency colors in the long wavelength colors so what color do you get out of an LED it is a fundamental property of the material that you're using the semiconductor material it is defined by the bandgap and so if you want a certain color you have to create a material a crystal that has a certain band gap because it is this bandgap that determines the energy of the photon which determines the frequency of the photon okay this has been a great lesson man put your comments down below ask some questions let's start talking about it what are we trying to do we are trying to look under the hood and understand how semiconductors work and understand how this darn blinking thing is working how is it working I'm applying a voltage the voltage lowers that step between the two types of materials electrons holes are injected they recombine and boom photons come out okay guys if you like this video think about giving us a thumbs up be sure and order your a Lego kick tip from the link below so that you can follow along with the rest of the videos next video we're actually going to take our marvelous little LEDs and we are gonna start hooking them up in programming them but as we do it this time you're gonna understand the physics behind these things actually work think about giving us a thumbs up think about sharing this with your friends palma quarter top tech boy comm i will talk to you guys later
Info
Channel: Paul McWhorter
Views: 409,228
Rating: undefined out of 5
Keywords: LED, LEDs, PHysics, STEM, Tutorial, Arduino
Id: 9uHZB7-T_XA
Channel Id: undefined
Length: 38min 8sec (2288 seconds)
Published: Tue Jun 04 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.