Arduino Tutorial for Class 6–8
Introduction to Arduino
Arduino is an open-source electronics platform used to build interactive projects. It combines a small programmable computer called a microcontroller with input and output pins.
The basic idea
Input → Processing → Output
- Input: button, light sensor, temperature sensor, ultrasonic sensor.
- Processing: Arduino runs the program and makes a decision.
- Output: LED, buzzer, servo, motor, display.
What is Arduino Uno?
Arduino Uno is one of the most popular beginner boards. It is an excellent choice for school-level electronics and programming.
| Part | Purpose |
|---|---|
| Microcontroller | The brain that runs the program. |
| Digital pins | Read or control ON/OFF signals. |
| Analog pins | Read changing sensor values. |
| 5V / 3.3V | Power connections for compatible components. |
| GND | Electrical reference/ground. |
| USB port | Connects Arduino to a computer and uploads programs. |
| Reset button | Restarts the running program. |
Electronics Basics
Voltage, Current and Resistance
Voltage is the electrical potential that pushes charge. Current is the flow of electric charge. Resistance opposes current.
What is a circuit?
A circuit is a complete path through which electricity can flow. A simple LED circuit uses a power source, wires, a resistor and an LED.
LED and resistor
An LED is a light-emitting diode. In beginner circuits, use an appropriate current-limiting resistor with an LED. A common starting value is 220Ω or 330Ω.
What is a breadboard?
A breadboard lets you build temporary circuits without soldering. The holes are internally connected in groups, allowing components and jumper wires to share electrical connections.
Arduino Programming
Arduino programs are often called sketches. The two most important functions are setup() and loop().
void setup() {
// Runs once
}
void loop() {
// Runs repeatedly
}
First program: Blink
The classic first Arduino experiment is making an LED blink.
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
}
How it works: Arduino sets the built-in LED as an output, turns it on, waits one second, turns it off, waits one second, and repeats.
pinMode()
pinMode(13, OUTPUT);
pinMode(2, INPUT);
pinMode() tells Arduino whether a pin will be used as an input or output.
digitalWrite()
digitalWrite(13, HIGH);
digitalWrite(13, LOW);
HIGH and LOW are commonly used for digital ON/OFF control.
digitalRead()
int buttonState = digitalRead(2);
Use it to read a digital input such as a push button.
Variables
int ledPin = 13;
int score = 10;
float temperature = 27.5;
A variable is a named storage location for information. Students can think of it as a labelled box.
if / else
if (buttonState == HIGH) {
digitalWrite(13, HIGH);
} else {
digitalWrite(13, LOW);
}
An if statement lets Arduino make decisions.
for loop
for (int i = 0; i < 3; i++) {
digitalWrite(13, HIGH);
delay(300);
digitalWrite(13, LOW);
delay(300);
}
Serial Monitor
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println("Hello from Arduino!");
delay(1000);
}
The Serial Monitor helps students see values and messages from Arduino. It is also an important debugging tool.
Components & Sensors
| Component | What students learn | Example |
|---|---|---|
| LED | Digital output | Indicator light |
| Push button | Digital input | Switch |
| Potentiometer | Variable analog input | Brightness control |
| LDR | Light sensing | Automatic lamp |
| Buzzer | Sound output | Alarm |
| Ultrasonic sensor | Distance measurement | Parking sensor |
| PIR sensor | Motion detection | Security alarm |
| Servo | Controlled movement | Automatic door |
| DC motor | Continuous rotation | Robot |
Digital vs Analog
Digital: usually represents states such as HIGH and LOW.
Analog: represents a changing measurement across a range.
Reading an analog sensor
int sensorValue = analogRead(A0);
void setup() {
Serial.begin(9600);
}
void loop() {
sensorValue = analogRead(A0);
Serial.println(sensorValue);
delay(500);
}
Practical Projects
Project 1 — Traffic Light Class 6
Learn: digital outputs, timing and sequencing.
Use red, yellow and green LEDs to simulate a traffic signal.
Project 2 — Push Button Lamp Class 6
Learn: digital input and output.
Press a button to turn an LED on and release it to turn the LED off.
Project 3 — Electronic Dice Class 6–7
Learn: variables, random numbers, LEDs and buttons.
Project 4 — Automatic Night Lamp Class 7
Learn: analog input, LDR and conditions.
int light = analogRead(A0);
if (light < 400) {
digitalWrite(13, HIGH);
} else {
digitalWrite(13, LOW);
}
Project 5 — Security Alarm Class 7
Use a motion sensor to detect movement and activate a buzzer.
Project 6 — Parking Sensor Class 7–8
Use an ultrasonic sensor to measure distance. Make the buzzer beep faster as an object gets closer.
Project 7 — Automatic Door Class 8
Combine a sensor with a servo motor. Detect a person and move the servo to open a miniature door.
Project 8 — Smart Dustbin Class 8
Use an ultrasonic sensor and servo motor to open the lid when a hand approaches.
Project 9 — Obstacle-Avoiding Robot Class 8
Combine an ultrasonic sensor, Arduino, motor driver and two DC motors. The robot detects an obstacle and changes direction.
Class 6 Learning Path
- What is Arduino?
- Basic electricity and circuits.
- LED and resistor.
- Breadboard and jumper wires.
- Arduino pins.
setup()andloop().- Blinking LED.
- Traffic light.
- Push button.
- Buzzer and mini project.
Class 7 Learning Path
- Review digital input/output.
- Variables and data types.
if/else.- Analog input.
- Potentiometer.
- LDR and automatic light.
- Serial Monitor.
- Temperature or motion sensor.
- Ultrasonic distance sensor.
- Integrated mini project.
Class 8 Learning Path
- Review Arduino programming.
- Loops and functions.
- Servo motors.
- DC motors and motor drivers.
- Ultrasonic sensing.
- Displays and user interfaces.
- Combining sensors and outputs.
- Robot fundamentals.
- Project design and testing.
- Final STEM exhibition project.
Debugging
Students should learn that mistakes are part of engineering.
Hardware checklist
- Is Arduino powered?
- Is GND connected correctly?
- Are the jumper wires in the correct rows?
- Is the LED oriented correctly?
- Is the resistor present?
- Are the pin numbers correct?
Software checklist
- Does the sketch compile?
- Is the correct Arduino board selected?
- Is the correct port selected?
- Do the pin numbers in the code match the circuit?
- Are the conditions written correctly?
Arduino Safety
- Do not intentionally connect 5V directly to GND.
- Check the circuit before powering it.
- Use suitable low-voltage power sources for school projects.
- Motors may need more current than an Arduino pin can safely provide; use an appropriate motor driver.
- Keep liquids away from electronics.
- Never connect beginner Arduino projects directly to household mains electricity.
Practice Quiz
- What is the brain of an Arduino board called?
- What is the difference between an input and an output?
- What does
setup()do? - What does
loop()do? - What is the purpose of a resistor with an LED?
- What is the difference between digital and analog input?
- What does
digitalRead()do? - What does
analogRead()do? - Why is Serial Monitor useful?
- Design a project using one sensor and one output.
Final Challenge
Choose a real-world problem. Decide what your Arduino needs to sense. Decide what action it should take. Draw the circuit, write the program, test it, find mistakes, and improve your design.
Example: “I want to make a plant-care system.”
Soil moisture sensor
↓
Arduino
↓
If soil is dry → activate pump
If soil is wet → keep pump OFF