A clear and logically structured introduction that effectively demystifies hardware control for beginners. It provides a solid foundation in computational thinking by bridging the gap between abstract code and physical output.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
Arduino | Basics | Part 1
Added:Right, now uh we will try some programs on our on Arduino board. So, as I told you earlier, Arduino board may not know uh any functions. It doesn't know how to perform functions. So, we need to write instructions. So, all we need is we need an Arduino board. Uh of course, we should know how to write instructions about Arduino board. And we need some external peripheral devices such as like sensors. Uh depending on what program that you are uh trying, you have to get or you have to use devices like LED bands, sometimes electric DC motor. Uh sometimes other objects, right?
But here, since you are in grade nine, we will be doing some basic programs.
First, I try to do two programs today.
First, uh we will instruct the Arduino board to blink an LED for uh half a second, right? It has to be working for half a second, and then it has to be turned off, and then again for half a second it has to be turned off, and then it's on.
Like that, it has to be uh blink, right?
So, let's try how or let's see how we can write the instruction. So, listen, since it's uh online uh video, online class, uh I cannot take the physical Arduino board and, you know, make the wiring and write the instruction. That's difficult for you to see.
That's what That's why I'm I will be using a simulator, Arduino simulator.
Looks like an Arduino board, physical Arduino board, but it's not a physical Arduino board. It's an It's a It's a of uh artificial or you know, virtual one. But there we can connect the devices. We can We can do whatever we can do with the physical board, right? So, that may be very useful for you because you can easily see them on the screen with more clarity, right? So, before that, let's I need to take one important thing.
Right.
Since my program is about LED and some other components, I need to take some time for for them. Okay?
Right.
So, at least we have take some time for discussing about LED and some other components.
So, yes, as you all know, light emitting diode LED has two legs. One is the longer one and the other one is the shorter one, right?
The longer one is called anode, the shorter one is called cathode, right?
So, the plus or positive is anode, the negative one, the shorter one is called cathode.
Uh So, mostly when we are trying to uh perform some programs which are regarding some lighting appliances.
Right? For example, say you are trying a program to control a street light which which uh turns on when the environment is getting dark and which which is turned off when the environment is getting light. For such for for doing such thing, you need to uh practice them with LED bulb because LED uh is is is the one which is very very suitable for lighting appliances. So, we have to take the LED. This anode and cathode. One more thing, so if you take the Arduino board, the Arduino board doesn't have so many pins or connection areas or connection holes. So, if you want to connect many devices with the Arduino board, it's tough. That's why we have to extend the Arduino board by using a small circuit board called breadboard, right? So, it is known as breadboard. It's nothing It's a circuit board.
You can connect many devices rather than connecting connecting them directly on the Arduino board. This board has to be connected with Arduino board. Right? As you can see, there are so many holes available. You can connect many devices simultaneously there. This is called breadboard, right?
Earlier, it was a a wooden board like looks like a you know, board on which you cut the bread, but later, they turned into plastic boards, right? But still known as breadboard.
Right. So, let's try the first program as I told you earlier.
I will try a program for blinking the LED for 50 so for 500 ms, which means half second, it must be working for the next 500 ms, next half a second, it must be turned off, and then again, it will be repeating, right? Let's do how we can Let's see how we can do that.
Right. I will take a simulator first.
So, this may be Right.
Walk become. This may be very user-friendly, very simple. So, I will try to explain on this one. So, look at them on the right, on the left side you have the coding area where you have to write instruction for Arduino board. On the right hand side you have the Arduino Uno.
Then, let me uh increase the Arduino uh let me increase the zoom.
Zoom in, then only you can see that. I hope that you can see the parts of the Arduino now clearly.
Right, wait a minute.
And on the other side right, we have the coding.
Right?
This is a comment. This may not be important. Let me already delete it.
This is also a comment.
Comment is for uh describing the coding that you are going to write. Okay, let me delete it.
Right, look at the left hand side first.
Right, this is where right, look at that. This is where you have to write the instruction to the Arduino board.
Normally, there are two major divisions.
Void setup. This is one uh area, one division. That is void loop. Right? So, void setup, void loop.
The instruction written in this void setup area, right? The instruction written in this void setup area will be executed by the Arduino board only once.
Right? Keep keep that in your mind forever.
Whatever you write in the void setup section should be executed only once.
But, instruction written in the void loop section, right here they are executed again and again uh for infinitive number of right? They never be terminated or they never be stopped.
They will be executed again and again, but instruction written in void setup should be executed only once, right?
So, we will be writing the instruction later. Before that, let's take the Arduino board to get the right hand side. So, here I just want to connect an LED uh in digital pins, right? Okay, if I click this plus button, I can add many components as you can see, there are a lot of components available, right?
We have many components available here.
Including PIR sensor, ultrasonic sensor, buzzer, and there are many. I I just want to take LED, right? Click the LED now. LED comes.
You can drag and put it anywhere, right? Even if you want to change the color, you can change it, right? Look at them. Now it goes to yellow. Now it's purple. Any color is okay, right? It's green now, right? It is blue now. So, any color is okay. Let me click the red again.
Right? See, this is anode, this is cathode, right? You can see the legs there, right? This is anode, this is cathode.
Click the anode, and this must be connected with digital IO pins, right? Which means from 0 to 13, right?
Here. Okay, let me connect with pin number three here. Okay, I connect to pin number three.
So, anode is connected to pin number three.
Cathode, right? That is negative part, that should be connected to ground, right? That should be connected to earth ground. As you can see, there is an option called GND. If you point in the in in the particular hole, it shows the name there, GND. So, connect the negative part, which means cathode, in ground.
Have you understood the wiring? The anode should be connected to one of the digital IO pins from 0 to 13.
The cathode should be connected to ground.
Right? So, it is connected to ground.
Right, fine. So, now we can start writing the coding. In void setup area, right? In void setup area, I will write a coding. Later I will explain. Look here, pin mode Right, pin mode.
Pin mode, M capital. So, this is called case sensitive. Case sensitive means capital small differences are there. If you write all of them in small or if you write all of them in capital, your Arduino doesn't understand, right?
So, pin mode, M capital.
So, pin mode Look here, we connected the LED in three, right? Three. So, pin mode three, {comma} output.
Right? Pin mode Let's go take the coding again. Pin mode three, {comma} output.
It Actually, this is an instruction, right? This is an instruction given to the Arduino board. So, this instruction tells the Arduino board that there is an output device, right? There is an output device is connected to pin number three.
Right? So, here look at them. What's the What's the device connected to pin number three? That is LED, right? So, we are introducing there or we are telling that that we connected a device in pin number three. Okay?
Then only Arduino gets to know that there is a device in pin number three.
One more thing, the output, the word output must be capital, right? So, here pin mode M capital, here output capital.
This statement should be closed with semicolon. Right?
So, this is the one and only line written in void setup. Right? Come to the void loop.
Right? Void loop.
Now, I will tell Right? I will tell the Arduino board to light the LED, right?
So, watch the instruction carefully.
Digital write.
Digital write.
Digital write, W capital, all the others are small, right? Digital write.
I put the pin number again, right? Pin number three, {comma} high.
High capital, high.
Right? Look at the Look at the instruction again. Digital write three {comma} high.
So, what's the meaning of this line? It means high means electricity. It tells the Arduino board to give the electricity to give the electricity for the third pin pin number three. So, why? Because pin number three has the uh has the LED. So, we have to light the LED. So, in order to light the LED, we have to supply the electricity to the pin three. So, we are telling the Arduino board to do that.
Digital write three {comma} high means electricity should be given, right? To the pin three. High means 5 V current, right? Electricity uh Giving the electricity is called high.
If it is low, no electricity, right? 0 V. High means 5 V because normally we are using 5 V current here.
So, now, what will happen when when the Arduino board reads this instruction, Arduino understands that it has to give the power to the pin three, so light works.
Right? Look here. Our program is not only to, you know, light the LED, it is for bringing the LED. So, what I'm going to do is I'm going to tell the board now for lighting this LED for 500 milliseconds, which means half a second. Right? It must be lighting for 500 milliseconds.
So, delay Right? Delay within bracket 500 500 delay within bracket 500 What's the meaning? So, it has to be lighting, it has to be lighting for 500 milliseconds continuously continuously it will be lighting for 500 milliseconds.
Which means half a second.
Thereafter, it has to be turned off.
Right? LED has to be turned off. So, we have to See, earlier we mentioned that digital right three high. So, it tells the computer Arduino board to give the electricity. Now, we have to tell the Arduino board to stop the electricity in pin number three. So, what's the command? Digital right again same line digital right three comma low again capital L O W capital low So, now what will happen?
The LED will be turned off because this instruction tells the Arduino board to stop the electricity low, right? So, no current. Stop the electricity in pin number three. So, LED will be off.
I just want the LED to be off state for 500 milliseconds. Right? It must be in off state for 500 milliseconds. So, delay Right? Delay 500 Right? So, delay 500 means it will be turned off for 500 milliseconds.
That's it. Thereafter, what will happen?
Okay, now it will be it is off for half a second, right? Then after what happens? I already told you that the instruction written in void loop will be repeated again and again. So, after this instruction, right? After this instruction, what will happen? This one will be working. So, again, this one will be working means again pin three gets the electricity.
So, again it will it starts blinking.
Uh thereafter, it has to be there for 500 ms. Then it will be working, which means it will be turned off. Like that it goes again and again until you disconnect your devices.
So, now we have written the instruction, right? The Arduino program is over. What we have to do is if you are doing Listen.
If you are doing uh in a physical manner, which means uh assuming that you have the physical Arduino board, you have written this instruction in in a in a software in your computer, then what you have to do is you have to upload all these instruction through the USB cable to the Arduino board.
Upload means you have to transfer, right? You have to transfer because these instruction are instructions are written in your computer.
But Arduino board is a separate one.
So, you need to transfer all the instruction written in the computer to Arduino board.
That is in terms of physical, right? But now it is uh you know, simulator.
Uh so, it's not a physical thing. So, I What I can do is Look here. What I can do is I have to click this option, right?
Start the simulation. So, when I click the start, you have to understand that these instructions are uh uploaded to the Arduino board and the function starts, right?
Suppose if you have any error in your instruction, it will not be succeeded, right? Okay, look at the start option.
Right, as you can see the LED is blinking now, right? You can see that?
Right? It is blinking.
It is working for 500 ms, 1/2 second, then it is turned off for 500 again, then again on, off, like that it is working.
For example, if I change the time of say delay time 200.
So, for 200 ms, it will be off. 500 ms, it will be on. Now, see that blinking pattern may be look different, right?
Look at the Wait a minute.
It is still Okay, now you can see a different blinking pattern.
Right?
Off. Off state will be very shorter shorter period. But, on little bit uh larger longer, that's why it is blinking the different way.
Okay?
So, this is how this Arduino board operates this LED bulb. But, Arduino board doesn't know how to operate this LED bulb. We are the one who have written all these instructions.
Understood? Okay, let's say let's take the instruction again quickly. Pin mode three output. What's that? It this instruction tells the Arduino board that there is a device connected to output device connected to pin number three.
So, here you have to note that output should be capital, pin mode M capital.
Right? That is written in void setup.
Right? Take the void loop. The first instruction, digital write three {comma} high. So, it tells the Arduino board to provide the electricity for pin number three because LED has to be started, right? So, high should be capital. Here, digital write W should be capital.
Delay 500 means 500 milliseconds the light will be working, right? Digital right three low means it tells the Arduino board to stop supplying the electricity to pin number three. Therefore, LED will be turned off.
Delay 200 means it will be turned off for 200 milliseconds.
Right? So, this is bringing an LED for half a second.
So, we can try another small program in another visual or in another video clip.
Related Videos

Setting up a curved screen with Immersive Calibration Pro 4 and multiple cameras (P3D v4)
FlyerOneZero
23K views•2019-07-21

Robot Learning with Sparsity and Scarcity
allenai
379 views•2025-10-14

Jorge Mendez-Mendez: Unlocking Lifelong Robot Learning With Modularity (2023-10-05)
umassmlfl
237 views•2024-01-06

Northwestern’s MS in Robotics: Student Robotics Projects, 2023
NorthwesternEngineering
1K views•2024-05-31

"Perfect" Turns: Turning by the Gyro - FIRST LEGO League (FLL) SPIKE Prime + EV3 RePlay Programming
ZacharyTrautwein
94K views•2020-10-02

Gorkem Secer: TSLIP-based Deadbeat Running Control of Bipedal Robot ATRIAS
DynamicWalking-wv6qm
298 views•2018-06-22

Self-Driving Cars Need Lessons On Human Drivers | Maddie About Science
skunkbear
26K views•2018-08-21

Milrem Robotics’ THeMIS UGVs used in a live-fire manned-unmanned teaming exercise
MilremRobotics
99K views•2021-05-20
Trending

NOLAN WELLS AUTOPSY: DEEP TISSUE DISCOLORATION BACK OF HEAD, NECK BONE MISSING
nancygrace
561K views•2026-07-22

Big Tech's Biggest Gamble Is Finally Falling Apart
houseofel-ai
79K views•2026-07-22

we're almost finished the house (ep.125)
JennaPhipps
347K views•2026-07-22

We flooded a field - the results blew our minds
MossyEarth
73K views•2026-07-22