Ibnovate Course 2 · The Rising Builders
⏱ 75 minLive session

Session 7 — Hello, Hardware!

Duration: 75 min · Format: live online

What you'll learn: by the end, you can explain the Sense → Think → Act loop, build an LED circuit in a simulator, and write Arduino code that makes it blink.

Soft skill focus — Problem-solving

Today you'll also grow Problem-solving. A dead LED has only a few possible causes — an incomplete loop, a missing resistor, or a backwards LED — and finding it means checking them one at a time, not guessing wildly.

What you'll need


Hook

Think about this question:

Here's the pattern: it senses you, decides to open, and acts by moving. Almost every smart device works this way — and today you build the smallest version: an Arduino that makes a light blink.


Teach — Sense → Think → Act

A tiny computer called an Arduino connects code to the physical world through a three-step loop.

Look at this diagram:

Sense with a sensor, think with an Arduino, act with an output like an LED

Think about: "Take the automatic door — what's the Sense, the Think, and the Act?" Then try naming one more everyday device that follows the same loop.


Teach — A circuit + code, working together

Electricity needs a complete loop to flow. Here's the classic first circuit — an LED with a resistor, which protects the LED.

Look at this diagram:

An Arduino pin connected through a resistor to an LED and back to ground

Now the code: an Arduino sketch has two parts — setup() runs once, loop() runs forever.

Type and run this in Tinkercad:

void setup() {
  pinMode(13, OUTPUT);      // pin 13 will power the LED
}

void loop() {
  digitalWrite(13, HIGH);   // LED ON
  delay(1000);              // wait 1000 ms = 1 second
  digitalWrite(13, LOW);    // LED OFF
  delay(1000);              // wait 1 second
}

⚠ Watch for the common bug: if the LED won't light, the circuit is usually not a complete loop, the resistor is missing, or the LED is backwards (LEDs only work one way). Check the loop first.

Ask yourself: "Which line turns the LED off, and what would happen if I deleted both delay lines?" (Answer: digitalWrite(13, LOW); with no delays it blinks too fast to see.)


No hardware needed — you'll use the free simulator. Work through these steps on your own device.

  1. Open Tinkercad CircuitsCreate new Circuit.
  2. Drag in an Arduino Uno, an LED, and a 220 Ω resistor. Wire: pin 13 → resistor → LED → GND.
  3. Click Code, switch to Text, paste the blink code above.
  4. Press Start Simulation. The LED blinks!

Watch out for a broken loop or a missing resistor — check that your loop is complete and the resistor is in the line.

⚠ If you finish early: change both delay(1000) to delay(200) — what happens? Then make it blink an SOS pattern (3 short, 3 long, 3 short).


Check yourself

Try these — then check your answers:

  1. What are the three steps of physical computing?Sense → Think → Act. Input → Arduino → output.
  2. What does delay(1000) do? → Pauses for 1000 milliseconds = 1 second.
  3. Which part runs forever — setup() or loop()?loop() repeats endlessly; setup() runs once at the start.

Wrap-up


Tips & extra challenges

void setup() {
  pinMode(13, OUTPUT);
  Serial.begin(9600);        // so we can see the numbers
}

void loop() {
  int light = analogRead(A0);  // read the sensor (0–1023)
  Serial.println(light);       // print the value
  delay(200);
}

Run a proper little investigation: (1) open the Serial Monitor and record the reading for bright, dim, and covered — that's a tiny data table; (2) cover the sensor and watch the number fall in real time; (3) predict what number sits right between "lit" and "dark" — that becomes the threshold you'll use next session. Also want more? Keep the blink code running and print the light value each loop, so the board senses and acts at the same time. These readings are the "Sense" step — next session you add the "Think" (an if) to make an automatic night-light.

Vocabulary

Term Meaning
Arduino A tiny programmable board
Circuit A complete loop for electricity
Sensor An input that senses the world
Output Something the board controls (LED…)
loop() Code that runs forever

Resources

Practice set

Practise on your own — extra tasks on Sense → Think → Act, circuits, and the blink sketch, easy to hard. Answers follow each arrow.

1. Name the loop. For a car's reversing beeper, name the Sense, the Think, and the Act. → Sense: distance sensor · Think: Arduino checks if something is close · Act: buzzer sounds.

2. Read the code. What does delay(500) do? → Pauses the program for 500 milliseconds = half a second.

3. Once or forever? Which function runs once, and which repeats endlessly? → setup() runs once at start; loop() repeats forever.

4. Slow it down. Change the blink sketch so the LED stays on for 2 seconds and off for half a second.

void loop() {
  digitalWrite(13, HIGH);
  delay(2000);            // on for 2 seconds
  digitalWrite(13, LOW);
  delay(500);             // off for half a second
}

5. Fix the circuit. A student wired pin 13 → LED → GND with no resistor and the LED burns out in the simulator. What's missing, and why? → A current-limiting resistor (≈220 Ω) in series — without it, too much current flows and the LED is damaged.

6. Second LED (build task). Add a second LED on pin 12 and make the two blink alternately (one on while the other is off).

void setup() {
  pinMode(13, OUTPUT);
  pinMode(12, OUTPUT);
}

void loop() {
  digitalWrite(13, HIGH);
  digitalWrite(12, LOW);
  delay(500);
  digitalWrite(13, LOW);
  digitalWrite(12, HIGH);
  delay(500);
}

7. SOS (harder sketch task). Make the LED blink S-O-S in Morse: three short, three long, three short, then a longer pause. → One clean way, using a helper for each flash:

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

void flash(int ms) {
  digitalWrite(13, HIGH); delay(ms);
  digitalWrite(13, LOW);  delay(200);   // gap between flashes
}

void loop() {
  flash(200); flash(200); flash(200);   // S (three short)
  flash(600); flash(600); flash(600);   // O (three long)
  flash(200); flash(200); flash(200);   // S (three short)
  delay(1500);                          // pause before repeating
}

Going deeper (optional)

Optional — if you finish the blink early and want to know what's really happening.

Why the resistor, really — Ohm's Law in one line. Here's the number behind the 220 Ω. An LED wants only a small current or it fries. The Arduino pin gives 5 V; the LED itself uses about 2 V, leaving 3 V across the resistor. Ohm's Law says current = voltage ÷ resistance, so 3 V ÷ 220 Ω ≈ 0.014 A (about 14 mA) — a safe amount for an LED. The intuition, without heavy maths: bigger resistor → less current → dimmer, safer LED; too small a resistor → too much current → dead LED. Try a 1 kΩ resistor in the simulator and notice the LED gets dimmer.

delay() freezes everything. Here's why delay(1000) is a blunt tool: while the Arduino is "delaying," it can do nothing else — it can't read a button or a second sensor. Try adding a button and notice how presses get missed during a long delay. The professional fix uses millis() (checking the clock instead of freezing) — you don't need to code it yet, but knowing it exists explains why real projects rarely rely on long delays.

Common mistakes & fixes

What's next

Session 8 — Build a Smart Gadget: the Unit 2 project — you'll combine a sensor, a decision, and an output into your own working invention.

Ibnovate · Build · Innovate
Type to search · Esc to close
Welcome back
Sign in to continue building.
Accounts are created by Ibnovate — ask your instructor for your login.
🔒