hello everyone and welcome to this firstsession of the arduino tutorial series now what i want to do in the spiritstations i want to kind of lay out the format of the future sessions in thisarduino tutorial series we're also going to indecision we'regoing to cover off how to get started with your arduino and how to connect toyour pc because believe it or not there's quitea few challenges which you could face their want to talk about thealternatives to arduino and i want to cover off kind of the philosophysurrounding arduino and and then perhaps the use of my form and how that can beuseful and what have you
so first of all let's cover off thealternatives to audrina because i know in the previous videos that i did peoplementioned that there are clones of the arduino and other either microprocessorplatforms which can be used for this kind of development environment and yesindeed they are one that's one of the philosophies when this with developerswho do it was developed as an open source environment so anyone can copyand clone the arduino board and people obviously have done so what it would sayto you is that there are quite a few challenges being faced even using thegenuine so-called genuine arduino boards that if you are going to use it alonethen just do your research and make sure
that it is a hundred percent compatiblewith our arduino and the code and what have you because that might pose a few challengesfor you if there are some issues there then as i said there are the hardwareplatforms and which have been developed which are in fact in many ways farbetter than the microprocessor which you get on your arduino and i'm i'm surethat in time to come i must write stop playing around with those two but the reason i kind of i've starts off with are doing i think alot of people start off with arduino and
why i think it's a good starting placefor a lot of people is that there is a lot of support for our dinner in termsof the add-on kit the projects and code which is already been written and theadd-ons what have you on numerous the forums to help you get back the tutorials so if you're a beginnerand kind and need a favorite of help getting started then that's why i think our arduino is agood place to start i think you become fairly advanced andare going to get into serious microprocessor development and what haveyou
then you will move on from our do youknow because then it there are certain limitations which might hamstring you ifyou stick with this platform that being said if you go in search then net andhave a look at the projects which have been done with audrina i think you'll bevery surprised at what has been done and achieved with this little bored right sobefore we get stuck into understanding more about arduino it step itself what i want to explain and go throughhis kind of my philosophy in the way i'm going to approach this tutorial seriesand then also talk a little bit about the kind of what i call the arduinophilosophy as well now there are loads
of tutorials on how to get started witharduino and if you after the little quick videos which talk you through somecode and how to do flashing lights and what have you been sitting and say don'twaste your time on on my videos because that's not what they're going to beabout i'm sincerely hoping to do morereal-world tutorial where i'm not going to try and spoon-feed you and talk youthrough some code on a screen because i don't believe you're going to learn thatway the best way you're going to learn is bytrying things yourself banging your head and learning throughthat process and in fact i mean that's
in this past week with my playing witharduino that's exactly how i've learned to fit and so i'm going to walk youthrough the potential stumbling blocks the the thebig stumbling blocks which might repeat because there are some stumbling blocksout there which may get you so a so frustrated that you just want to checkit in a drawer and and and leave it and there again is i want to warn you thatit if you don't have the patience to injure some of the stumbling blocks whathappy then perhaps arduino isn't the platform to you in my mind it's a it's a fun engineeringplatform which involves a lot of trouble
shooting so it involves a lot of troubleshooting to get your your end result potentially because even if you do knowhow to code will write the programs or scripts and put the little hard way butsome pieces together they all still be some bits along the way which arepotentially going to trip you up as i've come to discover when we still win weedsin series two in the second episode of this i'm going to actually go through myfirst project and that project is a simple voltmeter but i've added somefunctionality with max average and even that little exercise here has revealed alot to me in terms of limitations within the code and the libraries that you getwith arduino even the display units and
that is something i'm a highlight imentioned that like for instance you get these lcd displays and i said i've gonefor the serial enabled one because you don't need so many wise to connect it upmore heavy boy oh boy does pose a few challengeswhich i'll talk about in the second episode when we do that voltmeter project so as i said i'm goingto talk through those things and try and show you real world issues which happywill help you i'm also going to try and give you thekind of impetus or act as the catalyst to jump into interesting projectsyourself because as i said that is the
way you learn so there's going to be alot of talking a lot of showing you bits and pieces these videos might be a bitlonger than the normal quick tutorials other tutorials you get to see but i said it's going to be morehopefully full of the more real-world stuff and also jumping into some of theactual bigger projects like as i said there will be the voltmeter i want to challenge do they are focusedon the forum like workers doing an mpp mppt charge controller i want to do that as well there's adigital thermometer with let's say
logging to memory and all of those thoseprojects are going to bring up some potential challenges and someinteresting ways of working with arduino also just the code you want you canwrite code for arduino in a certain way and there may be some particularfunctionality and ways of doing things better or more efficiently i'm gonna try and cover that off as welland and hopefully is going to be an interactive learning experience formyself and those people involved to follow this series so let's also get stuck down into thephilosophy of arduino which i believe is
very is important because it a lot ofit's got to do with the philosophy and the way i run my kind of channel and myforum now as i said arduino was developed astheir kind of open source platform and to that end it it in essence is tryingto draw in a community of people who are going to help each other share id andshare ideas and i do believe it as the the developers is that have made thiskind of open source and sharing thing i think along with that comes theacknowledgement of what they provided to the electronics community andacknowledgement of other people's work so it's one thing i always want to tryand i'm going to try and do myself and i
heard you to do as well is that once youstart getting into and either writing your own code or grabbing ideas off theinternet because that will be one of the big things you'll see a piece of codelet's say for this voltmeter you'll see a piece of code or quarter sketch on theinternet you're going grab it and you put it intoyour for arduino program or ide or compilerand you may make a few tweaks to it and go yes look this is my piece of code butthere what you should do is if you've takensomeone else's concept or their code and made some adjustments to it
you should acknowledge them in the codeitself i think that's quite important in that if you give acknowledgement to theoriginal person who came up with the code and you can then add your name asthe person who's added updates or modifications to the code and if you goand write a whole piece of code yourself because of some idea you came up withwords totally fresh new piece of coal andguess what you can claim the kind of rights that piece of code and hopeyou'll go and share so other people can benefit as well so that's kind of thecertainly the arduino philosophy that i hope people are going to follow
ok and as much as i i really do hopethat you all use my forum as a place to share your ideas and your projectsrelated to arduino ide be the first one to admit that let's say for instance you are having aproblem with a piece of code and you're getting areas or what have you i'm certainly not going to have the timeto go through those and troubleshooting because some problems can be so uniqueto the hardware and the libraries and what have you that you using it can bevery difficult to troubleshoot and there are loads of forms out there on theinternet i'm going to place a few links
below to the a few key areas where thereis a brilliant community that can go and try and assist you with that with thoseissues they aren't enough people in my forum dedicated to let's say arduinocoding that i think you might get the help that you need but by all means if you got a greatpiece of code that works and a great project put it if you do have achallenge that you you want help with posted there and seeif you can get the help but i'd say they certainly are better well there are many farm or other peopleinvolved in other forms that are going
to p with that right so let's try and getstuck into the basics of getting started i'm going to go through the process ofhow you connect your arduino to your computer because i said that poses quitea few challenges it it hang me up for a day very silly issue but it's one of thoseissues i think that can potentially catch quite a few people out i'm also going to put the audrina on thebench now just quickly give a description of what it's all aboutthat's the basic arduino and some handy
tips for when you get started as well interms of having some insulation or some pads and me we'll talk about that andalso before get through all that you can i'm going to rip be referring to somebits and pieces that comes out of this getting started with arduino book thisis written by massimo banzi i've got to correct he's it one of the catcofounders of arduino this book and all the arduino starter kit some hardware isavailable on my anderson store you don't have to buy their it shouldn'tcost you any more but i certainly get a commission if you do so it's certainlysupports these shows and what i'm doing so again that it's great we can buy atexas certainly does help right let's go
have a look at the bench and have acloser look at the actual hardware itself and we'll talk about a little bitabout the board ok so here we have a kind of most the one of the kind ofbasic arduino boards to start with this is the arduino uno and this is revision3so you'll often see it solders arduino uno r3 there are biggerboards that you can start off with a rc cost a bit more money the the what happens in the biggerboards you get and they have a different microprocessor on them and they willhave more often will have more memory that you can store biggest sketches orbigger programs and you can store more
data but this certainly is a good if youtry to get into and see if you're going to enjoy it it'sa good way to start also the bigger boards have more input and output you'llsee the the strip along the side here these enabled you to talk to the art toarduino in essence and for the arduino to talk back to you through a wholerealm of lights and senses and what have you so let's before you even get down to thebasic hardware description of the board i'm gonna give you the one thing thatyou can do to start off with and don't look at my son my entirelyimplementation but what you might want
to do is put either get some four rubberfeet underneath your arduino board because more than likely you're going tobe resting on on surfaces and for one it might skip around which which doesn'thelp it also if you've got the usb into powerand to program it it then does get but skittish if you've got a heavy thickerand usb cable also if you're resting it like i dosometimes on top of my computer or something metallic the last thing youwant is the underside of the pcb and where the through-hole components comethru too short so this provided with it prevented fromskidding around and it insulates the
bottom of the board and i would highlyrecommend do where you put the stick on stick on foam pad like i have all therubber feet so it is something to do what you maywhat i found was on these big on the usb input here and on the power jack the tabs the through the peace thatcomes through the pc board was a fair bit longer than the rest so i got a pair of good sharp sidecutters and when i say do get a good pair of sharp side cutters because thebits that come through a quite thick and i snip those officer again they wereprotruding that match that made it far
easier to stick the pad on and you'vegot again even if you've got rubber feet you've got better clearance on the board that's one of the first handy tips then ok so let's have a quick look at the aredoing is to say i'm starting out myself if i if anyone comes across a mistakes that i made what have youplease let me know and i'll annotate gonna say this is a learning process forme as well now first of all the arduino can bepowered either by the usb got to connect to your pc it will be powered by thefive volts from your pc or it can accept
a dc power input over here through thisjack you can buy water what have you i tend to have a battery or lithiumbattery pack which i plug in this at least its mobile that's the one handy thing to thinkabout just a simple 9-volt battery with a power jack is the one easy way topower it if there's a range of voltages that it works off but can work up to 12volts if i remember correctly but i think the best recommend voltage ninevolts i'd stick with nine volts for perry it in in the jack also on these boards you will note thereare a few a couple of versions or later
versions of this board where they have asurface mount chip and i've mentioned this before my recommendation is to not go with thesurface mount chip because if you happen to make a mistake and blow something the one component you likely to blow isthe microprocessor and with the smd chip the surface match up on the board you basically going to end up throwingaway the whole board where is on this configuration with the tip or the dualinline package you can simply remove the microprocessor and slaton un it's a farmore efficient and cheaper way to get
around a little whoopsie right so then on the board we'vediscussed that the chip and the inputs now let's discuss the kind of may maininput output on it down the side the side here you there is a ground and then we've gotpins which are numbered from 13 down to zero and these are mainly your digitalinput and output and when i say input or output as you realize when we get tostart writing code for this you can define with a pan x's and input oroutput and and i've seen need the final trials the arduino is going toget confused not know what you want to
do on that pen so that is the digitalinput and output it's also got some pwm pulse width modulation input and outputas well then on this side we've got the way you can draw power either a 3.3volts or 5 volt and the ground respective to that and then you've gotsome analog input now the analog inputs is in the projectwhich we're going to first start off with the voltmeter in fact that is wherewe're going to be putting our input and just to tell you a little about theanalog input it's remember computer's operating 10 so they are digital sothough it says analog these analog inputs taken and log input and digitizeit
so basically if you put a 5 volt signalin in in here which is changing then it will represent it as a number between 1and 1023 so in essence it it created a digitalrepresentation of an analog signal going in there not critical to know at thispoint in time it's just a little bit of background on the digital one on thedigital inputs they rely on either being high or low res is representing either aone or a zero so you're very basic you a digital input or output into thecomputer world and the microprocessor right so the next thing is then toconnect the audrina to your pc so before you even start downloading the ide theide is the compilot program will go
through that terminology and what happywhen i've got a tap on the pc you to understand you want you going to want toconnect your arduino to your pc with your usb cable so the usb cable is alsoplugged into my piece you are ready and then going to connect this into thearduino and a friend what we're going to dump it change out to screen capture program soyou can actually see what's going on the pc now what is going to happen virtually on all pc's windows-based pcswhen you plug this in it's going to see the hard way it'sgoing to try and stall the driver and
it's going to fail and that's the part iwant to help you through because is a few basic steps and if you go slightlywrong you might really frustrate yourself alsosome of the instructions i've seen on the arduino site and internet diedexactly describe what potentially might happen on your pc and i'm going to tryand walk you through those as best i can ok so one of the first things are goingto want to do is actually download the arduino software now the if you go tothe if you just simply do a search on our of arduino in google you're bound tocome across the site over here but here's the address its arduino . cc andyou'll get to the homepage hair
here is a really useful spot for findingprojects and assistance on in forums if you do have any problems so this iscertainly a very handy resources loads of them but this is the main arduino oneand what you're going to do is you're going to click on the download link andthis is the software which allows you to compile your programs it's called theide it's where you write your sketches oryour code or your program and they've got several versions of the idea now thelatest one that's about all you will see here is our do you know one . zero . one so i'd suggest downloading this one anddepending on your platform obviously i
can only help you with the windows sideof it you click on windows and it's going to download a zip file and thatzip file you just x extract the files in that the bar to a folder of your choice now before we move away at your showthere are other versions all the versions here's one . zero then there's00 - 300 - - and i have found that that what they've done they've added certainfunctionality and what have you as the in the later versions oftenthey're not backwards compatible so what i'm trying to find out formyself nor and all highlight to yourselves is if there is a piece ofcode which doesn't work in let's say the
latest version of are doing a one . 01 then i might say you need to eitherinstall a load 00 23 0 0 0 to 2 i'd say if you want toensure you really compatible the safest version to go with is either 0 0 0 to200 2 3 because a lot of the code that i found has beenwritten in that but just be away for i having problems is worthwhile trying oneof the older versions so once you've downloaded the software you can installit into folding out again that the structure is entirely up to you but i'vegot a a folder on my harddrive called arduino under there i've got a foldercalled software
arduino and i've got all the versions ofthe software now you don't actually have to install the software so that's thebeauty of of our dna that there's no installation program once you've got thefolder extracted you will probably end up with a folder structure just likethis over here and this is your main editor or your ide as a call it whereyou write your code and all you have to do is lucky right click and send it toyour desktop or what have you aware of you like running your programs from isall you do need to do is execute that to actually write start writing yourprograms i'm gonna start highlighting when westart getting to the first project
there are certain libraries or whateverif you want to add bits of hardware like that cereal enabled lcd display thenwe're going to talk about what happens under the libraries but the criticalpartners you've got the arduino dot exe and the drivers and the drive is whatwe're going to need to be able to install the actual arduino itself so once you've got that there we canthen go to the device manager ok so i've got you on my desktop now andi'm using windows seven but these things are fairly similarly in windows xp so if you go to my computer the quickway to open device manager is to right
click and then go and click on managethen you'll get your a device manager opening up and so clickon device manager minimizer's network adapters there now here is where the challenges come atthe moment i've got the arduino and plugged and what i'm going to do imaximize the ports and calm lpt i'm gonna plug in there we go you might haveheard the noise we're plugged in the arduino uno r3 and it happens to come upon on come five now the challenge here is that itsometimes on some pcs will come up and reports common lpt and others will comeup straight under user-pc where mass is
not as a usb device now the reason it's coming up andshowing or finance all 6 i've got third the drives installed but what you needto be aware of is that sometimes when you plug it in and say because itdoesn't come up and a common lpt which is often where the documentation says itwill it can get rather confusing and you might be led down a line like i didthinking i need there something wrong and i needed to install ports and calmlpt but don't get caught up by that when your drivers are installed it willeither come up pick up under here or it will be directly under user-pc you justlook for where you get the kind of usb
and recognize or unknown usb device andthat's where you're going to go and check and try and install the drivers so i'm not going to try and emulate i'mgoing to remove the device from myself and then emulate installing it for thefirst time ok so let's go for a real world runningof what happens when you first plug in your arduino so as your notes there's no nothing under the devices orports here there's nothing and use a pc we've got you obviouslydownloaded and extracted your arduino
files to a folder that you know about i'm not going to plug in the arduino andjust notice what happens as you can see it says installing device driversoftware comes up as an unknown device and look at the next message which hopeyou'll come up marshall there we go the bus driver was not successfullyinstalled and this is probably what's going to happen to yourselves now then what you need to do is youclick on the device unknown device and as you can see it'snot under ports , or lpt because often they say go look there but as you cansee it's directly and under user-pc in
my case of as you can see it's got theexplanation it says unknown device so what you do is right click update devicedriver don't search automatically update so have you go for the manual option nowi've seen xp that this screen looks different but you've got to go for themanual option now you've got to browse to this folder here night this is quiteimportant i'm going to click the browse button and under here you can see i'vegot my software arduino and there's a drivers folder nowunder the drivers folder you've got this if tdi usb drivers now if you happen to go and click onthat the computer will accept your
setting because there's files in itbelieves it can use but it will fail and this can seriously where it'd be a wastetime for yourself it was for me so do not click on this folder here youcan see ok is highlighted if i go and click on a little here will let youaccept that are not xp that kind of either highlights or allows you toselect when you shouldn't when you can or can't but you have to select drivers not thatone ok so click ok so we've got that folder there include folders is selected you kicknext windows con verifying comes with
that just say install this driver anyway and there we go says it's found it andit's got your arduino uno r3 so click close and abracadabra of everything'sworked out okay you'll see it then pick up either underyour ports common lpt or under user-pc i think by default once all the driversare installed it picks it up and here but as i said if you've got a problem normally isn't under here it's sittingunder the pc ok so that means now hopefully thatgiving you the right information to get the driver install because then you'reready to actually use the editing
software ok so we've got the drivers installedyou've got you are drina connected by the usb port hope you has created ashortcut or you've got a link to that arduino software i've got it on my desktop over here sonow you're ready to start playing so if we double-click on this softwarenow this software against olympique de me go through some of the terminology this is called the ide and i think theide stands for interactive development environment and all it basically is is aan editor which allows you to compile
your code or your program or an arduinospeak your sketch so you can write your code upload to themicroprocessor this will then come once you've got your code written this willcompile it into the right code for your arduino microprocessor to understand andprocess and run right so we've got this open what you can do straight off is underhere if you go to file example this comes with built-in sample sketches foryou to start and get you going straight away some relieve you with this so you can test that you get the basicsgame before we get into the first
project which i'll walk you through whatwe talked about a schedule code structure and variablesand all that kind of thing we'll do in the next one but if you go here you've got 0 1 basicsand if you go long go to the really basic one this one that says blink andlet's test the led blink as that i'm not i'm not going to cover these in detailbecause they all over the internet and they're right here and as you can see it brings up in theide the code i'm going to let me just make a littlebit bigger we all start we will discuss
the whole layout all the code if youunderstand all of work with pascal or turbo pascal will see this is has gotthe basic structure of that we define your variables you have functions andyou call variables and all that kind of thing that that's what we will cover offas soon as we start getting into the projects but here you go you've got the code to make an led blinkon your arduino now there are three actually has a built-in led i'm rope we can upload this intestine i'll justshow you that on the board itself so here we've got some instructionswhere you can
very fine upload you can save yoursketches if you go to say bass you click that button that checks the code thatyou've written it's formatted correctly and whetheryou've gotten the issues are not a little highlight them in a window downhere if it's come up okay you can then click this upload buttonyou don't have to do that verify when you want you when you click the uploadbutton it actually checks just checks the code and it'll throw up an errorthere as well now if everything is correct it'llupload correctly you can see here mind says are doing a moon on on on comp i soif we go to two tools and we go to board
the one thing you need to check ifyou've got any errors and it's not seeing your board straight away is to goand select for one that which whatever board you're using over here and then toselect the serial port now as you can see i've got a number of serial portsyou'll have to check in your device manager which serial port you are doingare connected to but once you've got all this set up correctly if he ever didn'tupload then it should once these comes are correctly in placeit should upload the code as it did there and as you saw that upload complete it successfully and i'llshow you now what happens once that
happens ok so you've got your code uploaded fortheir first blinky blink and i've got my arduino plugged in of see the code hasjust been uploaded and if you can see there is the onboard led which is doingthe flash that the code is telling it to do now what you can do even though thesehave an onboard led and on this top row over here there is a pen labeled groundand then this pin 13 and in that in that sketch in that program you'll see it hasa reference to and 13 and if you take a normal led the longer leg is thepositive so that goes to penn 13 that the shorter one goes to ground and ifyou plug that in
then you get your flashing led there now on this board the voltage andresistance to to operate this led on here of the built-in once we start goingto other projects we need to be constant careful about having the right resistorsand what have you to operate things outside of arduino but we'll cover thatoff as we get into the other projects so the one last thing i want to highlightbefore we wrap this first session up that i mr. tell you is there's a littlemicro switch on the arduino itself over there and that's just a reset switch soi mean if you want to i'll see when you pull the power out your code stopsrunning when you like the power back in
whether it's for my usb or the actualpower socket it'll end ran its little boot loadersgot a little boot loader on the microprocessor and it starts running thecode as you can see it's flashing but you can also just push their led asort of a little flash it's been rebooting itself it off seehappens very quickly but that's a little reset button ok so ideally hope that was of help toyou in terms of getting started if you kind of progressed beyond thatpoint then hopefully the next videos in the series will be far more use to youwhen we start getting into the projects
start going through the code andunderstanding why certain things work and why they don't work and i said inthe next one we're going to cover off the digital voltmeter where i've added abit of functionality for min max average we're going to go through and i'm ratewe for their first project it'll actually you can use thisvoltmeter to output to the computer display the turmoil or there's a turtleserial terminal monitor that will show you how to use and then we'll understandthe challenges i had with trying to display out to this cereal enabled aliquid crystal display and that is a whole lot of topics in terms of hardwarelibraries and understanding the
different types of variables that thedifferent types so that all there is a favorite of learning that will happen inthe next exercise in the next video so please i really hope this is i've probably been quite a long videoand perhaps by design because i feel that if you are really into the series it means sitting down listening andunderstanding all the potential hiccups and headaches that you can have but all the potential fun that can comeout of just being persistent and enjoying this platform i think allcertainly yield a lot of fun and
entertainment going forward so if you do enjoy theseries please let me know there's a lot of timeand effort that goes into in particular to making these videos so if there's nota lot of people following them or there's not a lot of value gained out ofthem then it's . is continuing this because his loads about the videos icould be doing so do let me know please read them give them a thumbs up andcertain if you have any queries or comments and certainly person down belowand also on my forum i'll be adding an area there once we start producing thefirst projects what have you wear code
can be posted and as i said there arepeople already are involved in arduino projects on the forum so certainly go and check it out thereso thanks very much for watching and i'll catch you soon with the next video tell yeah
0 komentar:
Posting Komentar