One-sentence summary
Arduino is an open-source microcontroller board that we program with code to control parts such as LEDs, sensors, motors and buttons.
Why does it matter?
In the previous lesson we built a bicycle safety light with wires and resistors. The circuit worked, but its behaviour was fixed: the light was either on or off. What if we wanted it to switch on by itself when it gets dark, or to blink when we press a button?
This is where a microcontroller comes in. A microcontroller is a tiny computer on a single chip: it reads inputs, makes decisions and controls outputs. Arduino places that chip on a board that is easy to program.
Learning Arduino matters because it builds the bridge between your code and the physical world. In Python you printed "Hello" to a screen; with Arduino you can light a real LED, read a temperature sensor or drive a motor. This is where software meets electronics.
Short definition: Arduino is an open-source, beginner-friendly microcontroller development board that manages inputs and outputs according to your code.
Arduino as a microcontroller board
What does the board do?
An Arduino board holds a processor chip, a row of connection pins, and a USB port that plugs into a computer. We write code and give each pin a job.
Pins do two basic things:
- Input: They read information from the outside world, such as whether a button is pressed or the value of a sensor.
- Output: They send a signal to the outside world, such as lighting an LED or turning a motor.
Pins also work in two ways. Digital pins understand only two states: on (HIGH) or off (LOW). Analog pins read a value within a range, for example the reading of a light sensor between 0 and 1023.
Everyday example: An automatic night light
Think of a night light in a child's room. Inside it there is a small board, a light sensor and an LED. When the room gets dark the sensor value drops, the board reads this and switches the LED on. In the morning, when light increases, the lamp turns off. This is exactly what a microcontroller does: read, decide, act.
Everyday example: A washing machine
When you turn the program dial on a washing machine, a microcontroller inside decides how much to heat the water, when to turn the drum and when to stop. Arduino is a small, learning-friendly version of the same idea.
Arduino versus micro:bit
You already know the idea of a microcontroller from the micro:bit lesson. Arduino uses the same core idea, but there are some important differences.
| Feature | micro:bit | Arduino Uno |
|---|---|---|
| Display | Built-in 5x5 LED grid | No display; add an external part |
| Sensors | Built in (motion, temperature, compass) | Usually connected externally |
| Connections | Easy with crocodile clips | Usually a breadboard and wires |
| Programming | Blocks or Python | C/C++ (the Arduino language) |
| Flexibility | Quick to start | More pins and control |
The micro:bit is like a ready-made box for quick experiments; many parts are already built in. Arduino is more bare: you connect the parts yourself. This can look harder at first, but it teaches you how the circuit works and allows for larger projects.
Being open source also matters: Arduino's design and software are open to everyone. That is why there are thousands of compatible boards, example projects and free resources around the world.
The board, the IDE and the code loop
How do we write the code?
We write and upload code to the Arduino board using a computer program. This program is called the Arduino IDE (IDE stands for "Integrated Development Environment"). In the IDE we write code, upload it over USB to the connected board, and the board runs that code again and again.
Every Arduino program (called a sketch) has two basic parts:
void setup() {
// Runs once: startup settings
}
void loop() {
// Repeats forever: the main behaviour
}
The setup() part runs once when the board turns on. Here we decide whether each pin is an input or an output. The loop() part repeats without stopping; the main behaviour lives here.
First real example: Blinking an LED
Imagine an LED connected to pin 13 on the board (always with a resistor to protect the LED). The sketch below turns the LED on for one second and off for one second:
void setup() {
pinMode(13, OUTPUT); // Make pin 13 an output
}
void loop() {
digitalWrite(13, HIGH); // Turn the LED on
delay(1000); // Wait 1000 ms
digitalWrite(13, LOW); // Turn the LED off
delay(1000); // Wait 1000 ms
}
The logic here is the same as the repetition structure from the algorithms lesson: the same steps loop forever. delay(1000) waits one thousand milliseconds, that is one second.
Talking to the computer: Serial
To see what the board is doing, we can send messages to the computer. This is called serial communication. Let us read the state of a button and print it (button on pin 2 with a pull-down resistor):
void setup() {
Serial.begin(9600); // Start communication
pinMode(2, INPUT); // Make pin 2 an input
}
void loop() {
int state = digitalRead(2); // Read the button
Serial.println(state); // Print to the screen
delay(200);
}
Serial.begin(9600) starts the communication, and Serial.println() prints the value to the Serial Monitor window in the IDE. This is one of the most useful ways to debug on Arduino.
Mini practice
Before you even have a board, plan the steps of a sketch on paper. Goal: When a button is pressed the LED lights up, and when it is released the LED turns off.
Answer these questions:
- Which pin should be an input, and which an output? What do you set in
setup()? - What should you read first inside
loop()? - Which condition do you use to switch the LED on or off based on the value you read?
You can write it as pseudocode, without real code:
setup: pin 2 input, pin 13 output
loop:
read the button
if the button is pressed
turn the LED on
otherwise
turn the LED off
Once you have your idea, we will turn it into real Arduino code in the next lesson.
Common mistakes
Forgetting pinMode
If you forget to set a pin as OUTPUT in setup(), digitalWrite may not behave the way you expect. Give every pin its job at the start.
Connecting an LED without a resistor
If you connect an LED directly to a pin, too much current flows through it and the LED can be damaged. Always use a current-limiting resistor with an LED (usually 220 or 330 ohms).
Forgetting the semicolon
In the Arduino language every command line ends with ;. If you forget it, the IDE gives an error and cannot upload the code. This is a very common mistake.
Mixing up setup and loop
If you put settings that should run once inside loop(), they repeat needlessly. If you put behaviour that should repeat inside setup(), it never repeats.
Safety note
- Beginner Arduino projects run only on low voltage: USB (5V) or a suitable battery pack is enough. Never try to connect it to mains electricity (directly to a wall socket).
- Always use a current-limiting resistor with LEDs and similar parts; otherwise the part can overheat or fail.
- Never drive motors directly from Arduino pins. Motors draw a lot of current and can damage the board. Motors need a motor driver and a separate power source; start the motor at a low speed.
- In projects such as water pumps, keep water away from the electronic parts.
- Make connections while the board's power is off, and carry out your first tests together with an adult.
Lesson summary
- Arduino is an open-source microcontroller board that lets us control physical parts with code.
- Pins can be inputs or outputs; digital pins read HIGH/LOW, and analog pins read a value within a range.
- Compared with micro:bit, Arduino is more bare but offers more pins, control and flexibility.
- We write the code in the Arduino IDE; every sketch has a
setup()that runs once and aloop()that repeats. - Beginner projects run on low voltage; motors need a driver and a separate power source, and LEDs need a resistor.
Review questions
- What does it mean for a pin on an Arduino board to be an "input" or an "output"?
- What is the main difference between the
setup()andloop()parts? - What is the difference between a digital pin and an analog pin?
- Why do we use a resistor when connecting an LED to Arduino?
- Why should we not drive a motor directly from an Arduino pin?
Answers
- An input is when a pin reads information from the outside world (such as a button or sensor); an output is when a pin sends a signal to the outside world (such as lighting an LED).
setup()runs only once when the board turns on and holds the startup settings;loop()repeats without stopping and holds the main behaviour.- A digital pin understands only two states: on (HIGH) or off (LOW). An analog pin reads a value within a range (for example 0–1023), so it can measure gradual values such as light or temperature.
- The resistor limits the current that flows through the LED. Without it, too much current flows and the LED can be damaged.
- Motors draw a lot of current, and this current damages the board's pin. That is why a motor driver and a separate power source are needed.
Source and verification note
For “What Is Arduino?”, verification focuses on whether the relationship between Arduino as a microcontroller board and Everyday example: An automatic night light remains consistent across examples. Pin, voltage and current limits can differ between Arduino-compatible boards. Compiling code does not guarantee a safe circuit; loads such as motors and servos require a suitable driver and external power where appropriate.
Next lesson
Boards and Basic Components: We take a closer look at the pins on the Arduino Uno, the breadboard, and the basic electronic parts you will use in your first projects.