Arduino Basics 101: Hardware Overview, Fundamental Code Commands

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
If you're on electronics copyist nowadays, then you probably had seen one of those three boards Those are so-called Arduino boards which are basically development boards pulled around the Microcontroller [in] This case the atmeGa 32 [8p] And since 21 of my 46 credit projects on this channel are in one way or another Arduino based it is about time [to] talk specifically about [what] the Arduino can do What it cannot do and how easy it is to use? Let's get started first off let's have a look at the most popular Arduino boards fittingly named [own] we know you know we Pinned [up] the you smart controller. I extended to the female headers at the Edge of the board on the right side We have the digital pin 0 to 14 and on the left side the analog pins as well as some power pins The function of the digital pins is easy to explain they can either be pulled down to ground so a binary 0 Low or pulls up to the supply voltage so by an 11 Hi This way by connecting the led with current limiting resistor to ground and the digital pin We can pull the output id to source current from the supply voltage or by connecting the [led] to the supply voltage We can pull the pin low and off synC current But not only that by declaring a digital pin as an input Which I will show you how to do later the Arduino can also determine whether the pin senses the ground voltage or the supply voltage Additionally some of the digital pins [are] [labeled] with [a] weekly line which means we can create a Pwm signal with them That means instead of just turning on or off an led here. We can adjust its brightness Because the Pwm signal provides a supply voltage [with] an adjustable on time obviously the shorter the on time this our curvy, [we'll] get Now let's move on to the [our] pins which as we can see our labels as input pins that means by connecting a voltage to such a pin that lies between the supply voltage of the Arduino and Decock Potential we [can] [not] only [research] whether the voltage is high or low as with the digital pins But we can precisely see what the voltage value is In conclusion the digital outputs the digital inputs Pwm outputs Which is commonly referred [to] as the analog outputs and the analog inputs are the main functions of the Arduino board [to] power rates I've been using an uSB connection But you can also use the DC Jack or [the] in pin, Whoopin input voltage of 6 to 12 volts or directly the fight will pin moving input voltage of Obviously [Pie-holes] Personally I like to use the Arduino uno when I want to do a quick test with a new sensor or something similar But if I want to build a more complicated circuit on a breadboard [I] usually go for the breadboard compatible Arduino Nano it Features all the mandatory components and can be powered through usB Directly through 5 volts or once again above an input voltage of 6 to 12 volts at the B and pin But even though [they're] [a] [bit] cheaper in comparison to a complete of minoru no I try to not embed them in a finalized project For that I use the even smaller Arduino Pro Mini Which you can get for just $2 This time Usb power is not possible But you can either directly power the [board] through the VCC pin or once again whoops 6 to 12 volts through the rope in Another component that is missing from the Pro Mini is the usB to serial converter Which was used by the other two boards to program the microcontroller? That means we need an additional ftDI breakout [board] that we have to push on to the corresponding pins of the Arduino Pro Mini to program it and Speaking of programming let's download and install the latest [Arduino] I [yes] and connect the Arduino Nano to the computer after [starting] the software we see the two main sections of the sketch Setup and loop which tell you by themselves what they do in the setup section we can use the pin mode function to set the digital pin 7 as an output and In the loop section we can then use the digital write function to set the output I then write 500 milliseconds Aka half a second with the delay function and then set the pin low again and wait for another half a seconds By choosing the correct communication port and uploading the sketch. We are Eccentrics idea of the Arduino Nano opening shortly and Afterwards the Led does what we program it to do but be careful not to overload the outputs because the datasheet of the AtmeGA328 [Pu] States in Maximum current draw of only 40 milliamps Next we can initialize the serial monitor wooper baud rate Which is pretty useful when you want to check on a variable while the code run? This way after changing the digital pin to an input we [can] output the value of the digital read function [to] the serial monitor Now while the digital pin floats in the air the readings from its code bit crazy that is why we usually use a 10 kilo ohm resistor to either pull the inputs to the supply voltage or ground and Task by hooking up a switch and connecting the other side of [it] to the opposite potential of the resistor we have two stable spades which we can use in the codes to Trigger any vents and Best of all the resistor is not mandatory because we can use the integrated pull-up resistors of the microcontroller Which are around 20 kilo Ohms each? Next I define the digital pin 3 as an output and use the analog write function to create a Pwm signal in This case the value 200 would equal an on time of 78% since will this 8-bit value with 255 equals 100% and zero equals zero percent To adjust the speed up um signal to entry though We could connect the middle pin of a potentiometer to an analog inputs and the other two pins to VCC and ground This way we created a voltage divider Which we can sample by defining the error pin as an input and using the analog read function now the [seizure] monitor gives us values between [1020] [3] and [0] which is [a] [tempered] value both 1023 being the supply voltage and 0 being the ground potential by simply dividing this value by 4 we can feed it directly into the analog write function and Thus finally control the led brightness to opponent [xiamen] and with that being [said] you are now familiar with the five Fundamental commands of the Arduino codes of course there's plenty more to talk about like variable types control structures comparison operators Interrupts and much more so if you like this video series so far and wanted to continue Then give this video a like so that [Arduino] 102 will follow soon Until then don't forget to subscribe, so you won't miss the next videos Stay creative and I will see you next time
Info
Channel: GreatScott!
Views: 921,519
Rating: 4.9540915 out of 5
Keywords: arduino, basic, 101, introduction, tutorial, how to, diy, make, project, uno, nano, pro mini, arduino uno, arduino nano, arduino pro mini, hardware, overview, function, functions, code, commands, command, digital pin, analog pin, PWM, ADC, greatscott!, electronics, fundamental, basics, beginner, beginners, guide
Id: BtLwoNJ6klE
Channel Id: undefined
Length: 8min 1sec (481 seconds)
Published: Sun Feb 19 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.