The UMPSA STEM Lab 2026 ESP32 MicroController IoT Programming Module delivers a progressive, hands-on learning pathway that transforms beginners into proficient IoT developers using the ESP32 / ESP32-S3 microcontroller and the Wokwi online simulator. Designed around a project-driven curriculum, the module transitions systematically from basic circuit dynamics to cloud-integrated smart systems.
The Learning Journey: From Single Bits to Cloud Integration

Phase 1: Fundamental Electronics & Sensing – LED Output Control (GPIO, Digital High/Low, Delay Timing) | | – Analog Sensing (LDR Photoresistors, 12-bit ADC, Thresholds)
Phase 2: Visual Displays, Proximity & Motion | | – I2C Visual Output (Adafruit SSD1306 OLED Display) | | – Acoustic Ranging (HC-SR04 Ultrasonic Sensor & pulseIn) | | – Human Input & Motion (Potentiometers, Buttons & Servos)
Phase 3: Connected IoT & Cloud Data Systems | | – Cloud Telemetry (Blynk IoT Dashboard & Virtual Pins) | | – Automated Data Logging (Google Sheets via Apps Script) |
Phase 1: Digital Fundamentals and Environmental Sensing
Learners begin by building digital output foundations using the ESP32 DevKit. The lesson introduces GPIO pin initialization, constant declaration (const int), setting output modes with pinMode(), and delivering 3.3V logic signals using digitalWrite(pin, HIGH). Current-limiting 220 Ω resistors ensure component protection.
Building on basic outputs, Activity 2 introduces time-domain control. Students learn to toggle states using digitalWrite(pin, LOW) paired with delay() calls in milliseconds. The core concept highlights how loop() endlessly executes sequence steps to form repeatable hardware timing patterns.
Transitioning from binary outputs to continuous input monitoring, learners connect a 4-pin LDR (Light Dependent Resistor) module to ADC1 pin GPIO34.
-
-
- 12-bit Resolution Unlike 10-bit Arduino boards (0–1023), the ESP32 processes analog values across a 0–4095 scale.
- Serial Communication Data is transmitted back to the host via
Serial.begin(115200)and monitored in real time usingSerial.println(). - Decision Boundaries Activity 4 establishes conditional logic (
if / else), using threshold values to trigger automated hardware responses based on ambient light changes.
-
Phase 2: User Interfaces, Acoustic Distance, and Precision Motion
Moving beyond simple LEDs, learners integrate a 0.96-inch SSD1306 OLED screen.
-
-
- I2C Protocol Communicates via two dedicated lines—SDA (GPIO21) and SCL (GPIO22)—at I2C address
0x3C. - Graphics Libraries Implements
Adafruit_SSD1306andWire.hto manage buffer clearing (display.clearDisplay()), cursor positioning (display.setCursor()), and screen updates (display.display()).
- I2C Protocol Communicates via two dedicated lines—SDA (GPIO21) and SCL (GPIO22)—at I2C address
-
Activity 6 introduces the HC-SR04 Ultrasonic Sensor for spatial awareness:
-
-
-
- Trigger and Echo High-frequency sonic bursts are initiated via a 10 µs pulse on the
TRIGpin (GPIO12) and timed via theECHOpin (GPIO14) usingpulseIn(). - Kinematic Conversion Distance in centimeters is calculated using sound velocity:
- $$\text{Distance (cm)} = \frac{\text{duration} \times 0.034}{2}$$
- Proximity Triggers Threshold logic compares measured distances against target limits (< 40 cm or < 100 cm) to activate visual warning indicators.
- Trigger and Echo High-frequency sonic bursts are initiated via a 10 µs pulse on the
-
-
Activities 7 and 8 unite analog and digital inputs to command physical motion:
-
-
- Dual Inputs: Combines an analog potentiometer knob (GPIO34) with a digital push button operating in
INPUT_PULLUPmode (active LOW logic on GPIO25). - Range Re-mapping: Uses
map(potValue, 0, 4095, 0, 180)to translate 12-bit raw readings into servo rotation angles. - Commanded Actuation: Incorporates the
ESP32Servolibrary (servo.write(angle)) to trigger precise motor positioning upon button press events.
- Dual Inputs: Combines an analog potentiometer knob (GPIO34) with a digital push button operating in
-
Phase 3: Cloud Telemetry, IoT Dashboards, and Data Logging
Activity 9 elevates physical projects to connected Internet of Things (IoT) applications. Leveraging Wokwi’s simulated Wi-Fi (Wokwi-GUEST), sensor data is streamed off-site:
-
-
- Blynk IoT Setup Configures Cloud Templates, Virtual Pins, and authentication tokens to display live readings on interactive web and mobile dashboards.
- Google Apps Script Bridge An HTTPS
doGet(e)web app script intercepts incoming URL parameters and appends time-stamped entries to a live Google Sheet spreadsheet:function doGet(e) { var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1"); if (!e || !e.parameter.distance) return ContentService.createTextOutput("No distance received"); var distance = parseFloat(e.parameter.distance); sheet.appendRow([new Date(), distance]); return ContentService.createTextOutput("OK"); }
-
The final module activity completes the IoT feedback loop by demonstrating bi-directional communication. Instead of just sending data to the cloud, learners use Blynk Dashboard widgets to transmit control signals back to the ESP32 hardware, toggling actuators and indicators over the internet from anywhere in the world.
Core Competencies Developed
| Curriculum Area | Concepts & Key Technologies |
|---|---|
| Microcontroller Basics | ESP32/ESP32-S3 pinouts, GPIO modes, internal pull-up resistors (INPUT_PULLUP) |
| Signal Types | Binary digital I/O, 12-bit Analog-to-Digital Conversion (ADC, 0–4095) |
| Communication Standards | Serial UART (115200 baud), I2C protocol (SDA/SCL)
|
| Sensors & Actuators | LDR Photoresistors, HC-SR04 Ultrasonic Sonar, Potentiometers, Servo Motors, SSD1306 OLEDs |
| Cloud & IoT Technologies | Wi-Fi simulation (Wokwi-GUEST), Blynk Cloud Dashboards, Google Apps Script REST APIs |