TubeSum ← Transcribe a video

Video yi29dbPnu28

0h 22m video Transcribed May 27, 2026 Watch on YouTube ↗
Beginner 10 min read For: Beginners interested in electronics and Arduino, no prior coding experience needed.

AI Summary

Mark Rober provides a crash course on Arduino, explaining how microcontrollers work using a human analogy (inputs, brain, outputs). He covers basic electronics, Arduino components, coding via Arduino IDE, and encourages creative projects.

[00:53]
Human Analogy for Arduino

Arduino works like a human: battery (food), sensors (eyes/ears), microcontroller (brain), and motors (muscles).

[04:38]
What is Electricity

Electricity is moving electrons; more electrons moving faster means more power.

[05:21]
Electrical Circuit as Hot Wheels Track

A circuit is a path for electrons; a switch acts as a gate to stop or allow flow.

[08:50]
Inputs and Outputs

Inputs (sensors) like light sensor, button, microphone; outputs (effectors) like servo motor, LED, buzzer.

[12:00]
Programming the Arduino

Use Arduino IDE to upload sketches; code has setup (runs once) and loop (runs continuously).

[14:34]
Blink Example

Simple blink sketch; changing delay values changes blink rate.

[17:01]
Knob to Control Servo

Example using a potentiometer to control servo position; schematic and code provided online.

[18:11]
Breadboard vs Custom PCB

Breadboard for prototyping; custom PCB for mass production (e.g., glitter bomb).

[20:03]
Using AI for Coding

ChatGPT can help write, debug, and improve Arduino code.

Arduino is accessible to beginners; with online resources and AI, anyone can build creative electronic projects by combining inputs, a microcontroller, and outputs.

Clickbait Check

90% Legit

"Title accurately describes a crash course on Arduino, delivering on its promise."

Mentioned in this Video

Tutorial Checklist

1 13:11 Go to arduino.cc and download the Arduino IDE software.
2 13:26 Open Arduino IDE, plug in Arduino, select correct port to connect.
3 14:46 Go to File > Examples > Basics > Blink to load a prewritten sketch.
4 15:14 Click the upload arrow to upload the code to the Arduino.
5 15:43 Modify delay values (e.g., change 1000 to 3000) to change blink rate.
6 16:19 Upload modified code to see changes.

Study Flashcards (10)

What are the four parts needed for any Arduino build?

easy Click to reveal answer

Inputs, brain (microcontroller), outputs, and wires.

08:11

What is electricity?

easy Click to reveal answer

Moving electrons.

04:38

What does the setup() function do in an Arduino sketch?

medium Click to reveal answer

It runs once to establish the rules of the game.

14:07

How fast does an Arduino run its loop?

hard Click to reveal answer

Four million times per second.

14:34

What is a breadboard used for?

medium Click to reveal answer

Prototyping circuits without soldering.

18:11

What is a custom PCB?

hard Click to reveal answer

A printed circuit board that integrates components for mass production.

19:18

What is the difference between an Arduino and a microcontroller?

medium Click to reveal answer

Arduino is a specific brand of microcontroller, like Tesla is a brand of car.

12:55

What does the loop() function do?

easy Click to reveal answer

It runs continuously over and over.

14:07

What is a sketch in Arduino?

medium Click to reveal answer

A version of a brain (program) for the Arduino.

13:39

What language are Arduino sketches based on?

hard Click to reveal answer

A slightly modified version of C++.

13:53

🔥 Best Moments

💡

Rapid Fire Turret

Demonstrates a fun, interactive build using Arduino-controlled servo motors and dart firing.

02:36
😲

Mind-Blowing Loop Speed

Reveals that an Arduino runs its loop four million times per second, highlighting its power.

14:34
💡

First Time Controlling Hardware

Describes the empowering moment when you modify code and see the hardware respond.

16:33

Full Transcript

Download .txt

[00:00] Welcome back to Crunch Labs, I'm Mark Rober and today we're doing just like a quick crash course on Arduino. So let's start with the basics. This is an Arduino. You might have seen it in some electronics builds.

[00:13] In fact, you might have seen it on a lot of builds on my channel. I use these all the time to get revenge on Halloween candy thieves. That's something you can do. You can go to the arcade and suddenly dominate a bunch of the games like this.

[00:28] You can build shark baiting devices, squirrel baiting devices, and even Porsche pirate baiting devices. You can make automatic strike bowling balls or automatic bullseye dartboards.

[00:40] Even if it's just for something simple like a candy dispenser, when Mr. B tricks you to go on vacation with him to an abandoned city. So it's some kind of complicated looking electronics board, but what exactly is it? So a good analogy is looking at us humans.

[00:53] For starters, I eat energy, so I eat food. And then with that energy, I can power my eyes and ears. I get information from the world around me. Then I take that information, and then that goes to my brain.

[01:05] And my brain processes that, and then it tells my muscles to do something. For example, ah, that light is kind of bright. I'm going to raise my arm to sort of block it from hitting my eyes. Now, just like that, with these components you see in front of me,

[01:19] first of all, there's a battery pack. That powers this whole system. So that's like me eating things to have energy. Right here, we have a sensor. In this case, it picks up IR signals. This is like our ears and eyes.

[01:32] We call this an input. So it takes that information, sends it right here to the brain, that Arduino microcontroller. It does some thinking, and then it sends information down these wires to these servo loaders. These are the outputs, or the effectors.

[01:46] And sure enough, if we test this out, I'm going to send a signal to the input. You can see the Arduino thinking about here as it lights up, and then it tells the muscles to do something. In this case, for this yaw motor to spin around.

[01:58] Now, I'm going to be honest. This is kind of boring. An electronic system just like this just isn't that interesting. But if you combine it with some mechanical pieces that can kind of move, place in some interesting spots,

[02:10] well, now you suddenly have a super cool desktop turret. And you can see it's this exact system just supplied here. There's three servo motors here, here, and here.

[02:22] We've got our brain right here and our battery pack right here. And now I can spin this all around. I can go down and up just by controlling the different servo motors. And of course, I can fire my darts.

[02:36] Rapid fire! Heck yeah! And just an easy line out of the gate, if you can put together a Lego build, you can program with an Arduino. So my goal today is just to break it down to first principles

[02:48] and make it really straightforward. Because the trick is, you don't need to know how to code to program and build cool stuff with an Arduino. There's just so many resources out there. There's tons of code that already exists for almost anything you can imagine

[03:03] that you can just copy and paste with minor tweaks, even if not. On top of that, there's a lot of AI chatbots that can actually help you program, help you think about your code, and help you actually write the code and debug it.

[03:15] So it's totally fine if you've never taken any kind of coding class. This can still make perfect sense. And so after watching this video and doing a few hack packs, now when you see something like the glitter bomb, and at first you might think, this is indistinguishable for magic.

[03:29] Like, how does it know when you lift the lid to wait a few seconds, to spin the cup, to fire the fart spray, to tell the phones to record? But then when you see this, you're like, aha, there's the brain. So just like in our simple example, there's inputs that tell it, hey, the lid has been lifted, the brain takes that information, and then it says information to the output, i.e. spinning a pound of the rope flying splitter and firing an uncharitable amount of heart spray to fill your hole apart.

[03:56] What? Hello? Hello? Hello?

[04:10] I'm not sure how to do this. I'm not sure how to do this. I'm not sure how to do this. Operation However Smelted Delcate. Initiated. F***.

[04:22] Oh. Operation Butchumpted. Initiated. Oh, you f***. Alright, alright, we f***ing, alright, alright, we f***ing get it, okay.

[04:38] Smells like f***ing s*** in here. So let's briefly start right at the beginning and just say, what is even electricity? Well, electricity is really just moving electrons.

[04:51] So I have some delicious lemon electrons right here. Now, if these electrons were just chilling like this, that's not electricity. But as soon as they all start moving, now we've got electricity. So now, if you had more of these lined up and they were moving faster, that's more electricity.

[05:07] It would be more powerful. But at the end of the day, your phone, your computer, your glitter bomb, the blood that's running through those veins of all those pieces of hardware is just moving electrons. And the difference between having a motor spin that sprays out glitter

[05:21] or having your phone have a screen that just lights up is how you decide to sort of divide and send those electrons throughout that mechanical build Now let talk about the electrical circuit Now you can think about the electrical circuit sort of like a Hot Wheels track for these electrons to travel on

[05:38] So if I connect this wire here, you'll notice this light bulb lights up. Again, instant replay. No light. As soon as I connect it, light. Well, why is that? Well, you've made a full electric circuit.

[05:50] So these electrons can flow from the positive terminal of this battery through this wire at the speed of light, through the outright casing on the light bulb, up through the bright little spot, down, and then back to the negative terminal. And as the electrons pass over this spot,

[06:03] there's a resistance built up there, and it gives off light. So all the electrons that have been stored up on this side of the battery are just coming out this wire, just swirling around through the light bulb, and then they're stockpiling on the negative side of the battery. Now, eventually, if we let this filter long enough,

[06:16] all the electrons would be from this side over this side, and we call that a dead battery. Now, a cool addition we could put into this electronic circuit is a switch. So if I just disconnect this and I'm basically extending my Hot Wheels track here,

[06:31] wait a sec, the light doesn't come on. Well that's because this switch is in the off position. It's like a gate that's stopping the electrons so they can't move. And if they're not moving, guess what? No electricity. But as soon as we flip that on, now the electrons can move again and that's

[06:48] electricity, which is why our light bulb is now once again turning on. All right, well now let's talk about how Arduinos harness moving electrons or electricity, but not before I eat one more delicious electron. So what we've got here is an Arduino build. Now again, you might be looking

[07:05] and be like, ah, that's kind of complicated. But what this is, is this a night light. When the lights go off and you cover this, the LED light gets brighter. This is effectively exactly how a night light works in your house. So when it's dark, you turn the lights off. This little light

[07:19] sensor senses that and turns the light to get brighter. Now just like before, all that's happening here is moving electrons, except we've added this Arduino. So we've made the electronic circuit a little bit smarter. So the electrons come from the positive terminal

[07:33] of this battery, and one Hot Wheels track is over here, where it's just continuously checking this sensor and saying, is it dark or is it bright? And then there's a second Hot Wheels track here, and if the brain senses that it's dark, it's like, yo, we need to

[07:46] increase the amount of little yellow skittles of electrons on this Hot Wheels track so that this light will get brighter. So this is an example, just a really simple thing that you could build using Arduinos.

[07:58] And we're going to get to a bunch more really fun ones in a second, but first let's review the four parts you need for any Arduino build. So the four parts to any Arduino build, or really like any robot or any piece of electronic

[08:11] equipment you interact with, like your washing machine or a calculator or your phone, if you You have your inputs, then you have the brain itself that does the computing, and the outputs. So that's three. And the fourth, of course, is just the wires that connect those three.

[08:25] And then again, going back to the human analogy, these inputs, the sensors, this is your eyes and ears, the Arduino or the computer, that's your brain. And the outputs or the effectors, those are your muscles. And of course, the wires are the nervous system.

[08:37] So your eyes and ears send the information across the nervous system to your brain, and the brain decides what to do with it and sends that information through the nervous system to your muscles that then affects the world. These are the effectors, the outputs.

[08:50] So let's look at some of the sensors, some of the inputs, the eyes and ears. Well, the first one is this light sensor. That's just what we saw in the nightlight example, right? So you get information on the light around you, goes to the brain.

[09:02] The brain's like, hey, it suddenly got dark. Goes to an output. Well, one of the outputs are LEDs. So it would say, make this brighter or make it dimmer. Let's look at some other inputs. This is just a simple button.

[09:14] This is a microphone. So literally, it's like an ear. This right here is really cool. It's a proximity sensor. So it's sensing if something's close or far away. This is just a knob. This is a joystick.

[09:26] This is a soil moisture sensor. Now we go to the brain, and now let's get to some of the outputs. This is called a servo motor. These are the same type of motors that were on our turret at the beginning of the video. This is just a little DC motor.

[09:38] In this case, it's got a little fan on the end. Here's some LEDs, and then here's a little buzzer speaker. And by the way, if you go online, there is a ton of relatively inexpensive options. We're used to the kit that has a bunch of these inputs or sensors,

[09:51] and then also a bunch of these outputs, the effectors. And this is where it gets really fun, because how can we creatively combine these inputs to do cool stuff with these outputs? Well, here's some examples. You could maybe stick this soil moisture sensor in your plant,

[10:06] and then when the soil gets dry, you can have it light up an LED so you know it's dry. Or even better, have it send a file that says, I'm thirsty, feed me water. Or maybe you could use this microphone and you could have a box, a locked box,

[10:21] and it's locked with this output, with this servomotor. And the only way to open that box is if you give a secret knock in just the right order. And when it hears that very specific knock on the microphone at just the right spacing,

[10:35] well, then the brain gets that information and says, that's it. And then it turns the silver motor and then opens the door and allows you to get your secret stash. What's inside? I don't know. Maybe some delicious yellow electrons. You can use this knob here to increase the speed of a fan that's on you.

[10:52] Or maybe you use a thermometer to even turn the fan on at the right temperature. So you don't even have to turn a knob. You could have a cookie jar And when the lid is lifted this button gets unpressed And when that happens you have an alarm goes off because someone invaded your secret stash of cookies And so now you can get a sense that for a lot of these it just kind of like the story you package around the hardware

[11:16] You can even do something really simple with like this proximity sensor and this lights and buzzer and then a secret button. And you can call it a cool guy finder. So you go up to one of your buddies and the buzzer goes off and it lights up. he must be a cool guy, and you secretly release the button that breaks the circuit, and you go up to another buddy, and it doesn't light up.

[11:34] Kind of a ridiculous concept, but you can see all the fun you can have with something like this if you just package the right story around it. And that's really what's going on with my videos that have these electronic builds in them.

[11:46] They're usually not that complicated. It's really about the story you package around it to have this really creative, fun, engineering build that can either just be really useful in your life, or it could just be fun and bring joy to your friends and family.

[12:00] All right, so now that we've got a pretty good overview of what you can do with Arduinos and microcontrollers, I just want to go one level deeper, really briefly, to talk about how you actually put new code onto this thing,

[12:12] or swap out the brain, so now it knows, when it gets some information from the soil moisture sensor, what to do with that information. Because that's a different brain than the one that looks for a specific set of knock-knocks before opening the box, right?

[12:26] For each one of those, you just swap out the brain so it knows what this input is and then what to do with it. And before we do that, I do want to briefly mention, I'm saying Arduino and microcontrollers sort of interchangeably. Arduino's name of the company, they're open source, they're super, super cool.

[12:41] They basically got this whole movement started. And so massive props to them. There's different types of boards. This is the Arduino Uno. It's very common. The nice part about this is you've got these header pins, so your wires can just plug, like, directly into the board, which is pretty convenient.

[12:55] Now, in the case of Hack Pack, technically this isn't an Arduino because we made our own version, so it's just a microcontroller. So, like, an Arduino is a specific brand of microcontroller in the same way that Tesla is a specific brand of car.

[13:11] So let's just take a quick look about what the software looks like and how you actually do the brain swapping. So the first thing you've got to do is just go to arduino.cc, and you're going to download a specific piece of software called Arduino IDE.

[13:26] It's free. And then when you download the program and open it up, you get a screen like this. So all you've got to do is plug in your Arduino, select your correct ports, and now you've got a connection to the brain. So each version of a brain is called a sketch.

[13:39] So this is called an Arduino sketch. Again, you do not need to learn the code. You just need to go to copying and pasting because there's so much on the Internet. As far as like what kind of code this is, the code in these sketches is a slightly modified version of C++.

[13:53] It's just an incredibly common language that is used a lot, especially anytime you're interacting with hardware. So when you look at the code, you'll see there's kind of two chunks. The first is the setup, and ultimately all you need to know here is setup only happens once.

[14:07] That's where you're kind of establishing the rules of the game. And then loop is the thing that just runs over and over and over. Like with the nightlight, we set that up once, right when you turn it on. After that, it's just continuously running a loop over and over and over.

[14:21] Just continuously asking, what is the value of that light? And if at any point it gets too dark, then in that loop it has a little spot that says, ah, then turn on the LED, and then it just keeps checking. Is it still dark? Is it still dark? As soon as it gets light, okay, now turn off the light.

[14:34] And if you want your mind blown by just how powerful even a small computer like this can be, it runs that loop four million times in one second. So let's just run a simple program and see how this works.

[14:46] So I can go up here to File, Examples, and then Basics, and I'm going to choose Blink. And when I do this, you'll see it preloads a sketch. So again, here's the setup, we're calling out what pins and stuff we're using, and then here's the loop.

[15:00] That just loops over and over. And what you should know is that anything that's like in this grayed out color, that's in between these forward slash and the asterisk, that's just what we call the comment. It does nothing. It's like it's not even there, it's just as humans, it helps us read it.

[15:14] So there's a link to where you can learn more. It says who modified and created this. But anything not in gray, like the setup here, or the actual information on the loop, that's what the board is actually using. So I'm going to go ahead and hit this over arrow, which will upload the code to my Arduino,

[15:30] effectively swapping out the brain on this thing. And lo and behold, we now see the onboard LED is blinking. Now here's what's really cool. I remember the first time I did this, it was just like this aha moment that felt really powerful.

[15:43] But I can change the rate at which it blinks. So I'm going to check into the code here. And sure enough, it says it turns the LED on. And then it waits for a second. That's this delay.

[15:55] And then it turns the LED off by making the voltage low. And then it waits for a second. So you can see the number here is in milliseconds. So I'm going to get crazy. And let's say I want it to stay off for three seconds.

[16:07] So I'm going to change that to a 3,000. and then I want it to stay on for four seconds. So I'm going to change that to 4,000. Now I'm just going to upload that code, swap out that new brain for this. It's only slightly modified.

[16:19] And now when we look at this LED, wouldn't you know it? It's turning off for three seconds and staying on for four. And when you do that for the first time, it's just this powerful moment that you controlled this piece of very complicated hardware

[16:33] to do something you wanted This is a great first step And now just to be fun I going to change this to go even faster So I deleting a zero off of both of those And now when I upload we should see that

[16:45] it's blinking way faster. So that's just about the most simple example of how you can swap out the brain on this thing. But there's tons more examples online where you'll not only get the code, but they'll also give you the schematic or basically how you would wire up and connect your inputs and

[17:01] output. So as an example of one of those, I'm just going to go ahead and pull up this one I found where you use a knob to control a motor. So here's a program I googled called knob, and it tells you

[17:13] the top what it does. It says it controls the position of a servo motor with a knob, basically. And I'll just cut to the chase and show you that. So you see, as I turn this knob, the motor itself turns. The question is, oh, what kind of creative story could you put on this to make it interesting?

[17:29] and I'm just thinking, oh, you can have this in your car at your dashboard and maybe at your back window you've just got, like, a funny picture and maybe the arm you paste to this thing. So if you want to wave to someone because they were nice and they let you in,

[17:42] you can just spin the knob like this and now you're waving to the car behind you. Or, I don't know, maybe you're in an abandoned city with Mr. Beast and you want to scare him by turning a knob to have a servo arm push a glass bottle off the top story so he thinks scary people are out to get us.

[17:57] I'm just saying, hypothetically, that's something you can do. Or maybe in bed, if you want to turn off your lights remotely, you just turn this knob, and then it flicks the switch down. Infinite options of how you take this hardware setup and apply it creatively to the world around you.

[18:11] At any rate, as we scroll down on this page, you'll see it shows you exactly how to set this up, where to plug each of the colored wires into. We call this a schematic, and then it gives you the code. You literally just copy and paste this into your own code,

[18:26] then hit upload, and now you're totally golden. One thing I'll point out is I've got this white thing here. We call that a solderless breadboard, and that's because I could technically solder all these wires together

[18:38] to make that hot wheel track, right, to make the electronic circuit. The cool thing about these breadboards is if you flip it over, you'll see these are all connected. So if you plug in something here, that means if I plug in anything along this row,

[18:51] because those are all connected with this little piece of metal, It's no different if both of these wires were physically touching each other. And the same also goes for all of these rows, because you can see those are also horizontally connected as you go down the breadboard.

[19:05] So plugging in this wire here and this wire here is the same as connecting them. And it just makes it super convenient for sort of prototyping and testing. And then once you have it and you like it and you want to lock it down,

[19:18] let's say you want to go to mass production, or let's say you want to make 20 glitter bombs. you can send all across the country. Then you do what's called a custom printed circuit board. And that's basically where you take the breadboard and the sardino,

[19:31] you package them all in one thing, you get these custom made. And this custom PCB is essentially this, just in the printed form. Even the battery holster you can see is just part of the board. And so a custom PCB is what you'll find in your calculator,

[19:46] in your microwave, in your washing machine, in your car. Basically, anything electronic that you interact with will have a custom PCB just for that piece of hardware. And it's no different than a breadboard and an Arduino just packaged into one clean thing that you could mass produce.

[20:03] And so for the nightlight example I showed earlier, I also just found that by Googling it and using this website. That also showed me exactly how to set it up with a breadboard and gave me the actual code to run. And of course, in addition to just Googling and finding pre-written codes, you know, chat GPT and other LLM models are a game changer.

[20:22] So you can actually put your code into there if it's not compiling. You can ask it questions on how to improve the code and simplify it. If you have a really cool idea you want to try, you can literally have a conversation and have it be your chooser to help you get your code exactly what you want.

[20:36] Or maybe you copy and paste it a few bits of code. You're not sure why they aren't playing nicely together. It can help you figure that stuff out. Now coming back full circle to where we started this video, for Hackpack, which is these really fun robots that you can put together where the brain is a microcontroller,

[20:52] what just makes this so fun is you can swap out that brain to completely upgrade the functionality. That's the secret sauce. That's the magic. But then with Hackpack, when you want to plug it into your computer to swap the brain, instead of using the Arduino IDE that I showed earlier, we have our own browser-based coding console.

[21:10] And when you're there, you'll see there's three levels. At level 1, the code is fully locked down, and you can only swap out the full code for verified new hacks, like the passcode hack. At level 2, you can now change some key variables, like how quickly the barrel turns, or how many numbers to put in your passcode lock.

[21:26] And then at level 3, you have full access to change everything. So if you want to learn more about Hack Pack, get that robot in a box coming right to your door where it's like that first step in getting you down the path to creative engineering. you should go to crunchlabs.com.

[21:39] But either way, hopefully this was a useful craft course in how Arduino's work. I'm really stoked you're taking this step because I found so much joy from taking my mechanical engineering skills,

[21:51] sort of combining them with electronics, and then wrapping it in a story to make really fun content in the world. And even just for my family and friends. Good luck, and thanks for watching.

[22:07] Thank you.

⚡ Saved you 0h 22m reading this? Transcribe any YouTube video for free — no signup needed.