← Back

SETUP GUIDE

GET YOUR ESP32 ALARM CLOCK CONNECTED IN 6 STEPS

1
Hardware

Core components (what the current firmware targets):

  • Seeed Studio XIAO ESP32-C3 (RISC-V, 160 MHz)
  • SSD1306 0.91" OLED, 128×32 (I2C, 0x3C)
  • DHT22 (AM2302) temperature / humidity sensor
  • SFM-20B active piezo buzzer
  • Momentary push button (wake / alarm-dismiss)
  • TTP223 touch pad (alarm-dismiss, optional)
  • USB-C cable for flashing

Pin wiring:

  • I2C: SDA → GPIO6, SCL → GPIO7 (all I2C devices share these two)
  • DHT22 → GPIO4  ·  Buzzer → GPIO3
  • Wake / dismiss button → GPIO5  ·  Alarm LED → GPIO9
▸ The board's silkscreen D-numbers do not match the GPIO numbers (D0=GPIO2, D1=GPIO3, D2=GPIO4, D3=GPIO5). Always wire by GPIO number. The device also works with no sensors at all — you still get live heap, CPU frequency, WiFi signal and uptime.
2
Create an account

Go to /signup and register with your email and a password. Then sign in at /login.

Each account is isolated — you only ever see data from your own devices.

3
Register your device

From the dashboard, scroll to the Devices section and click + Add Device. Give it a name (e.g. Bedroom ESP32).

A device token will be shown once in a modal. Copy it immediately — it cannot be retrieved again. You will paste it into config.h in the next step.

▸ The token is a 64-character hex string. The server stores only a SHA-256 hash of it — the raw token is never saved anywhere.
4
Configure & flash the firmware

Get the firmware source (the repository is private for this exam project — request access from the author). Open it in VS Code with PlatformIO.

Copy include/config.h.example to include/config.h and fill in your values:

// include/config.h #define WIFI_SSID "YourNetworkName" #define WIFI_PASSWORD "YourPassword" // Token copied from the dashboard in step 3 #define DEVICE_TOKEN "paste-your-64-char-token-here" #define SERVER_URL "https://alarm.hakon.codes/api/ingest"

config.h is gitignored — your credentials will never be committed.

Connect the ESP32 via USB-C, then click Upload in PlatformIO (or run pio run -t upload). The build will take a minute on first run.

▸ If you are on a university or corporate network, the ESP32 may be blocked from reaching the internet. Use a phone hotspot instead.
5
Verify the connection

Open the serial monitor at 115200 baud. You should see:

[WiFi] Connected. IP: 192.168.x.x [NTP] Time synced: 14:23:05 [Main] Time: 14:23:05 [Main] POST OK

POST OK every 60 seconds means the device is successfully sending data to the server.

Go to your dashboard — the status bar in the bottom right should turn green and show ESP32 connected. Heap usage, CPU frequency, uptime, and WiFi signal will appear within a few seconds.

▸ With the DHT22 wired, temperature and humidity appear right away in the cards.
6
Use your alarm clock

Alarm: the OLED shows the live time (synced over NTP). At the set time the buzzer rings and the screen shows ALARM; press the button or touch the TTP223 pad to dismiss it. The alarm also auto-silences after a configurable timeout.

Sleep tracking: on the dashboard, use the sleep toggle — tap Go to bed when you turn in and Good morning when you wake. It records your bed/wake times, sleep duration, and the average room temperature across the night, then lets you rate how you slept. Any stray row can be removed with the ✕ button.

Open Sleep Analytics to see duration, rating trends, and how temperature correlates with your sleep over time.

▸ Setting the alarm time from the dashboard and editing it on-device are milestones 6b / 6c — coming next.
View Demo Create Account