Self cooling city day 3

Main Content and Description of the Learning Scenario

Target outcome of the day

  • Everyone: Complete open to-dos from Day 2.
  • App developers: If/else rule without AI based on the live temperature → send short value to Arduino see AI app.
  • Developers: Receive short value and control LED traffic light red/yellow/green.
  • Designers: Make the LED traffic light visible on the model position, sign, legend.

Creator Lana Sattelmaier
Subject Computer Science, Technology, STEM
Length 240 min. including a 20-minute break
Pedagogical Approach Project-based learning
Competencies

C02 – Decomposition
C04 – Patterns
C12 – Programming
C33 – AI algorithm basics
C43 – Sensor basics
C44 – Data collection through sensors

Grade Grades 7–9
Technologies Arduino Nano 33 BLE, TMP36, LEDs red/yellow/green + 220 Ω resistors, breadboard, MIT App Inventor + AI2 Companion, ML4K web, smartphone/tablet, notebook
Evaluation
  • App displays live temperature Notify, String and makes an if/else decision.

  • App sends short value 1/2/3 to Arduino.

  • Arduino receives short value and correctly switches the LED traffic light 1 = red, 2 = green, 3 = yellow.

  • Documentation: 2 photos app + traffic light, wiring + 3 bullet points thresholds, what works/what is missing, next step.

Learning Activities

LA1: Warm-up and remaining tasks from Day 2 (30 min.)

Finalise ML4K Numbers at least 3 classes.

Check App Notify stability every 5 s new temperature string; hand warmth increases value.

LA2: ML4K: App – If/else and sending short values (45 min.)

Convert live temperature string → number.

Define thresholds example:

30 °C ⇒ Short 1 hot/RED

< 20 °C ⇒ Short 2 cool/GREEN

otherwise ⇒ Short 3 normal/YELLOW

Send using block: WriteUnsignedShorts fallback: WriteBytes with 1/2/3.

UI simultaneously shows clear status text/colour/emoji.

— Break (20 min.) —

LA3: Development – Receiving short values and building the LED traffic light (55 min.)

Wire LEDs with 220 Ω resistors: RED → D6, YELLOW → D5, GREEN → D4 each through a resistor to GND.

Flash updated Arduino code without mist pin.

Test: App short 1/2/3 switches red/green/yellow.

LA4: End-to-end test and stabilisation (35 min.)

Hand warmth → app if/else → short value → LED traffic light.

Fine-tune thresholds; optionally slightly offset on/off thresholds, secure cables.

LA5: Documentation and outlook (15 min.)

2 photos + 3 bullet points limitations/results/next step.

Outlook: ML4K Numbers replaces if/else → app sends the appropriate short value based on the AI label; the next step will add mist.

Materials

Presentation – Link

AB3.1 – Developer – Link

AB3.2 – App Developer – Link

AB3.3 – Designer – Link

Notes and good practice

Bluetooth in App Inventor: Do not pair via the operating system; scan/connect inside the app; use RegisterForStrings(..., utf16=false) for temperature.

Shorts instead of strings for commands: Always send commands to the Arduino as unsigned short values 1/2/3.

Safety: Always operate LEDs with a series resistor; provide strain relief for cables.

Main Content and Description of the Learning Scenario

Target outcome of the day

  • Everyone: Complete open to-dos from Day 2.
  • App developers: If/else rule without AI based on the live temperature → send short value to Arduino see AI app.
  • Developers: Receive short value and control LED traffic light red/yellow/green.
  • Designers: Make the LED traffic light visible on the model position, sign, legend.

Creator Lana Sattelmaier
Subject Computer Science, Technology, STEM
Length 240 min. including a 20-minute break
Pedagogical Approach Project-based learning
Competencies

C02 – Decomposition
C04 – Patterns
C12 – Programming
C33 – AI algorithm basics
C43 – Sensor basics
C44 – Data collection through sensors

Grade Grades 7–9
Technologies Arduino Nano 33 BLE, TMP36, LEDs red/yellow/green + 220 Ω resistors, breadboard, MIT App Inventor + AI2 Companion, ML4K web, smartphone/tablet, notebook
Evaluation
  • App displays live temperature Notify, String and makes an if/else decision.

  • App sends short value 1/2/3 to Arduino.

  • Arduino receives short value and correctly switches the LED traffic light 1 = red, 2 = green, 3 = yellow.

  • Documentation: 2 photos app + traffic light, wiring + 3 bullet points thresholds, what works/what is missing, next step.

Learning Activities

LA1: Warm-up and remaining tasks from Day 2 (30 min.)

Finalise ML4K Numbers at least 3 classes.

Check App Notify stability every 5 s new temperature string; hand warmth increases value.

LA2: ML4K: App – If/else and sending short values (45 min.)

Convert live temperature string → number.

Define thresholds example:

30 °C ⇒ Short 1 hot/RED

< 20 °C ⇒ Short 2 cool/GREEN

otherwise ⇒ Short 3 normal/YELLOW

Send using block: WriteUnsignedShorts fallback: WriteBytes with 1/2/3.

UI simultaneously shows clear status text/colour/emoji.

— Break (20 min.) —

LA3: Development – Receiving short values and building the LED traffic light (55 min.)

Wire LEDs with 220 Ω resistors: RED → D6, YELLOW → D5, GREEN → D4 each through a resistor to GND.

Flash updated Arduino code without mist pin.

Test: App short 1/2/3 switches red/green/yellow.

LA4: End-to-end test and stabilisation (35 min.)

Hand warmth → app if/else → short value → LED traffic light.

Fine-tune thresholds; optionally slightly offset on/off thresholds, secure cables.

LA5: Documentation and outlook (15 min.)

2 photos + 3 bullet points limitations/results/next step.

Outlook: ML4K Numbers replaces if/else → app sends the appropriate short value based on the AI label; the next step will add mist.

Materials

Presentation – Link

AB3.1 – Developer – Link

AB3.2 – App Developer – Link

AB3.3 – Designer – Link

Notes and good practice

Bluetooth in App Inventor: Do not pair via the operating system; scan/connect inside the app; use RegisterForStrings(..., utf16=false) for temperature.

Shorts instead of strings for commands: Always send commands to the Arduino as unsigned short values 1/2/3.

Safety: Always operate LEDs with a series resistor; provide strain relief for cables.