Skip to main content
PSUT / IoTEngineering learning studio
WORKSPACE
Offline-first portalDr. Mohammad Alja’afreh
Embedded Systems StudioIoT Programming and ApplicationsExperimentsWorkspaces
ENGINEERING WORKSPACE
Home/WSL Laboratories/Lab 1 · Board architecture & setup
IoTPSUT IoT Engineering StudioPrincess Sumaya University for Technology · Dr. Mohammad Alja’afreh
Pi practical / X1
IoT Programming and Applications

Lab 1 · Board architecture & setup

Ask Dr. Mohammad · X1 →

setup_wsl.sh does what setup_pi.sh does (venv, packages); board_check reports the computer honestly.

Design experiment & verify evidence →
X1 · Laboratory mentorAsk about the current experiment, its algorithms or Python notebook.
Ask Dr. MohammadAdaptive practice
Learning workflow · Core IoT & programmingX1 · Board architecture & setup
Readiness checksRevision deckEngineering workspaceRecord evidence
X1 · Academic orientation

Scope and objectives

Scope of the experiment

Distinguish WSL board inspection from Arduino Uno compilation and observe the on-board LED sequence.

The focus of this experiment is to distinguish ESP32 board resources, GPIO capabilities and development environment. Students then trace compilation, upload and serial-monitor readiness, and identify board selection or pin constraints before hardware use. The Concepts view explains the operation before the practical work; the Simulation view is used to examine reference and changed inputs, not to substitute for actual measurements.

Learning objectives

  • Distinguish ESP32 board resources, GPIO capabilities and development environment.
  • Trace compilation, upload and serial-monitor readiness.
  • Identify board selection or pin constraints before hardware use.
  • Identify the configured inputs (Board inspection runtime; Wokwi board target; Build succeeds; Firmware transfer succeeds; Blink cycles) and record the corresponding observed outputs with units where applicable.
  • Compare the reference calculation or decision with an independent implementation or authorized observation; state any discrepancy and the applicable model boundary.

Expected learning outcomes

On completion, students can distinguish ESP32 board resources, GPIO capabilities and development environment, trace compilation, upload and serial-monitor readiness, and identify board selection or pin constraints before hardware use.

Required deliverables

Submit the derivation or state trace for the named operation, the exact reference and changed configurations, the associated simulator or practical evidence, and a short validation statement addressing identify board selection or pin constraints before hardware use. Separate predicted values from observations.

Prerequisite knowledge and related learning

Review the following catalogue prerequisites before starting. After completion, continue to Lab 2 · LED & buzzer timing.

Environment and experimental methodology

Browser teaching model, the named WSL or Python environment, and the physical board/components only for the hardware activity described in the practical instructions.

Begin with a manual prediction, record the baseline, change one independent condition at a time, and compare the resulting trace or measurements with the original prediction. Record observations and uncertainty separately from reference values. Follow the experiment’s specific procedure, safety limits, and acceptance checks.

X1 / PREPARE

Before starting

Follow the setup guide and use the named terminal or editor. A browser model is not a real GPIO measurement or a running service.

Ubuntu WSL setup →
Before you run / verification gate

Use local Windows VS Code with PlatformIO and Wokwi extensions; build before starting and stop simulator afterward.

CONCEPTS / ACTIVE RECALL

Understand the experiment

Scientific architecture · Raspberry Pi board inspection and Arduino Uno blink

Two physical computing platforms — Raspberry Pi / Linux + Python; Arduino Uno / microcontroller; Pi program / OS process; Arduino sketch / setup then loop; Blink timing / GPIO voltage differs
Scientific concept map: Raspberry Pi — Linux SBC; Arduino Uno — Microcontroller; Program loading — Interpreter vs firmware; GPIO output — Built-in LED; Timing — Blink period.

Scientific foundations and analytical reasoning

Board architecture, host runtime, compilation and firmware execution are distinct. An Arduino Uno sketch runs on its microcontroller, not the WSL host.

Before operating the equipment or executing the program, derive the expected outcome using the required theoretical work in Experiment. Use the diagram to identify the variables and system boundaries.

Scientific theory · Embedded versus host execution

A Raspberry Pi is a general-purpose computer with an OS and processes. An Arduino Uno executes compiled firmware on a microcontroller, usually through setup once and loop repeatedly. Compiling, uploading and running are distinct stages. WSL and browser models do not imply electrical hardware access.

Worked example and engineering interpretation

A host script can complete while an uploaded Arduino program continues blinking. A successful compilation confirms syntax and linking, not pin wiring or successful upload. Establish which processor runs each code section and identify its I/O boundary.

Engineering principles · additional worked teaching example

A microcontroller executes firmware on a board target; compilation, upload and execution are separate acceptance gates. Blink with 200 ms HIGH and 800 ms LOW has period 1 s, 20% duty and 4 complete cycles in 4 s. WSL does not emulate electrical I/O.

From theory to experiment

Predict the reference result before operating the workbench; check the actual intermediate state, units and constraints. The existing simulation, implementation and procedure below are distinct sources of evidence.

How to investigate Lab 1 · Board architecture & setup

Build and inspect Arduino LED blinking.

Analytical investigation means collecting an observation, identifying the mechanism, using a calculation or state trace to explain it, and checking your conclusion against evidence. Controlled comparison means changing one independent variable, holding the remaining relevant conditions constant, and measuring a dependent variable against a baseline. Experimental validation means comparing a predicted result to a reproducible observation or assertion; agreement inside a model does not certify hardware. Evidence-based reasoning connects a specific observation to a theoretical rule and states uncertainty, not merely an opinion. Performance characterization records a named metric and its units across conditions; sensitivity analysis changes one parameter across several values. A threat assessment links an asset, threat, consequence and evidence to a mitigation.

Experiment-specific guided practice

Objective: Build and inspect Arduino LED blinking.

  1. Run the WSL board inspector; do not treat mock hardware identity as a physical Raspberry Pi measurement.
  2. Select Arduino Uno, successful compile/upload, and three blink cycles. Play GPIO13 LED transitions.
  3. Change the target to ESP32. Explain why an Uno project does not establish correct ESP32 board configuration.
  4. Run python -m labs.exp01.board_check in the activated WSL environment, then open the bundled Wokwi uno-blink project. Inspect its actual blink timing and build output.

Reference check:

Model boundary:

Independent task and submission evidence

2. Select Arduino Uno, successful compile/upload, and three blink cycles. Play GPIO13 LED transitions. Record the named input, prediction, actual output and one limitation; restore the original condition and repeat.

Before execution write the independent variable and its levels, dependent observation with units where applicable, baseline, controlled variables, measurement method and expected result. For a state machine use state/event/output rather than inventing a numeric metric. Record failures and repeat the baseline. A weak conclusion is “it works”; a supported conclusion names the changed setting, observed value/state, corresponding rule and one limitation.

TrialChanged settingFixed settingsPredicted resultActual observation / unitsEvidence / uncertainty
A: baselineReferenceRecordPredictRecordRecord
B: one changeRecordSame as APredictRecordRecord
A: repeatRestoreSame as APredictRecordRecord

Completion: submit the filled table, relevant simulator screenshot or terminal/notebook output, reasoning with units/assumptions, and one limitation. Preserve the independent assessment questions; this guide does not fill their answers.

Worked engineering reasoning and boundary conditions

Engineering reference configuration: Board inspection runtime = WSL2; Wokwi board target = Arduino Uno; Build succeeds = true; Firmware transfer succeeds = true; Blink cycles = 3. In the classroom model, Compiled = Yes; Uploaded = Yes; Blink observed = Yes; Blink cycles = 3. Toolchain readiness and LED transitions are modeled. Physical board inspection is a separate practical. A closed, deterministic browser model. The existing practical instructions and source files provide independent execution; browser results are not hardware measurements.

Use the diagram to follow the calculation or state progression. Keep the teaching configuration separate from the independent exercise values; compare observations with the actual model and implementation.

Concept animation · independent state notebook

Explore the teaching example independently of the simulator. Each step reveals an operation, data relationship or calculated state. The Simulation view has separate editable inputs.

Lab 1 · Board architecture & setup: independent state notebook124567910Calculated state 1PhaseBoard inspectionObservationWSL2

Step 1 of 8 · Calculated state 1

Calculated state 1

Phase
Board inspection
Observation
WSL2

Teaching example only; inspect live calculations or real practical evidence separately.

Recall the concept before revealing its explanation.

0 / 3 revealed
X1 · 01 / 08What is a virtual board?Reveal explanation
Engineering explanation

Wokwi executes compiled MCU firmware; Ubuntu WSL is a separate Linux environment.

X1 · 02 / 08What proves firmware execution?Reveal explanation
Engineering explanation

A successful build and observed onboard LED changes in the simulator.

X1 · 03 / 08Which virtual board execution observations should be established first?Reveal explanation
Engineering explanation

Use local Windows VS Code with PlatformIO and Wokwi extensions; build before starting and stop simulator afterward.

X1 · 04 / 08Why distinguish compiling from uploading?Reveal explanation
Engineering reasoning

Compilation checks source/toolchain compatibility; upload requires a connected target and does not guarantee correct hardware behavior.

X1 · 05 / 08What does Arduino setup() versus loop() mean?Reveal explanation
Engineering reasoning

setup runs once after startup; loop repeats while the program runs.

X1 · 06 / 08An Arduino blink sketch is built. Select every technically valid statement. A. Check the board target and pin mapping. B. Compile success and physical LED behavior are separate checks. C. A compiled sketch proves the wiring is correct. D. All Arduino boards have the same pin functions.Reveal explanation
Applied scenario

Correct: A. Check the board target and pin mapping.; B. Compile success and physical LED behavior are separate checks.

X1 · 07 / 08In Board architecture & setup, which command or code executes Open the Wokwi project in a separate Windows VS Code window?Reveal explanation
Implementation recall

psut-wsl/wokwi/uno-blink

X1 · 08 / 08For Board architecture & setup, which actual output or state confirms the prescribed practical run succeeded, and what does it not establish?Reveal explanation
Evidence & acceptance

Ubuntu board check normally reports Not detected as Raspberry Pi. That is expected in WSL. For actual Uno LED demo open uno-blink in Windows VS Code, build PlatformIO, start Wokwi and observe repeated built-in LED transitions. Do not interpret the board-check result as a failed setup.

Build and validate this circuit in Circuit Studio →

Execution boundary · Real setup + board check. Browser simulation below is a teaching model, not execution of Python or firmware. The real commands run in VS Code/WSL; Wokwi is used for Arduino/ESP32 where indicated.
Arduino and Raspberry Pi. Microcontroller and Linux-board roles.
Arduino and Raspberry Pi. Microcontroller and Linux-board roles.
Shared research workbenches · network designer & advanced studies
Concurrent-device simulation & Monte Carlo research
Distributed digital twin · topology, protocol & battery research
Loading experiment-specific apparatus…
Previous model / additional reference tools
Simulation task

Build and inspect Arduino LED blinking.

Explore the model using its own controls. Record a prediction before changing a condition. Compare the reference with a changed condition, then use the Experiment tab for the procedure, acceptance criteria and notebook. Model outputs and physical observations must remain separate.

Interactive engineering workbenchX1 · Existing model
01 / Explore

Interactive lab simulation

Browser model

Pin and connection reference

WSL uses simulated GPIO. These are source-derived signal mappings; physical connection notes are guidance, not a claim of physical testing.

ComponentSignal / pinConnection notesSource
Arduino onboard LEDD13Board-only Wokwi circuitwokwi/uno-blink/diagram.json
X1 · Model-linked instrumentation

Visual observation lens

Back to controls ↑

Original virtual instrument; model signals and execution trace.

Loading instrument…

Awaiting model display.

Experimental instrumentation · A/B

Compare two model conditions

Capture a baseline, change one experimental condition, run the model if required and capture the comparison. Snapshots contain visible controls and display text, not physical sensor readings. Review before exporting.

Open simulation view
Baseline A
Not captured
Comparison B
Not captured

Capture a baseline to begin.

Evidence portfolio →
V19.0 · Contextual AI workspace

Ask your engineering assistants

X1 · current context

Ask Dr. Mohammad locally, or prepare an experiment-aware prompt for ChatGPT, Gemini or Claude. The external providers open in their own tabs; nothing is automatically submitted.

Dr. Mohammad · offline
Dr. Mohammad

Offline curriculum-grounded assistance.

Open local tutor
Lab 1 · Board architecture & setup

Public course objective, displayed commands, source excerpts and procedure. Private assessment content is not collected.

Prepare a contextual AI prompt

0 characters

Common secret and email patterns are redacted on preparation; this is not a comprehensive privacy filter. Review the entire editable prompt, including student work and unpublished research, before sharing. The providers apply their own accounts, privacy settings and limits.

Prepare → review → copy & open your selected provider → paste and submit there.

Run & verify — acceptance checklist

Build verification: Actual board-check program executed; Wokwi firmware pending.

Ubuntu board check normally reports Not detected as Raspberry Pi. That is expected in WSL. For actual Uno LED demo open uno-blink in Windows VS Code, build PlatformIO, start Wokwi and observe repeated built-in LED transitions. Do not interpret the board-check result as a failed setup.

Record the actual output, source (mock/model or physical), and any error. A missing tool, timeout or untested external service is not a pass.

Complete lab-by-lab verification report →Open automated verification center → Ask Engineering Copilot →

Independent theoretical exercises

Before the simulation or practical, solve both experiment-specific tasks. List the given inputs, show the intermediate calculation or state trace, identify the expected observation, and state a limitation. Show formulas and intermediate calculations where relevant, or draw the requested state/sequence diagram. These are independent classroom fixtures; where they differ from the reference configuration below, do not treat them as measured values. Compare your predictions with the corresponding experiment afterwards.

01 · Predict and derive using the given inputs

For a blink program with 1000 ms HIGH and 1000 ms LOW, calculate period, duty and elapsed time for three cycles.

02 · Compare or justify using evidence

Draw build→upload→execution and explain how a successful compilation differs from an observed LED transition.

03 · Troubleshooting

Troubleshooting · Independent work

A sketch compiles for Uno but the connected board is an ESP32. Explain why successful compilation does not establish successful upload or safe pin mapping.

Work is saved locally when browser storage is available. Export it for submission; no remote upload or automatic grade is assigned.

Expanded independent theoretical exercise bank

Progress from calculation and interpretation to diagnosis and controlled engineering design. Complete the questions without opening the simulation first; show intermediate steps.

Intermediate · Explain a changed-input result

Independent theoretical exercise · X1-01

Use the reference configuration (Board inspection runtime = WSL2; Wokwi board target = Arduino Uno; Build succeeds = true; Firmware transfer succeeds = true; Blink cycles = 3), but change Build succeeds = false. The model reports Compiled = No. Explain the governing rule and assumptions that make this output plausible; identify an independent verification method.

Intermediate · Interpret a state transition

Independent theoretical exercise · X1-02

The reference model reports Compiled: Yes. Under Build succeeds = false it reports No. Explain which configured condition changed and what the two outputs establish, and what they do not establish.

Intermediate · Interpret a technical trace

Independent theoretical exercise · X1-03

For Blink cycles = 5, the model supplies this excerpt from Board and blink events: Phase · Observation Board inspection · WSL2 Target · Arduino Uno Compile · Yes Upload · Yes GPIO13 HIGH · LED ON Count rows whose Observation value is exactly “Yes”, and identify the displayed row numbers. Explain what the count describes.

Advanced · Reverse reasoning

Independent theoretical exercise · X1-04

An observation is Blink cycles = 5. Candidate A uses Board inspection runtime = WSL2; Wokwi board target = Arduino Uno; Build succeeds = true; Firmware transfer succeeds = true; Blink cycles = 3. Candidate B changes the listed settings (Blink cycles = 5) and keeps the remaining settings fixed. Which is consistent with the observation? If both can explain it, say what additional evidence is required.

Advanced · Diagnose a reported mismatch

Independent theoretical exercise · X1-05

A student configures Wokwi board target = ESP32 while preserving all other reference settings, but copies the reference report of Compiled = Yes. Evaluate whether the report is justified. Identify the first configuration/output check to perform.

Challenging · Design a controlled verification

Independent theoretical exercise · X1-06

Design a controlled comparison for Lab 1 · Board architecture & setup using reference Board inspection runtime = WSL2; Wokwi board target = Arduino Uno; Build succeeds = true; Firmware transfer succeeds = true; Blink cycles = 3 and test Build succeeds = false. Specify the changed setting(s), measured metric Compiled, controls, repetitions, an acceptance check and what evidence can distinguish an actual implementation from the model.

Step-by-step experimental procedure

Distinguish WSL board inspection from Arduino Uno compilation and observe the on-board LED sequence.

1 · Reference workbench configuration

Use the named reference workbench and its reference inputs. Additional live instruments may have different controls; use the matching instrument. Record virtual and practical results separately.

Board inspection runtimeWSL2
Wokwi board targetArduino Uno
Build succeedsYes
Firmware transfer succeedsYes
Blink cycles3

2 · Perform the investigation in order

  1. Run the WSL board inspector; do not treat mock hardware identity as a physical Raspberry Pi measurement.
  2. Select Arduino Uno, successful compile/upload, and three blink cycles. Play GPIO13 LED transitions.
  3. Change the target to ESP32. Explain why an Uno project does not establish correct ESP32 board configuration.
  4. Run python -m labs.exp01.board_check in the activated WSL environment, then open the bundled Wokwi uno-blink project. Inspect its actual blink timing and build output.

3 · Compare controlled trials

TrialIndependent changeExpected checkObservation
ReferenceUse reference inputs aboveBlink observed: Yes; Blink cycles: 3Record actual result
Wrong boardWokwi board target = ESP32Blink observed: NoRecord actual result
Upload failedFirmware transfer succeeds = NoBlink observed: NoRecord actual result

4 · Analyze and report

The two tasks use different devices. The browser does not compile firmware.

Required evidence: Record the named metrics and trace for the reference and changed cases, then attach the corresponding practical command output or device evidence if available.

Model boundary: A closed, deterministic browser model. The existing practical instructions and source files provide independent execution; browser results are not hardware measurements.

Controlled investigation · reproducible evidence

Method. Use the existing reference workbench configuration and the named controlled changes below. A controlled variable stays fixed while the independent variable is intentionally changed; the dependent variable is the resulting observed output. First predict each trial from the Concepts page. Run the baseline, then change only the specified setting and record the outcome. For deterministic traces one execution per case and a repeated verification are sufficient; for timing or stochastic measurements repeat at least five times, recording each run, median and range. Reset to the reference state between independent comparisons.

TrialIndependent changeDependent observation
ReferenceUse reference inputs aboveRecord actual outcome and units
Wrong boardWokwi board target = ESP32Record actual outcome and units
Upload failedFirmware transfer succeeds = NoRecord actual outcome and units

Evidence: attach the completed comparison table, one trace or screenshot per condition, and actual practical terminal/hardware evidence where applicable. Explain any prediction mismatch and distinguish modeled behavior from measured results.

Loading laboratory-specific procedure…

Python / Google Colab notebook

Bounded notebook reference exercise; original device/service commands are reference-only. Validated locally in a fresh Jupyter kernel. Download, then upload to Google Colab.

Download NotebookOpen Google ColabAll Python notebooks

Independent implementation sequence

  1. Check the Linux board environment
  2. Open the Wokwi project in a separate Windows VS Code window
  3. Build and start the simulator
  4. Observe the LED
02 / Implement

Step-by-step instructions

Before you run / verification gate

Use local Windows VS Code with PlatformIO and Wokwi extensions; build before starting and stop simulator afterward.

Complete one-time setup first. Copy one command block at a time into the indicated environment. Do not copy prompt characters. Open new terminals where named; variables are terminal-specific. Ctrl+C stops a running foreground command.

01

Check the Linux board environment

This checks the actual WSL computer.

WSL · Bash
source ~/psut-wsl/activate.sh
cd ~/psut-wsl/labs/pi-practical
python -m labs.exp01.board_check
✓ Expected: Board information; not a physical Raspberry Pi.
Expected result for each action (3)
  1. source ~/psut-wsl/activate.shThe toolkit virtual environment is selected in this terminal, usually with (.venv) in the prompt. Verify which python points into ~/psut-wsl/.venv.
  2. cd ~/psut-wsl/labs/pi-practicalNormally no output. pwd should show the requested directory. A missing path produces an error; do not continue until corrected.
  3. python -m labs.exp01.board_checkBoard information; not a physical Raspberry Pi.
Checkpoint Board information; not a physical Raspberry Pi.
02

Open the Wokwi project in a separate Windows VS Code window

Use File → Open Folder in a local Windows window, not a Remote WSL window. Open the project folder listed below (inside the extracted website). Install PlatformIO IDE and Wokwi Simulator extensions. Activate Wokwi if prompted.

Folder path · Windows Explorer
psut-wsl/wokwi/uno-blink
✓ Expected: Open this folder in Windows VS Code; platformio.ini, wokwi.toml, diagram.json and src/main.cpp should be present. This is a path, not a shell command.
Checkpoint The project root contains platformio.ini, wokwi.toml, diagram.json and src/main.cpp.
03

Build and start the simulator

Use PlatformIO: Build (checkmark in the status bar). Then press Ctrl+Shift+P → Wokwi: Start Simulator. Keep the simulator visible. Wokwi does not compile the firmware.

Checkpoint Build SUCCESS; the virtual board is visible.
04

Observe the LED

The built-in LED is on for one second and off for two seconds. Stop the Wokwi simulation when finished.

Checkpoint Complete the action before continuing.

Experimental notebook

Record your own results. Values are not prefilled or independently verified.

03 / Inspect

Source code and method

labs/pi-practical/labs/exp01/arduino_blink/arduino_blink.inoDownload source
INO · source file
// ------------------------------------------------------------
// Copyright © 2026/2027 Dr. Mohammad Alja'afreh. All rights reserved.
// PSUT IoT Engineering Learning Platform
// ------------------------------------------------------------
// Arduino Uno: demonstrate digital output using the built-in LED.
// ====================================================================
// 01 / CONFIGURE THE BUILT-IN LED
// ====================================================================
void setup() {
  pinMode(LED_BUILTIN, OUTPUT); // Set LED pin as output.
}
// ====================================================================
// 02 / REPEAT THE THREE-SECOND BLINK CYCLE
// ====================================================================
void loop() {
  digitalWrite(LED_BUILTIN, HIGH); // Turn LED on.
  delay(1000);                    // Wait one second.
  digitalWrite(LED_BUILTIN, LOW);  // Turn LED off.
  delay(2000);                    // Wait two seconds.
}
labs/pi-practical/labs/exp01/board_check.pyDownload source
PY · source file
# ------------------------------------------------------------
# Copyright © 2026/2027 Dr. Mohammad Alja'afreh. All rights reserved.
# PSUT IoT Engineering Learning Platform
# ------------------------------------------------------------
# ====================================================================
# LAB PURPOSE / BOARD CHECK
# ====================================================================
"""Read board identification from Linux; works without GPIO access."""

# ====================================================================
# 01 / IMPORT REQUIRED LIBRARIES
# ====================================================================
from pathlib import Path
import platform
import shutil

# ====================================================================
# 02 / INSPECT THE HOST SYSTEM
# ====================================================================
def main():
    # Linux exposes the board model through the device tree.
    p = Path('/proc/device-tree/model')
    # Read the model if available; otherwise report that it is not detected.
    print('Board:', p.read_bytes().rstrip(b'\0').decode() if p.exists() else 'Not detected as Raspberry Pi')
    # Report the operating system and kernel platform.
    print('OS:', platform.platform())
    # Show the Python interpreter version used by this program.
    print('Python:', platform.python_version())
    # Locate the optional GPIO Zero pinout utility.
    print('GPIO pinout tool:', shutil.which('pinout') or 'Install python3-gpiozero')

# ====================================================================
# PROGRAM ENTRY POINT / RUN THE EXPERIMENT
# ====================================================================
if __name__ == '__main__':
    main()
wokwi/uno-blink/diagram.jsonDownload source
JSON · source file
{
  "version": 1,
  "author": "PSUT IoT Learning Studio",
  "editor": "wokwi",
  "parts": [
    {
      "type": "wokwi-arduino-uno",
      "id": "board",
      "top": 0,
      "left": 0,
      "attrs": {}
    }
  ],
  "connections": []
}
wokwi/uno-blink/platformio.iniDownload source
INI · source file
[env:uno]
platform = atmelavr
board = uno
framework = arduino
monitor_speed = 9600
wokwi/uno-blink/src/main.cppDownload source
CPP · source file
#include <Arduino.h>
// ------------------------------------------------------------
// Copyright © 2026/2027 Dr. Mohammad Alja'afreh. All rights reserved.
// PSUT IoT Engineering Learning Platform
// ------------------------------------------------------------
// Arduino Uno: demonstrate digital output using the built-in LED.
// ====================================================================
// 01 / CONFIGURE THE BUILT-IN LED
// ====================================================================
void setup() {
  pinMode(LED_BUILTIN, OUTPUT); // Set LED pin as output.
}
// ====================================================================
// 02 / REPEAT THE THREE-SECOND BLINK CYCLE
// ====================================================================
void loop() {
  digitalWrite(LED_BUILTIN, HIGH); // Turn LED on.
  delay(1000);                    // Wait one second.
  digitalWrite(LED_BUILTIN, LOW);  // Turn LED off.
  delay(2000);                    // Wait two seconds.
}
wokwi/uno-blink/wokwi.tomlDownload source
TOML · source file
[wokwi]
version = 1
firmware = ".pio/build/uno/firmware.hex"
elf = ".pio/build/uno/firmware.elf"
04 / Verify

Evidence of completion

Save the actual terminal output from the checkpoints above. For simulated inputs explicitly record browser model, fakepi, mock or Wokwi. Never present those data as physical measurements. If a checkpoint fails, see the troubleshooting guide.

Python / Google Colab laboratory

X1 · 9 notebook cells · 2 executable Python cells

Complete the theoretical investigation first. Run the cells in order, record actual outputs and compare against your prediction.

How to execute

  1. Download this notebook and open Google Colab. Select File → Upload notebook and choose the downloaded .ipynb.
  2. Read the Markdown instructions before each executable cell. Use a Python runtime, run cells from top to bottom, and resolve imports if necessary.
  3. Perform the baseline and controlled changes. Save the notebook with actual outputs and your written interpretation.

Execution scope: Default computational cells passed isolated local Python execution; physical equipment and live services require separate verification.

01Instructions · Markdown
# x1 · Lab 1 · Board architecture & setup **PSUT IoT Engineering Studio — Dr. Mohammad Alja’afreh** ## Introduction Build and inspect Arduino LED blinking. ## How to run 1. Download this notebook from the laboratory page. Open Google Colab → File → Upload notebook. 2. Select a Python CPU runtime. Run cells from top to bottom using Shift+Enter, or Runtime → Run all. 3. Read the printed observations and assertions. Change one parameter at a time and rerun the relevant cell. 4. Save your own outputs and compare them to the portal Experiment tab. **Execution boundary:** Bounded notebook reference exercise; original device/service commands are reference-only. Do not run the hardware or service commands in Colab. No real credentials are needed. The notebook is self-contained.
02Instructions · Markdown
## Experiment-specific preparation Build and inspect Arduino LED blinking. **Reference procedure (use the matching simulator/WSL tool where named, not an unrelated service):** 1. Run the WSL board inspector; do not treat mock hardware identity as a physical Raspberry Pi measurement. 2. Select Arduino Uno, successful compile/upload, and three blink cycles. Play GPIO13 LED transitions. 3. Change the target to ESP32. Explain why an Uno project does not establish correct ESP32 board configuration. 4. Run python -m labs.exp01.board_check in the activated WSL environment, then open the bundled Wokwi uno-blink project. Inspect its actual blink timing and build output. **Evidence:** **Boundary:**
03Instructions · Markdown
## 1. Objectives and reference condition - Reproduce the specific computational mechanism in this laboratory. - Inspect the output, compare the reference condition with a changed or rejected condition where implemented, and explain any discrepancy. - Distinguish actual local Python execution from mock, physical and external-service observations. ## 2. Environment check
04Python · executable cell
PYTHON · Code cell
# =====================================================================
# X1 | Code cell 01 | Lab 1 · Board architecture & setup
# Purpose: 1. Objectives and reference condition - Reproduce the specific computational mechanism in this laboratory. - Inspect the output, compare the reference condition with a changed or rejected condition where implem
# Inputs: the explicit fixture/settings below and any preceding cell state.
# Output: inspect printed values, returned records or assertions; record evidence.
# =====================================================================
import sys
print("Python",sys.version.split()[0])
# Check the expected invariant so a mismatch fails visibly instead of appearing successful.
assert sys.version_info >= (3,10)
Ask Dr. Mohammad about this cell
05Instructions · Markdown
## 3. Implementation Read the comments and variable definitions before execution. Assertions must pass; inspect values, not just completion.
06Python · executable cell
PYTHON · Code cell
# =====================================================================
# X1 | Code cell 02 | Lab 1 · Board architecture & setup
# Purpose: 3. Implementation Read the comments and variable definitions before execution. Assertions must pass; inspect values, not just completion.
# Inputs: the explicit fixture/settings below and any preceding cell state.
# Output: inspect printed values, returned records or assertions; record evidence.
# =====================================================================
import platform,sys
print('Host architecture:',platform.machine(),'Python:',sys.version.split()[0])
print('BCM17 maps to physical pin 11; this notebook cannot detect a Pi header.')
# Check the expected invariant so a mismatch fails visibly instead of appearing successful.
assert sys.version_info >= (3,10)
Ask Dr. Mohammad about this cell
07Instructions · Markdown
## Original portal implementation (reference only) These are the actual laboratory snippets. They are retained for comparison; follow the portal setup for WSL, hardware or services. They are **not** executed by Run all. ```bash source ~/psut-wsl/activate.sh cd ~/psut-wsl/labs/pi-practical python -m labs.exp01.board_check ``` ```python # ------------------------------------------------------------ # Copyright © 2026/2027 Dr. Mohammad Alja'afreh. All rights reserved. # PSUT IoT Engineering Learning Platform # ------------------------------------------------------------ # ==================================================================== # LAB PURPOSE / BOARD CHECK # ==================================================================== """Read board identification from Linux; works without GPIO access.""" # ==================================================================== # 01 / IMPORT REQUIRED LIBRARIES # ==================================================================== from pathlib import Path import platform import shutil # ==================================================================== # 02 / INSPECT THE HOST SYSTEM # ==================================================================== def main(): # Linux exposes the board model through the device tree. p = Path('/proc/device-tree/model') # Read the model if available; otherwise report that it is not detected. print('Board:', p.read_bytes().rstrip(b'\0').decode() if p.exists() else 'Not detected as Raspberry Pi') # Report the operating system and kernel platform. print('OS:', platform.platform()) # Show the Python interpreter version used by this program. print('Python:', platform.python_version()) # Locate the optional GPIO Zero pinout utility. print('GPIO pinout tool:', shutil.which('pinout') or 'Install python3-gpiozero') # ==================================================================== # PROGRAM ENTRY POINT / RUN THE EXPERIMENT # ==================================================================== if __name__ == '__main__': main() ```
08Instructions · Markdown
## 4. Results and analysis Record the actual output and whether the assertions pass. Identify a parameter to vary, state your prediction, repeat the reference calculation, then explain the changed result. | Trial | Configuration | Observation | Interpretation | |---|---|---|---| | A | Reference | | | | B | One controlled change | | | | C | Reference repeat | | | **Limitations:** Bounded notebook reference exercise; original device/service commands are reference-only. Notebook success does not certify external equipment or services.
09Instructions · Markdown
## Guided reasoning and evidence A controlled comparison changes one independent input while keeping the other relevant inputs fixed; the dependent variable is the recorded output. Use this lab’s reference condition above. **Independent task:** 2. Select Arduino Uno, successful compile/upload, and three blink cycles. Play GPIO13 LED transitions. Record the named input, prediction, actual output and one limitation; restore the original condition and repeat. | Trial | Input/configuration | Prediction | Observation | Evidence / limitation | |---|---|---|---|---| | A | Reference | | | | | B | Changed input | | | | | A repeat | Reference | | | | A conclusion is supported only when it cites the recorded values or observed states and explains them with the experiment theory.