Introduction to Arduino: Creating Interactive Projects | Mark Frauenfelder | Skillshare
Search

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Introduction to Arduino: Creating Interactive Projects

teacher avatar Mark Frauenfelder, Author | Maker | Founder, MAKE & Boing Boing

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

    • 1.

      Trailer

      1:01

    • 2.

      What Is the Arduino?

      3:38

    • 3.

      What Do You Need?

      8:52

    • 4.

      Installing and Connecting Your Arduino

      3:04

    • 5.

      Blink Rates

      3:54

    • 6.

      Blink Rates with Components

      4:47

    • 7.

      Knobs and Potentiometers

      5:20

    • 8.

      Servos

      7:36

    • 9.

      Speaker Tones

      6:32

    • 10.

      What's Next?

      6:09

    • 11.

      More Creative Classes on Skillshare

      0:33

  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

9,230

Students

11

Projects

About This Class

When designer Massimo Banzi created the Arduino in 2005, he had no idea that his tiny, open-source microcontroller would spark a revolution.

Today, thousands of non-engineers have created amazing projects, interactive experiments, and clever fixes using this simple piece of hardware.

In this Skillshare class, Mark Frauenfelder, founder of Boing Boing and MAKE magazine, shows you how to get started with a few simple Arduino projects, giving you the confidence and skill to begin experimenting with projects on your own!

No knowledge of programming, engineering, or electronics is necessary, and everyone is welcome. The class focuses on hardware to get you using the board right away.

The best way to learn is by doing, and the best way to dream is to dream big. Use this class to kick off your Arduino skills. Join the DIY revolution.

What You'll Do

In one hour, Mark guides you through the Arduino hardware components, software installation, and five beginner-level experiments.

  • Introduction. Get acquainted with the Arduino, research fascinating projects, and gather materials for getting started.
  • Installation. Follow a clear, step-by-step demonstration to install, connect, and configure your Arduino.
  • Experiments I. Try out three simple projects that let you explore how different inputs affect blinking-light outputs.
  • Experiments II. Experiment with motion and sound outputs using a servo motor and tiny simple speaker.
  • Creative Projects. Research ways to develop more projects that make your day a little easier, interesting, or fun.

What You'll Make

  • Deliverable. Set up 5 simple Arduino experiments using light, motion, and sound outputs, and share your success in the discussion and community forums.
  • Brief. Learn by doing, following Mark's step-by-step instructions and jumping directly into working with Arduino hardware and electrical components. Make minor modifications to programming, lights, and more to study the effects of inputs on outputs, and build a skills foundation for creating exciting future projects using Arduino.
  • Specs. Share your experiments in the way that makes the most sense for others to learn and share feedback. Consider drawings, diagrams, descriptions, photographs, videos, or code.

Interested in More?

For a broad overview of making, also check out Mark's complementary class, Introduction to DIY: Becoming a Maker.

Meet Your Teacher

Teacher Profile Image

Mark Frauenfelder

Author | Maker | Founder, MAKE & Boing Boing

Teacher

Mark Frauenfelder is the founding editor-in-chief of MAKE magazine, the founder of Boing Boing, and the editor-in-chief of Cool-Tools.org. He was an editor at Wired from 1993-1998, the founding editor of Wired.com, and is the author of seven books. His latest book is Maker Dad: Lunch Box Guitars, Anti-Gravity Jars and 22 Other Incredibly Cool Father-Daughter DIY Projects.

As a maker of things, Mark has built cigar box guitars, skateboards, electronic musical instruments, chicken coops, kinetic sculptures, and robotic monkeys that keep cats from jumping on furniture. He has conducted workshops that teach people how to make sauerkraut, program Arduino microcontrollers, solder circuit boards, build vibrating toothbrush cars, and construct mandolins from tuna cans.

Mark is als... See full profile

Related Skills

Design UI/UX Design

Class Ratings

Expectations Met?
    Exceeded!
  • 0%
  • Yes
  • 0%
  • Somewhat
  • 0%
  • Not really
  • 0%

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. Trailer: Hi. My name is Mark Frauenfelder, and I'm the Founding Editor in Chief of Make Magazine. My class is an Introduction to Arduino, the amazing credit-card-sized electronic prototyping platform that lets you add interactivity to your projects. The Getting Started in Arduino class is really important because it helps students understand the basics of Arduino, how to use the hardware and software to start making their own interactive projects. Students will learn how to control various output devices like LEDs, speakers, and servomotors using input devices like potentiometers, and photoresistors. Understanding how an Arduino works is really great because you can really take your projects to the next level. 2. What Is the Arduino?: Hi, I'm Mark Frauenfelder. I'm the founding editor-in-chief of MAKE magazine, a technology project magazine. Today, I'm going to teach you about the Arduino. The Arduino is a $25 electronic prototyping platform that was designed for artists and designers to add interactivity to their projects. The cool thing about the Arduino is that you don't need a degree in electrical engineering. You don't need to know how to design electronic circuits to be able to do really interesting things with it. I have an Arduino right here. There are several different models of them. Today, we're going to be using the Arduino Uno, which is the Arduino that I recommend newcomers start out with. It's a great, all-purpose Arduino device. So, you can see there's quite a few components on here, and there are these rows of headers. There are little holes in here, and they're called pins, even though they're actually holes. So, what an Arduino does is it accepts inputs from different kinds of sensors that go into the pins here. So, what kind of inputs are possible? You could have light sensors, sound sensors, pressure, humidity, temperature, vibration, all sorts of different kinds of inputs. It senses any kind of little device that can sense a change in the world around it. So, you just simply plug these sensors into the input pins, and then the Arduino will process these signals. It will measure the input from these different signals. By using simple computer code that you type on your computer and then upload to the Arduino, it will process those signals and then send them to output pins so that you can control what's called effectors, things that have an effect on the world around you. So, an example of an effector would be a buzzer. So, you might be able to measure a temperature. When the temperature reaches a certain level, the buzzer goes off. What other kinds of effectors are there? An LED light bulb would be an effector. A motor could be an effector. A servo could be an effector. An actuator could be an effector. Anything that makes a change or sends an output signal is called an effector. So, you can imagine all sorts of cool things that can happen with sensors and Arduino and effectors. A friend of mine, named Steve Hoefer, made something called the Secret Knock Gumball Machine, and it's Arduino based. What it is, is it's got a little plate on it and when you knock on the plate, the Arduino senses that. If you are knocking with the right pattern, it will dispense Gumball. So, that's just one example of tons of different things that you can do with Arduino. If you type in Arduino projects on Google, you can find tons of them. So, today, what we're going to do is understand what's possible with the Arduino, how to do some simple projects that show you the power of Arduino, how easy it is to get started. Then, after that, I will give you some tips for taking Arduino to the next level and really doing some cool things with it. So, let's take a look at some of the things that you need to have, in addition to an Arduino and a computer, to do these projects. 3. What Do You Need?: Okay. So, I have lined up in front of me all the things that you need to take this class. It's really not very many items, and they're quite inexpensive actually. The Arduino itself, like I said, is about $25. You can buy them online. Search on Google and you can probably find a good price. Again, I recommend the Arduino Uno, U-N-O as a great starter Arduino. The other thing that you need is a USB cable to supply power to the Arduino, and to connect to your laptop. It does both things at the same time. You want this kind of Arduino Jack. It's the kind that is typically used for inkjet printers and things like that. It actually just plugs right into the Arduino to supply power that way, and send data back and forth to your computer that you're using to program the Arduino. The Arduino can also accept an AC adapter here to supply power, so that once you're done programming and you're using it in a project, you can just power it that way or through either AC or a battery. The other thing that you need for this project is a wireless bread, or I'm sorry, a solderless breadboard. It's called the solderless breadboard and it allows you to insert components into it, and connect them together without having to use solder. Now, I have an example of a typical electric circuit that's been wired up. There's a capacitor that fell out. This is a typical electronic circuit that I'm using a solderless breadboard to connect the components. I actually removed the adhesive backing on the back of the breadboard so you can see how these holes are connected. You see these little metal rails here? Well, those are all connected so that everything that is in this row of holes and this row of holes will be electrically connected, as if you just took the wires of the components and stuck them together, soldered them together. Then, you'll also see these longer strips here that go in the opposite direction, perpendicular to the shorter rows. Now, those are the power rails. We have blue for negative and red for positive voltage, and that way you can attach a power source to those rails. Just attach components that need to be powered to either the negative or positive power. So, as solderless breadboard comes in very handy, they're easy to use, and they offer a temporary solution rather than soldering components together. So, let's take a look at the components we need. We need three different resistors. One of them is a 4.7 kilo ohm resistor, that's 4,700 ohms, and another one is 220 ohms, and then the other one is 100 ohms. How do I know what kind of value these resistors are? There are little colored bands that are painted on these resistors, all resistors have colored bands on them. Different colors represent different numbers. For example, black is zero, brown is one, and red is two. So, by checking these colors on a resistor color code chart, you can find those online very easily, you can tell the value of the resistors. You can usually buy an assortment of resistors, like 800 or a thousand different resistors in a wide variety for 10 or $15 on Amazon or eBay. I recommend that if you're going to continue with electronics and Arduino, go ahead and invest in one of those packs because it will come in very handy. This is a photoresistor, and it's a special kind of resistor. The other resistors I showed you had a fixed value, for this has a variable value. The value of the resistance varies by how much light, the intensity of the light is hitting the surface of this component here, so that if you're covering it up, we will have a different kind of resistance value and if a strong light is shining on it. So, you can do all sorts of fun things with this, and we'll look at that later on when we're doing some projects with it. A potentiometer is also a variable resistor. You can change the resistance of this component by turning the knob here. These are commonly used in volume knobs on radios, and so you can use that to change the resistance and change the amount of electricity going through a circuit. I should say that what a resistors function is, is to reduce the amount of current flowing through a circuit. It's like kinking a garden hose. Think of electricity like water flowing through a garden hose. You can adjust that and change the kink in that hose by turning the knob on a resistor, or using a photoresistor to do the same thing. So, here is an output device. You've probably seen these before. It's called an LED, or a light emitting diode. When you apply a current to it, it illuminates. These are used as indicator lights for all sorts of electronics. If you'll notice, one of the legs here, our leads is a little bit longer than the other. So, the longer one is positive and the shorter one is negative. You need to be careful about how you insert this into the solderless breadboard because if you put it in the wrong way, it won't work. It has to be in the right direction. This is known as a component that has polarity. As opposed to a resistor it doesn't have any polarity. It doesn't matter if you put it in that way or that way, it's going to work. Here's another output device. This is just a simple speaker and it is an eight ohm 0.1 watt speaker, and you can buy these online. RadioShack sells them. You should pay maybe a couple of bucks for one of these things. Is just a small speakers, not very loud but we're using it to see how we can make different kinds of sounds with an Arduino. Here's another output device, and this is called a servomotor. It's a special kind of motor, you can control the rotation of the rotor of the motor by sending electronic pulses to the motor to tell it exactly where to go. So, it's not the kind of motor that spins around and around. You can put it in this position, this position, this position, this position, just by having the Arduino tell it what angle you want the rotor to go. Oh, also, I should say that most servos come with a jack like this. So, to use it with the solderless breadboard, you need some header pins, like this, that just snap in. Again, header pins are easily available online, and they conveniently fit the hole spacing on a solderless breadboard. Okay. I just have one more set of components to talk about. These are just jumper wires, and these are used to connect the components together, attach components to the Arduino, and they just plug right into the breadboard. If you want, you can just use a spool of wire if it's solid core wire, not threaded kind of wire. You can just snip the ends off of the insulation and use those spec. I find these to be pretty convenient. Again, they're really inexpensive, re-usable, and are easy to find. So, those are really all you need, aside from a laptop. What we're going to do next is show you how to install the Arduino software so you can start doing projects. 4. Installing and Connecting Your Arduino: Okay. So, we want to download the software so that we can control the Arduino and program it. And so the place to go is Arduino's official website, and that's arduino.cc, and go to the download link in the menu here, and just click on it and we're going to finally find the Arduino software that works with our computer. And so it's called the Arduino IDE, and that's the development environment program. You can see that there's an installer for Windows a Macintosh and Linux. So, I'm using a Mac. So, I'll click on Mac here. It's downloading. It's a 76 megabyte file. If you're not using a Uno if you're not using an Uno Arduino, you may need to download a different version. So for example, here, if you're using a Yun or Due a board, you'll have to use a different version but the the Uno and all other versions, you just download the regular version of Arduino. That's a little bit confusing because the software is called Arduino, and the hardware is also called Arduino. What you should actually do then is install the software. It actually doesn't have an installer, you just get the application itself, and it opens up a blank window. That is because it doesn't have any program in it yet, you haven't loaded up a program. So, what you want to do now is configure your Arduino to the software, and that means you plug your USB power supply in to your computer, and then in the Tool section, you go down to Board and you select the kind of Board you want, and so you can see these these are all the different kinds of Arduinos that are available. We're using an Uno. So that's the top option, and it's it's checked already, so we're okay. The other thing we need to do is select a Serial port, and so the serial port that we need to use is going to be called /dev/tty.usbmodem, and then there will be a number after that. It might be different but what you want is the tty.usbmodem. So, click that one and then your Arduino should be connected. So, that's it for setting up the Arduino. After this, what we're going to do is do our first program with the Arduino. 5. Blink Rates: So, one of the cool things about Arduino is that they are really good about holding your hand and teaching you how to use the Arduino. So, after you've installed the Arduino software, they have a number of programs that are pre-installed so that you can play around with them. An Arduino program it's called a sketch and you can get them here in the file menu, in the examples option. So, what we're going to do, is do the very basic first program called Blink. Just click on it, you'll see that you have a sketch loaded up already. I'm going to close this other default window that opens when you start Arduino. So, right now don't worry about what this information says. This class is not going to teach you how to program an Arduino, it will show you how to modify some of the code in it but this is something that is beyond the scope of this class. We'll use different sketches, modify them slightly but to program them, I'll tell you about some other resources after this. So, like I said this Blink program is available already in the Arduino, we've loaded it up, and now it's on the computer but it's not on the Arduino yet. We need to install it onto the Arduino or actually upload it. So, this little arrow key that's pointing to the right, is the upload button and you can see when I highlight over it, it says ''upload.'' So, we're going to click this and then below, we're seeing that it's compiling the sketch and then it's uploading the sketch, and when that happens, what you'll see is that the LED here is blinking off and on, it's on for a second, and it's off for a second, and that means it' has successfully uploaded the program. So, the Blink program is a good way to make sure that you have the right connection to your Arduino, that you selected the right board and so it does work. Now, there's one thing that would be fun to do. Let's try modifying this program a little to see if we can change that Blink. So, if you look here in the software, you see something that says delay 1,000 and another delay 1,000 and there's some helpful commenting that's in the code here. So, this says, "Turn the LED on, wait for a second. Turn the LED off, wait for a second.'' So, 1,000, what that's doing is when you have 1,000 as a number in Arduino, that's 1,000 milliseconds or one second. So, the number represents how many milliseconds? So, what if we changed this so that it blinks on and off every tenth of a second? To do that, we just changed the code so we delay it by 100 in each instance. So, that's one tenth of a second. So, we've changed the program, now let's re-upload it, and see what happens after it uploads. It takes a while you can see that the TX and RX LED go on and off indicating the data is being transmitted and already the program's been uploaded and you see that button is blinking, much more quickly. So, it's blinking ten times a second off and on. So, that is how you modify a program, that's how you upload a program and we've done our first experiment. The next thing we're going to do is we're actually going to use the solderless breadboard and an LED to do the same thing. So, that will be the next video. 6. Blink Rates with Components: Okay. So, we left off having the Arduino blink, the LED 10 times a second, and it's still doing that. That's a good place, that's where we want to be. What we're going to do now is actually use some of the output pins on the Arduino, and we're going to use the solderless breadboard, and we're going to use some of the components, to show you how you can actually have an off board effector work with an Arduino. So, I have the LED here. We need the LED. We also need the 220 ohm resistor, which is colored red, red, brown 2 2 0. So that's 220 ohms. The reason we need a resistor is because the output voltage of the Arduino is enough that it would eventually burn out the LED. So we're adding this resistor to restrict the flow of electricity through the LED so that there's not too much electricity going through it. We don't want it to burn out. The first thing we want to do is we want to connect a ground wire between the Arduino and the Breadboard. You can see that one of the pins, well, there's actually a few different pins that say ground and you can use any one, but you'll see that one of the pins has a G and D on it. The writing is quite small so I'm putting glasses on to help me identify which pin it is, which you'll see, one this is G and D. You plug that in your jumper wire into the ground pin, and then you plug the other into the jumper wire into the blue rail. So, what that means is now this entire blue rail on this side is ground, electrically ground. Anything you plug along that rail will be electrically grounded. So that's a great way of, now what you've done is effectively you've taken one pin and turned it into 30 pins that are all the same. Okay, so now what we want to do is we want to add the resistor to the solderless breadboard. So the blinking LED there is actually connected to pin number 13 on the Arduino. You can see that there are pins numbered 0 through 13. These are digital pins. These are digital input and output pins that allow you to talk to the Arduino and the Arduino to talk to you. So, what we're going to do is we're going to add this resistor to pin number 13, digital pin number 13, and then the other end we're going to put into J18 on the solderless breadboard. Okay, so we've got that done. We need to put the LED on still and what we do with that is we put the short lead, remember I said that there's a short lead and a long lead on an LED? The short always goes to negative and the long one always goes onto the positive. So we can put the short lead anywhere along the negative rail. Get a little closer to the resistor. This is a good time to point out that you never want to accidentally have leads touch each other on the solderless breadboard because then you'll just be shorting out the circuits. So make sure that you have clearance. If at the other end of this the positive lead is going to go in the same row that the resistor went into, and I put it into H18. So now you see that we've got this blinking, this LED is blinking at the same rate that the little LED down there is blinking, because they're both part of pin number 13. Now, we can mess around with the time again and change this time on the sketch that we have. Right now it's blinking on and off 10 times a second. We can go in there, we could change that to 50, we could change it to one, we could change it to a thousand. It wouldn't be needed if there was a better way to be able to change the rate of the blink of that LED than by just changing the program. Well it turns out there is, and the answer lies in using this potentiometer to control the blink rate, and that is what we're going to do in the next video. 7. Knobs and Potentiometers: In this experiment, we're going to control the blink rate of the LED using the potentiometer. Like I said, the potentiometer is a resistor that is variable. By using this as an input device and having the Arduino measure how much resistance is going through the circuit, you can tell the Arduino to cause the LED to blink at a different rate. Now, luckily the kind of potentiometer that I'm using has three pins that are perfectly spaced to fit into a solderless breadboard. That's really the kind you should find for this experiment. If you have a potentiometer that doesn't have this, then you're going to need to solder wires onto the leave of the potentiometer and actually plug them in to the spots that I'm telling you to plug them into. There are plenty of great soldering tutorials online. The one that I recommend is Mitch Altman's guide to soldering. If you type in Mitch Altman soldering, you can find his great comic book guide to soldering. But I highly recommend that you get a potentiometer that has three pins that are already spaced to fit into a solderless breadboard. We're using the setup from the previous video where we have the 220 ohm resistor, the jumper wire, and the LED already plugged into the Arduino, and of the solderless breadboard, and then we're going to add the potentiometer. So, where we're going to put it is in pins one, three, and five in row or in column J, and it will just fit in just like that. Then, what we want to do is now attach some jumper wires. So, what we want to do first is attach a jumper wire from row five and it can be really anywhere in row five over to the ground rail and that's the blue ground rail. That's going to give a ground connection to the potentiometer. So then we want another one from the first row to the plus five volt pin, power pin on the Arduino. So I'm putting a red wire over to a pin that's labeled as five volts. There's one right next to called 3.3 volts, we want it in five volts. So now, what we've got is we've got a power going through the potentiometer from five volts connected to ground. Then we have one more jumper wire to put in and this one we want to put into row number three and then we want to connect that over to analog pin zero and that is a zero. So, now we have everything connected, what we need to do now is load up the sketch on the Arduino that lets us use the potentiometer to control the blink rate. So what we do is, in the Arduino application go to File, Examples, Analog and then select AnalogInput. Okay, I'm going to close our blink sketch that's behind it. Don't save it. We have our AnalogInput sketch and you can see that it's a slightly longer sketch. Don't worry about what it says, we're just interested in the hardware right now. Again, upload, so press the Upload and then we can see that it's uploading, we're waiting for it to upload, and it's done and ready to go. Okay, so we're not seeing much of a change here. Let's turn this knob and see if we can get things to happen. It might take a while to find the spot depending on the value of your resistor, but you can see as I turn it, I'm increasing the blink rate, faster and faster, and at a certain point it looks like it stopped blinking completely because it's just on. But you can see,you can really change the blink rate. You can make it go very slowly to much more quickly. So, one thing that I would recommend to do as a next step here is to take a look at this analog input sketch and you can see that there's a pretty good description about what's going on, and this is a good way to start practicing and learning what a sketch is about and seeing just don't be afraid to play around with the numbers and change things around and see how it affects your circuit. That's what this is all about, that's what these exercises are about, is to change things around and see how it affects your circuit. So the next exercise that we're going to do is learning how to control a servo motor with a potentiometer. That will be in the next video. 8. Servos: A servo is a special kind of motor that's used in a lot of machines. The cool thing about a servo motor is that, you can tell it to rotate to a certain angle and then just lock in there. It's used by hobbyists who fly remote control airplanes to raise and lower elevator flaps on airplanes, and it's also used by robotics hobbyists to control their robots. So, we're going to control this servo motor using a potentiometer, and that will be the next exercise. So, let's start this one with a completely clean solderless breadboard, take all the wires out of everything, so we're just going to start over from scratch. First of all, we will go ahead and plug the potentiometer in and let's put it into row j, one, two, and five. We will go ahead and attach a blue jumper wire, doesn't really matter what color but I like to jut kind of match them with the function. So, we will put that in row one, the jumper wire row one and attach the other end to ground. Then we'll take another jumper wire, I'll use red this time, and we'll put this in row number five. We'll go ahead and attach it to the red rail here, then what we can do is, we will just power up this entire rail by putting another jumper along the red rail, and going over to five volts on the Arduino, and getting another jumper cable plugging it into the blue rail on the breadboard, and then plugging this one into one of the ground pins. So, now this whole rail is supplying power. So, whenever we plug components, we can just plug it into the rail. That will be a nice way to do it. Okay. So, now we have one more pin here on the potentiometer that hasn't been connected that's pin number three. So, let's insert a jumper somewhere in row three and then we will go over to analog input pin zero, that's A0. So, what this is doing is, it's measuring an analog signal from the potentiometer, that's its input. Okay. So, now we have the servo motor and it also has three pins. You can see that they are colored black, red, and yellow. The black one is for ground, the red one is for the positive voltage, and then the yellow one sends the pulse width signal, it actually receives a pulse width signal that causes it to rotate to a certain angle. Depending on how you modulate or change that pulse-width, you can control the angle of the servo, that's called pulse-width modulation. So, let's go ahead and plug this into our solderless breadboard, and we will put it into row H, into 10, 11, and 12, so that black is in 10, red's in 11, and the yellow one is in 12. Okay, so as you might guess, what we want to do is connect the black to ground and the red to positive voltage. So, I need to get a couple of jumper wires to do that. I have a large bag of jumper cables here. We'll take a red one and we insert it somewhere in row 10, then we can just put it anywhere along the red rail because we're going to get power to it, that way, because we've electrified those two rows. Then let's do a, wait, I headed in the wrong one. I'm sorry, it's a row of 11, is plus five volts. That's why it's kind of good to have the colors matching, because colors matching between your component wires and your jumper wires, because it can help prevent making mistakes in wiring. So, then I'm going to use a black jumper wire, and I'll put that in row 10, and then I'm going to put it into the blue rail here. So, now we have this activated, we have the only one that's not connected so far as the yellow wire, the signal wire. So, let me get a yellow jumper wire. The yellow jumper wire insert it somewhere in a long row number 12, and then I'm going to put it into digital pin number nine. If you look closely at this board, you'll see a little tilde symbol in front of the nine, and there's a code on the code as printed. The tilde means PWM, that stands for Pulse Width Modulation. This pin is capable of sending out little bursts or pulses of electricity, which is exactly what we want to control the servo. So, now we have everything wired up, all we need to do is load up the example program on the computer and upload it to the circuit, and then we can control the servo. So, let's do that now. What I want to do is, go to examples and then go down to servo, down to the bottom and pick knob. So, I select knob, and then just click the upload button, wait for it to compile the sketch and upload it. Okay. So, now what happens is, if I turn this servo now up here, you can see that the arm on the servo changes when I turn the potentiometer knob. So, you have kind of a direct control. You can even see here how you can control that, and you could think there's all sorts of fun things you can do with this kind of a project already, you could have a attach a hand to it, so, you could wave to someone from a distance if you had a wire long enough. So, this is kind of a form of remote control, with the servo. It's really fun to do, and that's it. So, we've explored a few different output things. There's one other that we haven't tried yet and that's sound. So, that will be the next experiment, is doing a way to manipulate sound by changing the intensity of light. That will be in the next video. 9. Speaker Tones: All right. In this experiment, we are going to control the pitch of a sound generated by the Arduino by using a photo resistor. Photo resistor is kind of like a potentiometer because you can vary the resistance of it. Unlike a potentiometer where you turn a knob a vary resistance, you vary the resistance by changing the amount of light that hits the surface of the photo resistor. Okay. So, to get started with this project, we are going to use our speaker, the photo resistor, and some various jumper wires and some of our fixed resistors also. We're going to start the project by removing all of the components from the solder less breadboard in the Arduino. So, we're starting over from scratch. Then we want to get the 100 ohm resistor, and that's the one that is colored brown, black, and brown, and we're going to put that into digital pin number nine, and we will stick that into row 14. I'll put it in to J14, like so. Okay. Then we will connect our speaker, and we'll put the black wire into the blue line ground rail, and will put the red wire into I14. So, you can see we have this resistor here. This resistor is limiting the electricity that's going through the speaker because we don't want to burn the speaker out. Okay. So, the next thing we want to do is connect the photo resistor. One meter is going to go into J20. So, let's find J20, and the other one is going to go into our positive voltage rail which is the red colored rail. It doesn't matter, unlike an LED where you have to be concerned about the direction that you put it into the solder less breadboard, because there's polarity in it, a photo resistor doesn't have any polarity, so that it doesn't matter which lead goes into which hole. Just put one lead into the red rail and one into J20. Okay. Now, we're going to connect this photo resistor to the Arduino. So, we'll take a jumper cable and we'll put one end of the jumper wire into row 20, and the other one we're going to put into analog pin zero, that's marked A0. By plugging it in there, you're letting the Arduino measure the current going through the resistor, and the current is going to change depending on how much resistance is in the circuit, and the amount of resistance going through it is dependent on how much light is hitting it. Then we're going to put in the 4.7 kiloohm resistor and that's the one that's colored yellow, purple, and red. So, we're going to put that on between H20. We just want it somewhere in row 20, and the blue lined ground rail. Okay. Then we're going to connect the jumper wire between the blue line ground rail and ground on the Adruino, so that we are going to activate that entire blue line rail there and we can plug it into those. There's a few different ground pins, the Adruino. You can already hear that it's making some sound, but we're not done with it yet. What I'm going to do just to keep things quiet I'm going to unplug the ground wire on the speaker. We'll get back to that in a minute. Okay. So, then we want to connect to another jumper between the red lined ground rail on the solder less breadboard and five volt pin on the Arduino, so that we can supply power to the entire five volt rail. Okay. So, now that we've wired up the circuit, let's load up the tone pitch follower's sketch from the Arduino development environment. So, once again we go to File, Examples, go to Digital, and then go down to Tone page follower, load it up by hitting the Upload button. Remember I pulled the ground wire of the speaker out of the solder less breadboard, I'm going to plug that back in. Okay. So, now we have this photo resistor. Let's see what happens if we change the light by putting my finger over it. You can see you can vary the sound. It's almost like a musical instrument. You can almost cancel the sound out completely by putting your finger over and covering it. It's a very low tone, and the more light that hits it, the higher the tone. If I were to shine a bright light on that I could get it even higher. So, that's a great example of, the input is the photo resistor. The processing is done by the Arduino, and then the output is a speaker. So, let me unplug this again. So, you can see that I've shown you several different output and inputs. In the next video, I'm going to talk about how you might be able to mix all of these things up and do other kinds of input processing, outputting experiments with the Arduino. 10. What's Next?: So, the experiments that I've shown you here are just the beginning. There's so many other things you can do with the Arduino and in fact, there's a lot you can do with the components that you already have. Let's take a look. We have a few different input devices. We have the potentiometer, we have the photoresistor, and then we have various output devices. We have a speaker, we have a servomotor, we have an LED. So, how could we combine these things? One thing that we didn't do, but you can probably figure out a way to do pretty easily just by tweaking some of the sketches that are in Arduino, is controlling the servo using a photoresistor. So, we did it with a potentiometer, maybe you can use the photoresistor to do that. Or how about using the potentiometer to control the tone of the speaker? If you want to get really ambitious, you could use the photoresistor to control the pitch of the speaker and the potentiometer to control the volume. So, you could actually have a thermon-like device, where you have both volume and pitch controllable with your fingers with two different kinds of input devices. You might want to combine the LED with the servo so that the blink rate indicates the location of the servo's rotor is. So, you can really mix these up and do a lot of things. So, the one thing that I didn't show you because we just didn't have time is actually how to write and modify the sketches or the programs in the Arduino development environment. I have a book that is really a great way to get started with this stuff, and it is called Getting Started with Arduino. It's written by Massimo Banzi. He's the co-creator of the Arduino. He developed the Arduino in Italy. He's actually a designer, he's not an engineer. So, the book is filled with really lovely sketches that he has drawn himself showing you how to use the Arduino, how to write simple programs, how to modify them. So, I recommend this book. It's not expensive. You can get it as a PDF and download it and get it right away, or you can order it online. The other way to learn about programming is, if you go to arduino.cc, they have a lot of examples of code and how to get started and that's really the best way to do it. Is to actually have that code there, copy and paste it into sketches, experiment with it, change it, play around with it. This class, I showed you the hardware and how to hook things up, use the solderless breadboard and all those things so that you're comfortable with using the physical hardware stuff. The best way to learn the programming is really to go online and start looking at other people's code. The cool thing about Arduino is that it is so popular that there are examples of almost anything you can imagine for uploading programs. Any application you can imagine, there's probably an Arduino program that someone has written that all you need to do is modify a little bit. I've used other people's Arduino codes for a lot of projects that I've worked on and it's a great way to quickly get up to speed. The next thing to do is come up with more complex projects. I have an example of one that I did in my Skillshare class, that's the Getting Started and Do-it-Yourself Making, and so let me grab that right now. This is my Arduino-powered peanut butter mixer. As I explained to my other Skillshare class, the introduction to DIY, the reason that I built this is because I like to make peanut butter sandwiches for my kids before they go to school in the morning. One of the problems is that when I buy this natural peanut butter, there's always a lot of oil at the top of the peanut butter jar, and when I'm stirring it, the oil sloshes all over everything and it makes a big mess. Well, I found a website, it's called The Wired How to Wiki, and there was this guy who talked about how he learned how to mix peanut butter by simply taking a jar of peanut butter and flipping it every 24 hours. He would just put it upside down and then right-side up once every 24 hours, and that does a pretty good job of mixing the peanut butter and I thought it would be fun to automate that process. So, I ended up making this peanut butter stirrer, which I'll go into more detail in my other class, but I thought maybe we could take a look at it here and give you an idea of how it works. So, you can see it just sits there and in 24 hours, it will rotate 180 degrees and tip the peanut butter over, and that way the oil goes down to the bottom and slowly raises its way up to the top. I'll just reset it so you can see it do its thing again. So, it's a fun little thing. There are literally thousands and thousands of other projects people have made with Arduino. The variety is mind boggling. So, just go online, type in Arduino projects, you're going find a ton of cool projects. I hope you have fun with Arduino. Please go into the commenting section of this Skillshare class and tell me what you are interested in building, what you've built, I'll try to help as much as I can. I'm really curious and excited to see what you've built, and thank you so much for spending this time with me. 11. More Creative Classes on Skillshare: