AARDUINO
FIELD NOTES
5-DAY MAKER COURSESUMMARY NOTES

Build it.
Code it.
Make it react.

From your first blinking LED to a complete smart farm—one clear pattern connects every project.

MAKER NAME
ARDUINOUNO
BRAIN
USB
01 INPUT
02 CODE
03 OUTPUT
THE UNIVERSAL PATTERNREAD sensorIF conditionREACT output
YOUR ROADMAP

Five days. One system.

Each day adds one new superpower. By Day 5, you combine them all.

01
DAY ONE

Arduino Basics & LED Blink

ArduinoBreadboardLEDdigitalWritedelay
01

Physical computing

INPUTswitchBRAINmainboardOUTPUTmotor

Arduino UNO is a tiny computer—the brain inside robots, drones, and 3D printers.

02

Complete the loop

5V +PARTSGND

Electricity must travel in a full loop. One break anywhere means nothing works.

03

Know your parts

  • BreadboardPower rails run horizontally; terminal groups connect vertically in sets of five.
  • LEDLong leg is positive (+), short leg is negative (−). Direction matters.
  • 220Ω resistorProtects the LED. Never skip it.
WORK ORDER1 Build the circuit 2 Write the code 3 Upload
blink.inoARDUINO · C++
void setup() {
  pinMode(13, OUTPUT);   // Pin 13 = output mode
}

void loop() {
  digitalWrite(13, HIGH); // LED ON
  delay(1000);            // wait 1 second
  digitalWrite(13, LOW);  // LED OFF
  delay(1000);            // wait 1 second
}
CODE IN PLAIN ENGLISH

setup() runs once.

loop() repeats forever.

delay(1000) = 1000 ms = 1 second.

MISSION CHECK
  • Blink every 0.5 seconds. Hint: delay(???)
  • Bonus: blink 3 times fast, then rest 1 second.
POWER FIRST, WIRES SECOND

Turn OFF the board before connecting wires.

02
DAY TWO

LED Patterns & Piezo Piano

INPUTdigitalReadiftonebuzzer
FROM TALKING TO LISTENING

Arduino gets an input.

OUTPUTArduino talksLED · buzzer
+
INPUTArduino listensbutton · sensor

A button is the simplest input. Pressing it lets electricity flow. Use a 10KΩ resistor.

if means: “do this only when the condition is true.”
PIEZO NOTE FREQUENCIES

Higher number = higher sound

262DO
294RE
330MI
349FA
392SOL

tone(pin, frequency, duration)

button_buzzer.inoARDUINO · C++
void setup() {
  pinMode(12, OUTPUT);  // buzzer
  pinMode(9, INPUT);    // button
}

void loop() {
  if (digitalRead(9) == HIGH) {  // button pressed?
    tone(12, 330, 200);          // play sound
  }
  noTone(12);
}
MISSION CHECK
  • All 3 LEDs: ON 0.5s, OFF 0.5s.
  • Turn LEDs on one by one like a wave.
  • Build a piano with 5 buttons—one note each.
  • Bonus: play “Happy Birthday”!
3 LEDs = 3 pinsWrite pinMode three times: pins 13, 12, and 11.
03
DAY THREE

Sensors Ultrasonic & Light

SensorUltrasonicSerial MonitoranalogReadLDR
HC-SR04

See with sound.

Like a bat: send a sound, wait for its echo, then calculate distance.

distance = time × speed of sound ÷ 2
LDR

Measure the light.

Bright → BIG number
Dark → small number

01023
›_
SERIAL MONITOR

Hear Arduino talk.

Serial.begin(9600) starts talking. Serial.println(x) shows the value.

auto_light.inoARDUINO · C++
int light;

void setup() {
  pinMode(13, OUTPUT);       // LED
  Serial.begin(9600);
}

void loop() {
  light = analogRead(A0);    // read light (0~1023)
  Serial.println(light);
  if (light < 300) {         // dark?
    digitalWrite(13, HIGH);  // LED ON
  } else {
    digitalWrite(13, LOW);   // LED OFF
  }
  delay(200);
}
ULTRASONIC WIRING
VCC
5V
TRIG
PIN 9
ECHO
PIN 8
GND
GND
MISSION CHECK
  • Move your hand near the sensor—watch the number change.
  • Cover the LDR—the LED turns ON.
  • Dark → buzzer beeps.
  • Bonus: hand closer than 10 cm → LED ON.
SMART HOME LOGICIF it is darkturn on the light
04
DAY FOUR

Security System PIR Alarm

PIRMotionAlarmDeploy
HUMAN
HEAT
PASSIVE INFRARED

PIR sees heat change.

Humans give off heat. When a person moves, the PIR sends HIGH. No motion means LOW—just like a button.

DETECT+ALERT= SECURITY SYSTEM
pir_alarm.inoARDUINO · C++
void setup() {
  pinMode(7, INPUT);     // PIR
  pinMode(13, OUTPUT);   // LED
  pinMode(12, OUTPUT);   // buzzer
}

void loop() {
  if (digitalRead(7) == HIGH) {
    digitalWrite(13, HIGH);
    tone(12, 988, 300);      // alarm sound!
    delay(300);
    tone(12, 660, 300);
    delay(300);
  } else {
    digitalWrite(13, LOW);
    noTone(12);
  }
}
PIR WIRING · ONLY 3 WIRES
VCC
5V
OUT
PIN 7
GND
GND
MISSION CHECK
  • Wave your hand → LED ON.
  • Change frequency and speed—make the alarm yours.
  • Bonus: blink the LED fast while the alarm rings.
  • Install it at the entrance and test it.
LET THE SENSOR WAKE UP

PIR needs 30–60 seconds of warm-up after power ON.

05
DAY FIVE · FINAL PROJECT

Smart Farm Full System

Soil MoistureRelayPumpFull System
THE PROBLEM

Plants can’t ask for water.
So we help them speak.

The sensor watches the soil 24/7. When dry, Arduino tells a relay to power the pump.

READSOILdry = BIG
DECIDEARDUINOsoil > 600?
REACTPUMPwater flows
WHY A RELAY?

A small signal controls big power.

The pump needs more power than an Arduino pin can provide. Arduino is the boss; the relay is the strong worker. You can hear it click.

Pump power comes from the battery, never from the Arduino pin.
BUILD PLAN1 · BUILD2 · TEST3 · COMBINETest each part before combining.
STEP 01

Find your dry number

Compare readings in dry and wet soil. Your threshold will be unique.

MY DRY NUMBER
soil_read.inoARDUINO · C++
int soil;

void setup() {
  Serial.begin(9600);
}

void loop() {
  soil = analogRead(A0);    // read soil moisture
  Serial.println(soil);
  delay(500);
}
STEP 02

Test the pump alone

Same logic as Blink—just a pump instead of an LED. If ON/OFF is reversed, swap HIGH and LOW.

pump_test.inoARDUINO · C++
int pump = 6;

void setup() {
  pinMode(pump, OUTPUT);
}

void loop() {
  digitalWrite(pump, HIGH);  // pump ON
  delay(3000);
  digitalWrite(pump, LOW);   // pump OFF
  delay(3000);
}
STEP 03

Combine the full system

Soil controls the pump. Tank level controls the warning LED.

smart_farm.inoARDUINO · C++
int soil;
int pump = 6;
long duration;
int distance;

void setup() {
  pinMode(pump, OUTPUT);
  pinMode(9, OUTPUT);    // Trig
  pinMode(8, INPUT);     // Echo
  pinMode(13, OUTPUT);   // warning LED
  Serial.begin(9600);
}

void loop() {
  // STEP 1: soil -> pump
  soil = analogRead(A0);
  if (soil > 600) {            // dry? use YOUR number!
    digitalWrite(pump, HIGH);
  } else {
    digitalWrite(pump, LOW);
  }

  // STEP 2: tank level -> warning LED
  digitalWrite(9, LOW);  delayMicroseconds(2);
  digitalWrite(9, HIGH); delayMicroseconds(10);
  digitalWrite(9, LOW);
  duration = pulseIn(8, HIGH);
  distance = duration * 0.034 / 2;

  if (distance > 15) {         // water low?
    digitalWrite(13, HIGH);    // warning!
  } else {
    digitalWrite(13, LOW);
  }

  Serial.print("Soil: ");  Serial.print(soil);
  Serial.print("  Tank: "); Serial.println(distance);
  delay(500);
}
PIN MAP · CHECK BEFORE POWER ON
PARTPIN
Soil sensorA0
Relay / pump6
Ultrasonic Trig9
Ultrasonic Echo8
Warning LED13
Optional servo5
RELAY + PUMP WIRING

SIGNAL SIDE

IN → Pin 6 · VCC → 5V · GND → GND

POWER SIDE

Battery (+) → COM · NO → Pump (+)
Pump (−) → Battery (−)

All GNDs connect together.
“GND is one family.”
OPTIONAL

“Water Me!” servo sign

Servo moves from 0°–180°. Dry soil raises a paper sign. Use Pin 5 because Pin 6 is taken.

myservo.attach(5);
MISSION CHECK
  • Dry soil → pump ON.
  • Empty the tank → warning LED ON.
WATER + ELECTRONICS

Keep them separated. Keep the pump underwater while running—never run it dry.

THE BIG PICTURE

Five days.
One pattern.

READ sensorIF conditionREACT output
DAYREADIFREACT
01LED blink
02buttonpressed?buzzer sound
03light / distancedark? close?LED / buzzer
04PIR motionmotion?alarm
05soil + tankdry? low?pump + warning

Every smart device in the world uses this pattern.

You are makers now.
Keep making.