Raspberry Pi Zero: GPIO Pins

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] welcome to another video from explaining computers.com this time I'm going to fit some gpio pins to my raspberry pi0 I'll then connect the pie up via those pins to some LEDs write a bit of python code and test whatever is working okay right to uh fit some GPI Ops to our PI Z we have to start obviously with pi Z here it is I'm going to take out the SD card because we may do some damage doing this so we might as well at least have that out of Harm's Way now we have to have some pins to fit and for that I'm going to turn to this which is the exciting little tin which came with my Pi Z from The Pie Hut almost everyone selling you a pi Z will try and sell you a extra bit so they can have some profit margin at all on these things and this is a very very useful little kit and it's very exciting CU it comes in a tin great to see I like little tins I love that you can put the tops on take them off very good anyway in here under the piece of foam there were various things and let's actually just tip them out have them all all there to uh play with there we are I've shed you some of these last time this is the connector for attach ing fulls sizee USB peripherals and there's the HDMI thing I happened not to use and there's some sticky feet here which you can use to stick feat on but the critical things are these which are gpio connectors for our board and they give you a range of options here they've got a gpio connector like this one this is the standard gpio connector this would simply drop in like that on on the board and we then just have to solder on the back and indeed that's exactly what I'm going to do and that will give us these GPO pins on the top just like any other pip but if you wanted to you could fit one of these this is also a gopo connector but this gives you sockets you can push into rather than um standard pin so you might want to try one of them um or you can do this in pieces you've got single connectors here there's one there and there's one I just left in the Box over here here it is look you could fit those I'm not quite sure why that that's better but maybe you want one fitted we might use bits of those in the future to make a video connection actually or you could fit one of these which is a right angle connector so this would give you the opportunity to have gpio sticking out the edge which given how thin a raspber pi Z is that could be a rather useful thing to do but here I'm going to stick with the standard connector to make my Raspberry Pi Z look as close as possible to a standard Raspberry Pi with its GPO pined now now in addition to that we'll need a few other things not least we'll need a soldering iron to solder on our gpio pins this is a brand new soldiering iron I bought brand new Soldier iron I think a silver line Soldier iron I bought a new Iron because the tip on my old iron was in not very good condition and did a very fine tip to work on Raspberry Pi's pins and so couldn't get a new tip from the old iron it was barely 20 years old you just can't get the parts these days so we got this new iron this is a 15 WT soldiering iron I would advise a very low wash iron to work on delicate electronics and I've also even got the nice stand you don't have to get the stand like this but if you don't spend a few dollars or pounds buying a stand the things you burn holes in by not having a stand I'm sure will cost you more and this also has a bit of sponge here which I've damped down so we can very gently just keep our tip nice and clean when this is actually hot final thing we're going to need is some solder this is some solder this is a lead based solder so these days sometimes you get to non-led solder I'm choosing to use lead solder here for the simple reason that lead based solder has a lower melting point so in terms of doing delicate work on delicate electronic boards which let's be honest we're really designed to be solder by machines we might as well give us best chance of getting this right and doing no damage so this is traditional lead based solder do remember not to give traditional lead based solder to your child to suck on as a dummy I'm sure you would it's course very poisonous don't go soldering water pipes and things with this but for delicate electronic lead Bas solder is the best thing to use right with the soldering iron warmed up and the pi Z nicely fastened down with blue Tac to hold the gpio pins in place till with solded them it's time to take the apy Zero's life in our hands and go in with the soldering iron this is my brand new soldiering iron I'm just starting over here hold this holding IR on heat the pin and that and then hopefully just a little bit of solder will melt doesn't want to melt go on there we are little tiny bit older on the that's not too bad is it we try another one one over next to it why does it have so many GPI open pins can hait it little tin of bit older and there we are oh this will work it's going to be a rather long process as you can see but it will what one see don't get too cocky don't think it's working too well or it will stop working that was a good one wasn't it and uh moving along I seem to be getting better as I go and just finishing off there the last one uh I think we've got all 40 GPI openings now soldered to our PI Z [Music] so if we just uh go in and have a look underneath take off the blue tack hope it hasn't melted anywhere it shouldn't doesn't look like it has actually this is quite a quite good isn't it off no the board looks fine we've survived soldiering with me in one piece and hopefully this although we'll find out it still works in a second but as you can hopefully see those are nicely securely fastened on pins is my soldering perfect there no it isn't but um it's not bad for machine it's not a video of the best a solding onto a Bard but hopefully it's not too bad I just bring in there where where are you there's a um Raspberry Pi 3 soldering let's slick that over there's my soldering is my soldering as good as a machine it isn't but hopefully it'll be good enough to work and as a special present for the Piera for having endured the soldering I'm going to fit it in a pie one of these little cases from poni you might remember I bought two P 1K with this nice little case so I'll C out the packaging oh it's exciting isn't it like a proper Christmas present this one cuz it comes in packaging like this uh these are layers of acrylic that fit together to make a case if I can get the thing apart it's wow that's well packed that is isn't it and uh here we have what different layers of plastic here and um some tiny plastic screws I think we would call those and so what we have to do in theory is to take out our plastic screws take car Pi Z there and uh I think it starts with the the bottom layer must be I presume that one cuz that is a dark colored I've got to figure out how this works now haven't I how does this work exactly or is that the top one I think that's the top one let let me sort this out and by the magic of film making show you all put together there we are it works perfectly well just stack with different layers of plastic on top of each other secur them with these plastic icated screws only thing I don't like about this case is you can't access the SD card SL when things are in the case but actually that's not that much of a problem to change the card very frequently and so there we have our Raspberry Pi Z encased with a GPO pins fitted on the back there and it's now time I think to do something exciting with those gpio pins right to test out our new gpio pins I've got the pi Z fastened down here on a Surface next to a small breadboard I'm going to take these two red 5mm LEDs and connect them to the pi to the GPO pins and connect them in series with these 470 ohm current limiting resistors L to debate online about exactly which resistors you should do use with LEDs on the Raspberry Pi it does depend on the LEDs themselves have different electrical characteristics but if you use 470 oh resistors you should be very very safe you won't blow things up I've also got here some wires to actually connect things together so I'll start putting things together here and I'm sure I'll show you on screen a diagram what's going on as well so you can see the connections and I've done this previously in my Raspberry Pi robotics number one video I connect pin six here on the p goes to our ground rail on the um breadboard these wi prob we go off screen now you can still see them that's good and then going to connect pin 7 a nice orangey wire there which must be the pin down there must get these pins right pin seven it won't push in push in oh it has pushed in it wanted to play in the end and that's going to connect to this first rail on the breadboard we're then going to connect that to a LEDs positive terminal there that's a longer wire which will go into there like that and then we'll Loop that back to ground rail using a current liting resistor which had just taken off screen so I can actually get that in there and in there hopefully push that in and in there we are so that led is looped through from GPO pin through through the LED through a current liing resistor back to the negative rail we'll do that for the other one which is going to be on pin 11 if I can count so it is what 7 8 9 10 11 is that one there that will also Al connect in to uh the breadboard we'll chalk that over here oh get your wiing can you put wiring in there that's going to go to positive on here like that and finally oh it's getting exciting now take the final resistor form it up put it in and we've now got beautifully connected hopefully there we are two LEDs connected up to our Raspberry Pi so we can hopefully control them via some python gpio commands right I've now connected up my Raspberry Pi 02 HDMI from monitor to power and to a combined keyboard mouse combination my little Ry keyboard linked into the One USB port and as you can see I booted here into the rasbian desktop in many ways we much better be running in command line mode for doing GPA work on the pi Z because of the One USB port but here we'll stick in the raspin and then we'll do other things maybe in the next video so here I'm going to run up the uh terminal and in the terminal I'm going to type PSE sudo and idle to run the idle programming environment in root mode you have to run in root mode if you're going to access to gpio pins and then we wait a little minute because we are on a Raspberry Pi zero not quite as fast as a Raspberry Pi um well two or three and now let's move that across so you can see things properly and then we'll go to a file and I've actually written the code for this still trying to make things work exactly on this little keypad go on your little swine and we want that bit of code there which I've already written for us and I'll just move this across the screen as well you don't lose me on the edge and I flick a normal Mouse by the magic of film making because it was driving me mad to have that little pad thing anyway I've written some code here I've inut comments in my code because people know I don't put comments in my code but basically here we're going to import some libraries to use in this with a code the first library is the GPO Library which you probably guess we need to run GPO stuff and I'm going import the library called time which gives us some time function I'm then going to uh set numbering mode of the gpio pins there's different ways you can address the pins in terms of which numbers correspond to which pin obviously clear is to get that right I like board mode it's the simplest one it just labels them across 1 2 3 4 5 6 Etc and then going to set pin 7 and pin 11 both as outputs those were the pins we connected our LEDs to and then we've got a very very simple little Loop to blink our LEDs 10 times so we're doing a little Loop there for X in range it'll flick through and then we're going to set initially the first GPO pin pin 7 to true and 11 to false so one LED is on other one's off wait half a second with time sleep. five flick the GPO pins over so the one that was on is off and vice versa wait again it'll cycle through the loop and finally on the end of this we're being tidy we're setting our GPO pins back to a nice clean state with GPO and cleaner as I said previously I've done this in much more detail in my previous raspber py robotics uh number one video so this is basically just to test things are working today so all I have to do now is to go to run and a run module and hopefully we flip back to the actual thing yes we have got is going bing bing bing bing isn't that exciting if it's not exciting for you you probably shouldn't be doing this kind of stuff if it is exciting then we've done something really cool we managed to attach some gpio pins to our raspby PI zero not blow the thing up and to prove they actually work with some gpio pins fitted the Raspberry Pi Z is all set for a wide range of embedded applications some of which I'll explore in future videos but now that's it for this time and I hope to talk to you again very [Music] soon
Info
Channel: ExplainingComputers
Views: 200,150
Rating: undefined out of 5
Keywords: Raspberry, Pi, Raspberry Pi Zero, Zero, GPIO, pins, solder, soldering, LED, Python, program, programming, resistor, Christopher, Barnatt, computer, control, output, connector, Pibow, case, code
Id: 97Or02ihJMo
Channel Id: undefined
Length: 14min 46sec (886 seconds)
Published: Sun Mar 27 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.