What is Arduino And Arduino Programming.

 - [Instructor] Have you heard about this thing called Arduino lately? Maybe you've seen some projects that use an Arduino? What is this Arduino thing anyway? Sounds like a sub sandwich. Well in this video, I'mgonna use plain language to tell you exactly what an Arduino is. You'll learn why it's so wildly popular, and most importantly bythe end of this lesson you'll know if Arduino isright for your project. So stay tuned. (strange music) So let's start with our first topic, what is Arduino exactly? I think the best way to explain what an Arduino is, is to start with what you can use it for. 

So Arduino is a tool forcontrolling electronics. So think about a pencil. A pencil is a tool tohelp you write stuff. You need to write something down hey, you could grab a pencil. Same idea with Arduino. But Arduino is a tool for controlling electronics. You need to control someelectronic stuff hey, grab an Arduino. But what do I mean by electronic stuff? Well let me define two general groups of electronics stuff. We've got inputs, and those would be electronic devices that gather information. And outputs, those would be electronicdevices that do things. So for inputs, you can kind of think of all the types of sensors out there. Like temperature sensors, light sensors, touch sensors, flexsensors, humidity sensors, infrared sensors, distance sensors, all these types of sensors out there. 

So, you can think of those sensors as input devices, and those types of sensors can be read by an Arduino board. Now outputs would bethings like DC motors, stepper motors, servo motors, solenoids, LCD displays, LEDindicator lights, speakers, and electrical stuff that have some type of action in the world. So Arduino can be used to read inputs and control outputs. So that's kind of what Arduino can do, but how does Arduino work? So when we talk about Arduinos we're really kind oftalking about three things. First, we have the physicalcomponent of Arduino which are Arduino boards. Now there's a bunch of different types of Arduino boards. 

So when someone says Arduino board, it could mean a numberof different boards. A very popular Arduino board is called the Arduino UNO. Now all Arduino boardsshare one thing in common, and that is that they all have a microcontroller on them. And a microcontroller is basically a really small computer. So when you learn to use Arduino, you're learning to use a microcontroller. And the microcontrolleris what enables you to read those different inputs, and control those different outputs. So when someone says Arduino board, they're talking about something physical, it looks like this, it'sa printed circuit board, and it's got someelectrical components on it. 

But the Arduino is morethan just hardware, it's also software. And there's this thingcalled the Arduino IDE. And IDE stands for integrated development environment. And this is a software application that you download onto your computer, and then you use it to program the Arduino boards. Now it's a completely free software, and it's pretty easy to use. It looks a lot like a text editor. 

The Arduino IDE is whereyou write your code that actually gets loaded onto the Arduino board itself. So the third part of this Arduino trifecta is the Arduino code. So the code that you write inside the Arduino IDE, is what ultimately gets loaded onto the microcontroller that's on these Arduino boards. And the Arduino code that you write is called a sketch. Now the Arduino code itself is basically C and C plus plus programming language, but with some Arduino-specific functions and structure. So if you program an Arduino, you're basically gonna be programming in C, C plus plus programming languages. So what is Arduino? It's three things. 

There's the physical hardware that uses a microcontroller, there's the Arduinodevelopment environment called the Arduino IDE, and then there's the Arduino code itself and that's called a sketch, and it gets loaded onto the Arduino board. So those are the three components that basically make up what quote unquote Arduino is, and kind of roughly what it does. Okay you know sounds neat, but why is Arduino so popular? Well here's the deal. Recall that I said the key component of an Arduino board isthe microcontroller. Now traditionally, microcontrollers are pretty complicated to use. 

The user manual for one is easily over 300 pages long, and it's filled withtons of technical jargon. But what the creators of Arduino did, was make using microcontrollers as easy as possible. So instead of just electrical engineers and computer scientistsusing microcontrollers, now pretty much anybody can get their hands dirty on them, and start building stuff. So how did they make microcontrollers easy to use? Well hey, let's go backto that Arduino trifecta. First, the Arduino board itself is designed for ease of use. You can connect it to your computer with a simple USB cable, not like some specialized cable that it would normally take to connect a microcontroller. Connecting electrical components to the microcontroller is also very easy with an Arduino board. Because they have these plastic holes around the perimeter of the board. They're called headers, and to connect an electrical component to the microcontroller, you just stick thecomponent inside the holes it's literally that easy. And our Arduino also has a built-in external power jack, so when it's not hooked up to the computer it can still be powered by a battery pack. 

So that's like the easeof the hardware side, but the Arduino IDE is also designed for ease of use. There's a lot of integrated development environments out there, but the Arduino IDE is built with simplicity in mind. There's no like bells and whistles that kind of get in your way, it's really just a basic window where you type code. And to upload the code that you've written in the Arduino IDE, you simply press a button and it uploads. Finally, the Arduino code itself has functions specifically for things like reading inputs andcontrolling outputs. 

If you were to directly program a microcontroller, you'd find yourself constantly referencing the user manual for highlyspecific information on controlling different things. The Arduino language hassignificantly reduced that complexity by creating simple programming functions for you to use. In addition there's manyArduino code libraries that you can install and use, and these libraries simplify the use of all different types of components from interacting with different sensors, to controlling tons of different outputs. So the Arduino hardware is easier, the Arduino IDE is simpler, and the code itself ismuch easier to comprehend. And that's a big part of why Arduino is so popular. The other reason Arduino is so popular, is because there are many people using it which means there's alot of examples out there to work with. 

Also, the Arduino board itself is open source hardware. That means while there is a company named Arduino that makes Arduino boards and supports the Arduino IDE, there are also lots of other companies that make Arduino compatible boards that can also be programmedin the Arduino IDE. So there's this huge hardware and code ecosystem for you to work with. Finally, Arduino hardware is generally pretty inexpensive, and that helps keep it popular as well. So how do you know if the Arduino is right for your project? Well I have a coupledifferent rules of thumb, here's the first one. Most Arduino projectsgo something like this. 

You have an input, and you have an output, and you have some logicin between the two. So for example, maybe you have a temperature sensor and if the reading ofthe temperature sensor is above a certain threshold, you wanna turn on some cooling fan and that would be your output. So you have some input, you apply some logic to that input, and then you have an output. Now it doesn't have tobe so narrow of an input. You know we could have something like if the temperature is in this range, and the time is this andthe sun isn't shining, then you know maybe youwanna turn on a light switch on the radio, and move that lever back to its original position. So if you're project kind of follows this basic idea that youhave inputs and outputs and you need to control them then yes, Arduino is probably gonna be a good fit. Now here's the deal, we mentioned that Arduinouses a microcontroller and a microcontroller islike a small computer.

 So if your project involves using huge input streams like video recording or big computations, then Arduino is probably not the right match for it. Could you potentially use an Arduino for these type of applications? Well maybe, but there's better suited technologies for things like that. Well I really hope yourwheels are turning, and you're excited about what you can do with Arduino. And if you are you're definitely gonna wanna watch this next video where I highlight fiveawesome Arduino projects. This will give you a great idea of what Arduino is capable of. 

If you wanna watch the next video, just click this littlevideo link right here. Now if you enjoyed this video, please subscribe to our channel by clicking the big redsubscribe button below. Hey, we'd love a thumbs up too. But hey, now I just wannaturn it over to you. Please let me know what you wanna build with Arduino in the comments below, I'd love to hear whatyou're thinking about. Well hey take it easy, and I'll see you in the next video. Bye.