Arduino Tutorial 9: Understanding Ohm's Law and Simple Circuit Design

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys this is Palma quarter from top tech boy comm and we are here today with lesson number 9 in our new in our exciting in our improved Arduino tutorial series and what we are going to talk about today is we are going to talk about Ohm's law and simple circuit analysis so I need you to pour yourself a nice big mug of iced coffee no sugar just black coffee over ice it's both delicious and refreshing so get that poured I need you to get out your a Lego super starter kit you know our three project kit if you don't have one yet look in the link down below hook a brother up order it from there and then you can play along at home as well and so we today are going to be looking at how to do simple circuit design how to do simple circuit analysis based on Ohm's law now I know what you're thinking you're thinking why do I need to know that because I am already I am already building circuits as illustrated in some of our earlier projects where we used this this circuit we built it made an LED blink well let me tell you why because I gave you this circuit and the reason I was able to give you this circuit is because I used Ohm's law and I did circuit analysis and then you just copied what I did well you said you're probably saying I'm perfectly fine copying what you did yeah but I always I will not always be here for you and so you need to know how to do it yourself so that you can make things like this work so let's talk about what do I mean by circuit analysis well if I just came in and had you hooked the 5 volts directly across the LED you would get a very large current and your LED would burn very brightly for a short period of time and then poof smoke would come out and the LED would be destroyed on the other hand if I use too large of a resistor then you would limit the current too much and either the LED would not turn on or the LED would be very dim so too small of a resistor you burn the LED out too large of a resistor and the LED burns dimly and so if you want to make simple projects like this work you need to know how to do circuit analysis and so that is what we are going to do today and the good news is it really is pretty simple and so let me let me kind of show you and we'll go through a circuit analysis together and then I will have you do some on your own but let's start with the simplest one possible something just really simple where we have a voltage supply and then we come across and we have one resistor alright and so this is even simpler then this one was because we just had the voltage supply and the resistor and let's go ahead and call this R and then let's call this V now in the example we did earlier we had R was 330 ohms but here I'm just gonna leave you more generally a voltage applied across a resistor how do I know what current is going to flow well the voltage if you think of like a water system the voltage is kind of like pressure and the current is kind of like the water flow but instead of flowing water we have flowing electrons and so I know that a water example is not exactly perfect but you can't kind of think of it is this voltage supply is sort of like a pump and the higher the pressure it's kind of like a higher voltage and the higher the pressure the more water is going to flow well the higher the voltage the more current is going to flow and this resistor that's something that restricts the flow so it would be something like an obstruction in your pipe and the larger the obstruction the smaller the current is going to flow so it's sort of very similar here the larger the voltage the larger the current and then the larger the resistance the smaller the current because that's resisting currents because sort of like voltage and resistance are fighting against each other one thing that I need to say current is the flow of electrons but it's this quirky little thing that it's in the opposite direction if you think about like if you had an electron here it lacked charges repel and so this negative electrode is going to be pushing the electron around this way and then the electron is going to be attracted to the positive terminal because opposite charges attract so the kind of quirky thing is the electrons are actually flowing this way but the current is flowing this way so current flow the positive current is in the opposite direction of the actual flow of the electrons you really don't have to even think about the flow of the electrons and so I don't even think about this I just know that the current comes out of the positive terminal of the battery and that is a particularly ugly circuit and so I am going to move to a new sheet of paper and let me see if I can draw it neater I wish I could really draw good but I can't so that's plus minus come down like this this is voltage we have current in my hand it's always in your way isn't it and we have resistance well we have to help us with this we have what is called Ohm's law and what does Ohm's law say well Ohm's law says the voltage is equal to the current times the resistance so the voltage here is equal to the current times the resistance we need to know that V voltage is measured in what volts and you're familiar with volts right like maybe you have a 9-volt battery or something like that you're familiar with that all right I current is measured in amps and then our resistance is measured in homes which is this symbol and sometimes called homes now circuit analysis is really simple for little things like this but what you have to see is you are rarely going to be given the current in the resistance and calculate the voltage more likely let's say that you would be given the voltage and you would be given the resistance and you want to calculate the current well if you have voltage and resistance and want to calculate the current what could you do to this you could divide both sides by R and if you divide let me say this is the first Ohm's law if you divide both sides by r you could say that I is equal to V over R this is the second form of Ohm's law and this one you actually kind of use more often that you have a voltage a lot of times it might be five volts and then you are given a certain resistor and then you want to know what current would flow through that's the second way well what if you had a voltage and you had a desired current and you want the resistor that would give you that current well you could say you could divide on V equals IR you could divide both sides by I and then you could say R is equal to V over I and so these are three ways of writing Ohm's law they're all equivalent but what you want to do is you want to pick the one that matches the problem that you have and so we'll just come up with a problem here okay and man I'm gonna try so hard to draw a need one okay so let's say this R is equal to 330 ohms and this is five volts okay so I have five volts across 330 ohms the question is what is the current well the current I would use this equation is equal to V over R which what's my voltage five volts over the resistance is 330 ohms and then I get out my nice scientific calculator guys you want a scientific calculator and you want to set it to operate in engineering notation engineering notation is scientific notation where it always gives you the exponent at a power of three well why is that interesting and engineering we have Millie something's we have micro something's we have Killough something's and we have mega something's and so it's nice when you use engineering notation because it puts it in those groups of three so let me get this and say what is five divided by 3 30 it is 15 point one five e to the minus three amps all right now really when any time we use the current in math we want it in amps so it would be fifteen point one five e to the minus three but usually we would replace e to the minus three with milli okay so we would say this is fifteen point one five milliamps but now if I were to use this in a calculation I don't want to use fifteen point one five I want to use fifteen point one five e to the minus three does that make sense if it doesn't ask me maybe I need to make a video on that if it doesn't make sense and so here I have solved my first circuit analysis and I calculated that if I put five volts across 330 ohms I will end up with fifteen point one five milliamps now what you see is is that when you're dealing with the Arduino you're always going to be dealing in kind of milliamps or micro amps an amp is a huge amount of current I mean that would like kill you very easily and so you deal with amps if you're doing things like wiring a house or power systems or things like that micro processors and the types of things were dealing with we're always gonna usually be way down in in the milliamps okay that was a very easy problem let's work a problem that is a little tiny bit more difficult and I'm going to try so hard to write neatly as I work this problem in fact my piece of paper here okay so let's do a slightly more complicated problem in this case I'm going to have five volts and then it is going to go across two resistors okay and so I'm going to have r1 is equal to 330 ohms and r2 is equal to 100 ohms now if you think of Ohm's law saying V is equal to I times R well what do you do you've got two R's here well the thing that you have to understand is if there's only one path through the circuit if everything is in series it becomes very very easy if it splits if the current branches into two paths then you've got to do some more complicated stuff but most of the stuff that we're doing it's in series like this and so you can do it this way this is how you deal with resistors in series you can say the equivalent series resistance is the sum of the resistors that are in series okay so the equivalent resistance is the sum of those resistances so the equivalent resistance is 330 plus 100 the equivalent resistance is 430 ohms okay now what you do is you redraw the circuit with that equivalent resistance you would say that this circuit is exactly equivalent to this circuit this is still 5 volts and now this our s is what 430 ohms now I want to calculate what I want to calculate I how do I do that I is equal to V over R and this would be our RS here what is V it is 5 volts divided by what is RS 430 ohms and so I have 5 divided by 430 that is equal to 11 point 6 3 e to the minus 3 amps and then how are we going to write that we're going to write that I is equal to 11 point 6 3 e to the minus 3 is what milli amps and so here I have started my circuit analysis but I'm not done because now I know this current here and that's eleven point six three milliamps but now I've got to go back up to the real circuit not the equivalent circuit well what you can see is because they're equivalent what is this current it's exactly what we calculated it is eleven point six three milliamps eleven point six three milliamps okay I am not done because what I really want now is I know the current through the circuit but I need to know the voltage across R one and I need to know the voltage across R 2 and so the voltage across R 1 I am going to call that V one and V 1 is equal to I times R but which R well R 1 because I want the voltage across R so I use our one so this is equal to eleven point six three my current and when I do a calculation how do I put it I got to put the e to the minus three for Milli so e to the minus three times 330 ohms is equal to I will put in the calculator 1118 point six three e to the minus three times three thirty equals three point eight four volts okay so if you look at this I started with five I got eleven point six three milliamps and of that five volts three point eight four volts dropped across the 330 ohm resistor now what do I need I need to calculate the voltage across r2 we will call that V 2 V 2 is equal to I times what well R 2 because I want the voltage across R 2 so that is R two that is eleven point six three e to the minus three times 100 is equal to eleven point six three e to the minus three times 100 is equal to one point one six volts so I start with five volts can i zoom out a little that's all I can do okay so I start out with 5 volts I have three point eight four volts drop across the 330 ohm resistor and I have one point one six volts drop across the 100 ohm resistor huh something very interesting what is three point eight four plus one point one six it's five okay so what you can see is it's almost like you 5 volts to spend you spend 3.84 volts across the first resistor and you spend 1.16 volts across the second resistor and now you're back to ground and so you've used up all your voltage and so what you see is the voltage around a loop is going to sum to what your supply voltages and that's kind of a handy thing to know because after you do a circuit analysis like this then you can actually check your work you could do this same thing with three resistors it's just the RS would then be r1 plus r2 plus r3 you would have your equivalent resistor resistance you would calculate the current and then you would take that current and you could find the voltage drop across all three that works as long as there's only one loop in your circuit and everything is in series okay now let's actually build this circuit all right let's build this circuit with our kit we have our prototyping board so I'll put that there I'll bring the Arduino in and then if you look in your a Lego kit you will be able to find a 330 ohm resistor and you will be able to find a hundred ohm resistor and then you're just going to need a couple of wires the interesting thing about this is I am not even going to hook up to one of the digital pins I am just going to hook right up to this 5 volts that is over here on the other side because I'm not even in need of switching this thing I am just going to hook it up to the 5 volts so I will get a red wire and I will put it into this 5v you see the pin that says 5v I will bring it over to let's say I kind of like to start in column 15 like that and then I'm gonna get my 330 ohm resistor one leg is going to go in that column 15 the other leg is going to go in column 20 you understand it doesn't matter specifically what you do it just matters that the dots the holes in a column are connected and so now I've got five bolts to one leg of the resistor then what do I need I need the bottom leg of that resistor to hook to the top leg of our tooth so I've got r2 here do you think I should zoom this in to help you see a little better maybe so okay maybe a little too far I want you to see the whole thing but as close as possible okay so now I'm gonna bend this nice like that okay easy to use so now this is gonna go also in that column 20 and then jump across this trench why do I jump across the trench because the columns above the trench are not connected to the columns below the trench and so now I have made this circuit right wrong what am I forgetting I have to take I have to take this column the bottom of the resistor that bottom of that are to that bottom of that 500 ohm resistor and I have to connect it back to what back to the negative which is the GND right the GND is right next to the GND is right next to pin 13 okay so I hook this up to 5 volts so I don't even have to write a program we do not even have to write a program why do we not have to write a program we do not have to write a program because the 5 volts is always on and so I have created this circuit and what do I know I know that the current through that circuit is eleven point six three milliamps well you might say how do we know that you know shouldn't we check it all right the easiest way to check it instead of measuring the current is to measure these voltages across r1 and r2 and so let's start by measuring the two alright so what I have here is and if you don't have one of these if you're gonna be in the you know kind of in the engineering arena you really really really need to get you a simple digital voltmeter I think they're about 50 bucks and I will put a link down below this mass tech that I have is a really nice one but this mass tech that I have it's a really nice one it's a little older though and so the versions that they have now are are a lot better let's see hopefully hopefully I'm out of the way here and so what I do is I set this on DC voltage it's the voltage with a straight line and then what I have here is you can see that I'm connecting the voltmeter through its leads all the way to these things so I can plug them into the board so the first thing that I'm going to do is I'm going to go across the supply so I'm going to connect to the same column is that red wire which goes to five volts and then the same column as I do need to get out of your way here the same column as this white wire and look at that I'm measuring the voltage that is coming out of the Arduino now what you know is we were expecting five volts to come out and you can see that we have about four point eight six in this particular case I think we're probably this meter is accurate to within a few percent so probably we're not getting the full 5 volts out of this Arduino we're getting more like four point eight six maybe it's just the regulator in there is not perfect but we're at four point eight six volts so that means our numbers are going to be a little bit off because we did the analysis based on five volts and so our numbers are going to be a little bit off but can you see how I have this hooked up and let me put it to make sure that you see it I'm going all the way this is one leg of the meter is hooked to the red wire which is five volts and this black wire is the other leg of my meter and it is connected to the ground all right so that is how it's connected and that we would have expected to be 5 volts but it is 4.9 so the Arduino is not giving me exactly the voltage that I expected okay now this lead here remember goes to our meter this lead goes to our meter and so what we are going to do is we are now going to measure across the R - okay we're gonna measure across the r2 so one lead of the voltmeter will go above r2 and the other one will go below r2 so if we look this already is below r2 and this one needs to go above r2 and I will put it right there and then what do we measure when we do that we measure 1.16 volts which is exactly what we calculated it should be one point one six volts across this r2 now we want to measure across r1 so to do that I would put the red lead above r1 and the black lead below r1 coming off of our meter and so let's get those two get those two leads okay so here I have them here I have them and so I'm gonna put one above our one by putting it in the same column is that lead and then the same column is the other lead so again I put one in fifteen and one in 20 and then what I am doing is I am measuring across r1 and if I measure across r1 I am measuring v1 right I'm measuring v1 I'm measuring three point seven three what did I calculate that I was expecting 3.8 for this is about a tenth of a volt off well why is it about a tenth of a volt off it is about a tenth of a volt off because I don't actually have 5 volts I'm starting with 4.9 and so that's why we get a little error though the math and the physics work perfectly but I'm not getting the 5 volts I anticipated so this number is just a little bit off boom we have done our first circuit design and analysis we built the circuit and we've tested it and it is behaving as we anticipated ok so again if you don't have one of these one of these nice one of these nice digital voltmeters look in the look in the description below and you can go ahead and get one because they're they're really really very useful and in particular when you're doing troubleshooting you really need to have a volt a volt meter like that because imagine if your circuits not working you don't know why it's working and you're sort of blind is it that like let's say one possibility would be a resistor is burned out or bad and other possibility is your Arduino is broken and not producing a voltage so you really need a voltage meter like that to poke around and understand what's happening on your circuit ok now guys leave this circuit set up because we are going to be using this again in lesson number 10 what we're gonna do is we're going to try to measure this voltage we're going to try to measure this voltage not with a voltmeter but we're going to measure it with the Arduino and so so far everything that we've done with the Arduino has been to send signals to the pins in the next lesson we're gonna learn how to read a signal from the pin okay guys does this make sense am i boring you as I'm trying to go a little bit more into the engineering let me know in the comments below what you think I just felt like my first series of lessons was just kind of coding it was just like copy what I'm doing and write the code and I'm trying to to understand a little bit more of the math a little bit more of the physics and a little bit more of the engineering behind what we're doing let me know down in the comments what you think think about giving us a thumbs up think about subscribing hey I've been getting a lot of comments and emails from people that you're not getting my notifications when I put a new video up on the subscribe button make sure that you click the bell if you click the bill you'll get notifications and I am really doing a lot of videos here so make sure that you click that think about giving us a thumbs up subscribe share this this is pulmicort err I will talk to you guys later
Info
Channel: Paul McWhorter
Views: 252,000
Rating: undefined out of 5
Keywords: STEM, Arduino, Tutorial, Ohm's Law, Circuit Analysis, Circuit Design
Id: BR0t3oPiWfA
Channel Id: undefined
Length: 29min 33sec (1773 seconds)
Published: Thu Jun 27 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.