IoT / Beginner

Make a room-sensor journal

Turn repeated measurements into a simple, useful record of your environment.

BeginnerBuild time: 1–1.5 HoursStarter Kit Component
Sign in to save1–2 hours
Make a room-sensor journal

Let’s build.

You can complete the first version entirely offline. Do not collect personal information in a shared classroom.

Engineering Safety & Voltage Advisory

Sensor operates on 3.3V logic. Connecting data pin directly to 5V without pull-up may damage ESP32 ADC/GPIO pins.

Hardware Bill of Materials (BOM)

Component / ItemSpecification & RatingQtyProcurement
iSpark ESP32 Hardware KitNodeMCU 32-bit Wi-Fi/BLE controller1x
DHT22 High-Precision SensorTemperature: -40 to +80°C (±0.5°C) · Humidity: 0-100% RH1x
10 kΩ Pull-Up Resistor1/4 Watt · Resistor between VCC and Data pin1x
Breadboard & DuPont WiresSolderless 400-point breadboard with 3 jumper wires1x

Circuit Wiring & Pin-to-Pin Connection Matrix

Source TerminalDestination PinWire / LeadElectrical Function
ESP32 3.3V PinDHT22 Pin 1 (VCC)RedClean 3.3V regulated power rail
ESP32 GPIO 4 (D4)DHT22 Pin 2 (Data)Yellow1-Wire bidirectional digital telemetry data bus
ESP32 GND PinDHT22 Pin 4 (GND)BlackCommon reference ground connection

Step-by-Step Assembly & Verification Guide

  1. 01

    Choose one measurement such as temperature. Use a sensor supported by your controller and follow its wiring guide.

  2. 02

    Read the sensor locally and compare it with a reference where available. Record units and expected accuracy.

  3. 03

    Collect a reading at a consistent interval. Store the timestamp, device ID and value in a CSV file.

  4. 04

    Plot the readings and mark any missing values. Describe the conditions under which you collected the data.

  5. 05

    As an extension, send readings to your own authenticated endpoint. Keep credentials private and handle network failures.

Reference Firmware Sketch (CPP)

// iSpark IoT Lab: Precision Environmental Sensor Journal
// Sensor: DHT22 | Controller: ESP32 NodeMCU
#include "DHT.h"

#define DHTPIN 4
#define DHTTYPE DHT22

DHT dht(DHTPIN, DHTTYPE);

void setup() {
  Serial.begin(115200);
  Serial.println("[iSpark IoT] Environmental Journal Station starting...");
  dht.begin();
}

void loop() {
  delay(2000); // 2-second sampling interval

  float humidity = dht.readHumidity();
  float temperature = dht.readTemperature();

  if (isnan(humidity) || isnan(temperature)) {
    Serial.println("ERR: Failed to read from DHT22 sensor! Check wiring.");
    return;
  }

  // Format timestamped CSV output for logging
  Serial.printf("LOG,%lu,%.2f,%.2f,CELSIUS,PERCENT\n", millis(), temperature, humidity);
}

Stuck, or built something interesting?

Share your question, wiring notes or result with the community.

Open the discussion space →
Learn, check, apply.

An introductory learning resource, not an accredited qualification. Check the documentation for your exact hardware and work with appropriate supervision.

Drag to move. Arrow keys move the button; Home resets its position. Press Enter to open iSMART.

iSMART

Your learning companion

Checking connection…

What are you curious about?

I can help you understand a STEM concept, find a project or explore iSpark’s programmes.

Sign in to ask iSMART →

AI can make mistakes. Check the sources. Don’t share private information.