Arduino Uno R4 Wifi LESSON 2: How to Build Circuits With a Breadboard

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys this is Paul mcarter with toptechboy do.com and we're here today with episode number two in our incredible new tutorial Series where you're learning how to think like an engineer using the Arduino R4 WiFi board what I will need you to do is pour yourself a nice tall glass of ice cold coffee that would be straight up black coffee poured over ice no sugar no sweeteners none needed and as you're pouring your coffee as always I want to give a shout out to our friends over at sunfounder sunfounder is actually sponsoring this most excellent series of video lessons and in this class we will be using the sunfounder elite Explorer kit now if you guys do not have your gear yet take a look down in the description there is a link over to Amazon you can hop on over there and pick your gear up and believe me your life and my life are going to be a whole lot easier if we are working on identical Hardware but enough of this Shameless self-promotion let's jump in and talk about what I am going to teach you today first of all I hope most of you guys did your homework last week what was your homework assignment we had the Arduino R4 board and we showed that we could blink that onboard LED because that onboard LED was connected to the pin on the Arduino board pin 13 so if we turn pin 13 on or high put 5 volts on it the onboard LED comes on if we turned it off the LED turned off so it was really cool we wrote our first program last week but what your homework assignment was was to see how quickly you could blink that led and have your eyes still perceive it as blinking and not just look soft it now you were supposed to post that to YouTube and then you were supposed to link back to my video and then down in the description you were to link over to your homework assignment and I look at every single homework assignment that you post and I try to make comments on it okay so make sure you guys are getting your homework done so last week we wrote our first program blinking the LED that was on the Arduino board or what are we going to do today we're going to build our first circuit and we're going to build our circuit and we're going to Blink an external LED we're still going to be using that pin 13 still turning pin 13 on and off so the coding is not going to really change but what are we going to do different we're going to build our first circuit does that sound good I hope it does okay let me have a sip of coffee let me get out of your way and then let me come over here and let's see if I can kind of draw this thing up for you so if we are going to build a circuit the first thing that we're going to need to do is kind of have a schematic or a road map of what this circuit is going to look like and what's it going to do well the first thing we're going to start at the Arduino and that is going to be our voltage Supply and we draw a voltage Supply as a little circle with a plus and a minus it almost looks like a little battery okay but we're not using the a battery is our voltage Supply we're using the Arduino board what on the board we're going to be using pin 13 we turn pin 13 on and off that will be turning this voltage Supply on and off now we're going to want to turn what on and off an LED well an LED we're going to put in the circuit here in our schematic and this is the symbol for an LED it's a triangle with a line like that okay now now what you're going to see is that when you get your LED out of the kit it has two legs one leg is a little bit longer than the other one and that's very important that long leg when we actually put this together you'll have a long leg and you'll have a shorter leg that long leg I'll call it l l always needs to point back to the positive on the voltage Supply okay so it has to go in this way it can't go in the other way if you put it in the other way it doesn't damage anything but it just won't light up it only lights up if it goes in the right direction now one of the things about the Arduino R4 board is it is able to generate 8 milliamps 8 ma 8 milliamps of current okay and so it's very important that we don't draw more than 8 milliamps at out of the Arduino pin because if we do you'll let the smoke out of the Arduino once the smoke comes out the Arduino won't work it has to have that smoke in there to work if you let that smoke out it's not going to work you're going to have burned up your Arduino and you don't want to do that so we don't want to just take this and connect it back to the ground we need to put a component in there to make sure that we don't draw too much current we want to limit the current we want to choke it down so we need to resist we need a what we need a resistor and so we are going to need a resistor in here like this and so then the other end of the resistor will come back to the Arduino so right here at the negative end that is going to be the gnd D the ground pin okay the g& D pin what is the the plus that is pin 1 so the voltage supp Supply the Plus on this schematic goes to pin 13 and the minus on the Arduino goes to g& D or the ground now we're going to have the plus of pin 13 we're going to have that connect to what the long leg of the led the short leg of the LED is going to go to a leg of the resistor and then the other leg of the resistor will come back to ground so it's like we're creating a pipe and electrons will flow through that pipe and the amount of electrons flowing through that pipe is the current the current is represented by the letter I okay I represents current and that current we want to be no more than 8 milliamps if we just plug this in without the resistor the current would be more than 8 milliamps we would either burn out the LED or we would burn out the Arduino or we would burn out both so we need to put a current limiting resistor in here but what value of resistor we have to calculate that value well how do we calculate it we calculate it using ohms law okay we calculate it using ohms law and I'll go ahead and label this as R our resistor well what is Ohm's Law ohms law says that the voltage across a component is equal the to the current through the component times its resistance V is equal to ir and that is ohms ohm was a person ohms law okay OHS law now what do we know we know that that pin 13 on the Arduino generates 5 volts so we have that so the V is going to be five all right now what current do we want we want 8 milliamps but you don't plug eight in here because You' got to plug it in in in amps well what does Millie mean Millie means 1 1,000 okay so to change this to amps we're going to say I is equal to 8 and the Millie becomes divide by a th000 like that so the current is going to be I is equal to 8 / a th000 and then we are in amps so we have replaced the M where we had M we've replaced the M with 1 / a th000 okay and so here we are the current that we want is 8 ided 1,000 amps and we can put that in our calculator and even though I can do that in my head I'll do it along with you 8 ided by 1,000 is equal to what .008 so this is 0.008 now what are we back here at ohms law 5 V is equal to I what current do we want 0.008 time the resistance so what is the resistance that's what we're trying to figure out so what do we want we want R by itself on one side of the equation so how do we get R by itself we divide both sides by 08 so 5 / 008 is equal to 008 / .008 which is just one and we're left with what R so R is going to be equal to 5 ID .008 5 / O8 is equal to 625 okay so the resistance that we want is 625 and the unit is ohms and it's that symbol so the r that we want in this circuit is 625 ohms so we've got 5 volts we've got an LED we've got a resistor and so now we need to build this circuit okay we need to build this circuit so what we need to do is we need to get our components out of our kit well what are we going to need first we are going to need this voltage Supply where do we get the voltage we get it from pin 13 of the Arduino and so as you get your kit here let me back up so you can kind of see this okay as you get your kit you need to look down here and you need to find your Arduino so you're going to need that okay what else are you going to need you're going to need an LED well the LEDs are here mine are in the upper left and they're these little things now very important we are going to use a red LED blue LED are only for special occasions so you are not to use a blue LED only in this homework assignment you have to use the red LED so we're going to get that one out we'll save the blue ones for something uh some special occasion in the future so I get the red LED out and I seal this back up and I put it back in there so now I have the LED now what do I need I need a resistor okay these are the resistors and there's many different resistors but we'll just get them out and then we'll find the one one that we want so we've got the LED we've got the resistor let me get my Arduino out I'm kind of trying to lay this out like we're going to build it and so here is the Arduino and then here is pin 13 that is going to be the plus here it's going to go over to the led the LED is going to go to the resistor and I need a resistor of 625 ohms well you cannot you can imagine that you want uh you're not going to have exactly 625 ohms so you want to find one that's close to that so let's get these resistors out and let's look and see what we have here okay we see that we have 10K and we're going to learn that k a stands for th000 so 10K would be 10,000 ohms that's that's way too big that's not very close to 625 so we're going to put that over there we don't want that one oh look 1K would be 1,000 1,000 is pretty close to 625 so we are going to keep that one here uh this is 330 ohms well that's kind of close to 620 so we'll keep that one this 100 R would be 100 ohms 220 ohms well the thing is 330 330 is closer to 625 than 220 so we're not going to try that one 1 M would be a million ohms 10 R would be 10 ohms that's much too small 100K would be 100,000 that's much too large 5K would be 5,000 that's much too large 2K would be 2,000 that's much too large so what we have is the two contenders are 1K our two contenders are 1K which is 1,00 and 330 ohms and so now we got to figure between those two what would we want between those two what would we want and it's very important for us to approximate this correctly okay it's very important for us to approximate this correctly what are we trying to do we're trying to limit the current so we don't burn out the Arduino so if the resistor is a current limiting resistor should we use one that's a little bit too big or use one that's a little bit too small since it is resisting current and resisting burning the Arduino out we want to use the one that is too big 1,000 because if we use the 330 ohm it might actually let the current be enough to burn this thing out and so we are going to use one of these all the rest of these are going to go back in the package and go back in the kit okay so keeping our K kit neat as we should now what I'm going to do is I'm going to pull one of these off so you just kind of pull it off and I'm going to try to put it back later and so there I pulled it off now these I'm going to put back in the sack okay we are moving along very nicely here very nicely okay I think I can zoom in a little bit now so you can see more what we're working on okay so now to build this circuit what I'm going to need is I'm going to need a couple of wires all right so this and remember the long leg has to go back so I need to connect this over here to pin 13 then I need to connect this to one leg of the resistor and then the other leg of the resistor needs to come back to pin uh the other leg of the resistor needs to come back to gnd D or ground okay and then I'm going to kind of like complete my circuit and then that old program that we used last last week should work now I'm going to need a couple of other things I'm going to need a couple of wires and so get out of your kit I'm going to get the black wire okay and that's in the lower level in the red wire all right now the red wire typically stands for positive so I'm going to take that red wire and I'm going to put it into pin 13 and you got to look really careful you don't want to miss that but that will plug in let me see if I can let you see that a little better yeah see that I'm going to go right into pin 13 there make sure it's all the way in and then this other one is going to be our ground okay so now I have pin 13 and I have my ground and then this red wire which is the PIN 13 it needs to go to the Long Leg of the diode and then the short leg of the diode needs to connect to either leg of the resistor so on the diode it has to go in the diode has to go in the right direction the resistor can go either direction okay the resistor can go in like this or like this either one will work okay so you see I've almost got my circuit hooked up here but I got to get it all hooked up okay I've got to get all those different pieces hooked up and in order to do that you need to learn how to use a breadboard and so inside your kit on that top level is a breadboard and what you do is you build your circuit on this breadboard and it allows you to make all your connections nice and easy and neat but in order to do that you have to understand how the breadboard works okay so I'm going to give you a quick summary here of how the breadboard works and so this is a schematic of the breadboard now what the key is is to understand on this spread board uh on this spread board along a column do you see this red column here all the holes all the holes along a column are connected together so if I wanted to connect the short leg of the led to a leg of the resistor I would need to plug the short leg of the LED in here and then one leg of the resistor into the same column because the holes in a column are connected so if I plug something in here and I plug something in here they're going to be connected so holes in a column are connected together holes in a row are not connected together so if I plug something in here and here it is not going to be connected together so oscillation along the row connections happen along the column but there's a special case across the trench look at your breadboard running down the center is a trench they are not connected across the trench so all of these in red here are connected all of these in blue are connected but these red holes are not connected to the Blue Hole so if you plug something in here and plug something in here they would not be connected okay columns are connected together columns columns are connected together but those columns are broken across the trench and then a long a row you are not connected there's four special rows all the holes in the top row are connected together and you can remember that CU you see this blue line and that blue line shows you that they're all connected Ed together now the second row is all connected together so all the holes along the second row are connected together same thing with the bottom row all of those holes are connected together and the second to the bottom row all of those are connected together so the top two rows special cases the bottom two rows are special cases along a column you're connected along a row you're not connected and the columns break as it goes over that trench okay does that make sense I hope it does so if it doesn't go back and listen to that again cuz you really need to understand how these things work so we're going to come back now I've done most of the work for you right so what I'm going to need to do is I'm going to need to bring my voltage in and then that voltage is going to need to connect to what see see what you got to do is You' got to kind of go from this Matic which is kind of abstract to a physical circuit here on the breadboard and so you will be bringing in your voltage okay and then that you will want to connect to the Long Leg of the LED right the long leg of the LED so let's see I could have something kind of like this right now to connect to that long leg of the LED I need to connect the voltage what in the same column as the long leg of the LED so can you see that same column as the long leg of the LED and I've just made this connection from pin 13 to the Long Leg of the LED now you've got to figure out where the short leg of the LED goes and then you're going to have to bring it back home by bringing it to uh by bringing it to ground and so what you'll do this is going to be what your homework assignment is okay now what your homework assignment is is to finish hooking this up remember I've got the black wire here I've got this finish hooking this up and then make this led make this led blink the SOS what is SOS it's three flat fast blinks d d d and three long blinks da da da and then three short blinks d d d so you're going to have to write a program that does d d d da da da d d d and you're going to get this to Blink you're going to get this to Blink the SOS the morse code SOS so you see I didn't finish this for you you're going to have to think through it now next week I'll show you my I'll show you the solution I'll show you the solution but your homework assignment is to finish fixing the circuit and then write that program you should be able to do it because we wrote a program to just blink it simply so now you're going to have to Blink it more complicated and then what you do is you make a video showing your code and showing your uh circuit working you post that to YouTube in your video description link back to this video and then in a comment down below link over to your homework solution so I can run over there and watch that work so I'm just going to see I'm going to see if you can do this with just what I've shown you and then if you're successful leave a comment down below I Am Legend double chest bump and if you're not able to do it leave a comment down below I fold it up like a cheap Walmart lawn chair and then next week what I'll do is I will show you my solution in case you guys are struggling with this okay guys what have we learned in the first two lessons of this class well last week we learned how to program the Arduino our first program we learned that if you're going to talk to one of these pin on the Arduino you have to do a what a pin mode do you want to do it over and over or one time you want to do it one time so you put your pen mode where in your Void setup and then you want to what blink you want to Blink one time or over and over over and over so you put the blinking where you put the blinking in the void Loop okay and then we've learned how to do our pin modes we've learned how to do delays and we've learned how to do digital right high and digital right low and so if you look at what I showed you today in class and you look at what I showed you last week you guys should be able to come in and you should be able to finish this circuit and you should be able to make your LED blink man I hope I haven't challenged you too much but you guys do it be sure and post your homework okay now also I want to give a shout out to you guys who are helping me out over at patreon really appreciate it appreciate you guys standing beside me also you can help me by leaving a thumbs up on this video if you haven't already subscribed to the channel when you subscribe to the channel make sure you ring that Bell so you'll get notifications When Future lessons drop and most importantly share this video with other people because the world needs more people doing coding and fewer people sitting around watching silly cat videos Paul mcarter with toptechboy do.com I will talk to you guys later
Info
Channel: Paul McWhorter
Views: 9,705
Rating: undefined out of 5
Keywords: STEM, LiveStream, TopTechBoy
Id: S1NJJRpWHpA
Channel Id: undefined
Length: 25min 22sec (1522 seconds)
Published: Thu Feb 01 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.