This project builds a smart display device called NEXUS using an ESP32 microcontroller, SSD1306 OLED screen, and capacitive touch sensor. The device displays customizable information and responds to touch gestures, with support for Bluetooth connectivity, web dashboard access, and local storage of settings.
The guide provides a complete parts list, wiring diagram showing connections between the ESP32, OLED display, and touch sensor, step-by-step assembly instructions, and the full firmware needed to bring the device to life. Builders will learn how to integrate multiple managers for display, touch input, timers, connectivity, and personality settings into a cohesive embedded system.
Wiring diagram

Gather all the parts
Assemble it in 2 steps
1. Connect the OLED with USB unplugged
Connect VCC to 3V3, GND to GND, SDA to GPIO21 (data), and SCL to GPIO22 (clock).
2. Connect the touch sensor
Connect VCC to 3V3, GND to GND, and SIG (sometimes marked OUT or I/O) to GPIO27. Use momentary, active-high mode.
- Do not use 5 V for the touch sensor; its output could damage the ESP32.
Review all connections
1. Connections between "oled" and "ESP32"
2. Connections between "touch" and "ESP32"
Deploy the firmware
#include <Arduino.h>
#include "NexusConfig.h"
#include "NexusState.h"
#include "StorageManager.h"
#include "DisplayManager.h"
#include "TouchManager.h"
#include "PersonalityManager.h"
#include "TimerManager.h"
#include "TimeManager.h"
#include "ConnectivityManager.h"
#include "WebDashboard.h"
#include "BluetoothManager.h"
NexusState nexus;
StorageManager storage;
DisplayManager displayManager;
TouchManager touchManager;
PersonalityManager personality;
TimerManager timers;
TimeManager timeManager;
ConnectivityManager connectivity;
WebDashboard dashboard;
BluetoothManager bluetooth;
void onGesture(TouchGesture gesture);
void onCommand(const String& command);
void setup() {
Serial.begin(115200);
delay(50);
storage.begin();
nexus.personality = storage.loadPersonality();
Serial.printf("NEXUS: %s rev %u, flash %lu bytes\n", ESP.getChipModel(),
unsigned(ESP.getChipRevision()), (unsigned long)ESP.getFlashChipSize());
if (!displayManager.begin()) {
Serial.println("NEXUS: OLED unavailable; check 3V3, GND, SDA GPIO21, SCL GPIO22");
}
// Show the saved personality before starting network services.
personality.automatic(nexus);
displayManager.update(nexus, millis());
timers.begin();
timeManager.begin();
connectivity.begin(storage.loadSSID(), storage.loadPassword());
dashboard.begin(connectivity);
Serial.println(bluetooth.begin(onCommand) ? "NEXUS: Bluetooth ready" : "NEXUS: Bluetooth unavailable");
touchManager.begin(onGesture);
nexus.lastEvent = "SYSTEM_READY";
Serial.println("NEXUS: SYSTEM_READY");
}
void loop() {
const uint32_t now = millis();
connectivity.update();
dashboard.update();
bluetooth.update();
touchManager.update();
if (timers.update()) personality.react(EXPR_HAPPY, "Timer finished", 6500);
timeManager.update();
const bool connected = connectivity.connected();
if (connected && !nexus.wifiConnected) personality.react(EXPR_SURPRISED, "Wi-Fi connected", 3000);
nexus.wifiConnected = connected;
personality.update(nexus, millis());
nexus.bluetoothReady = bluetooth.ready();
const String ip = connectivity.ipAddress();
if (ip != nexus.ipAddress) {
nexus.ipAddress = ip;
if (ip != "0.0.0.0") Serial.println("NEXUS dashboard: http://" + ip);
}
nexus.clockText = timeManager.clockText();
nexus.dateText = timeManager.dateText();
nexus.timerText = timers.displayText();
displayManager.update(nexus, now);
delay(1);
}
void onGesture(TouchGesture gesture) {
Serial.printf("NEXUS: Touch gesture %u\n", unsigned(gesture));
if (gesture == GESTURE_SINGLE) {
if (nexus.page == PAGE_FACE) {
if (nexus.expressionAuto) personality.react(EXPR_PLAYFUL, "Touch greeting", 3000);
else personality.nextExpression(nexus);
}
else if (nexus.page == PAGE_MENU) nexus.menuIndex = (nexus.menuIndex + 1) % MENU_COUNT;
else nexus.page = PAGE_MENU;
} else if (gesture == GESTURE_DOUBLE) {
if (nexus.page == PAGE_FACE) nexus.expressionAuto ? personality.nextExpression(nexus) : personality.automatic(nexus);
else if (nexus.page == PAGE_MENU) nexus.menuIndex = (nexus.menuIndex + MENU_COUNT - 1) % MENU_COUNT;
else if (nexus.page == PAGE_TIMER) timers.pauseResume();
} else if (gesture == GESTURE_LONG) {
if (nexus.page == PAGE_FACE) nexus.page = PAGE_MENU;
else if (nexus.page == PAGE_MENU) {
switch (nexus.menuIndex) {
case 0: nexus.page = PAGE_FACE; break;
case 1: nexus.page = PAGE_CONNECTIVITY; break;
case 2: nexus.page = PAGE_TIMER; break;
case 3:
nexus.personality = (PersonalityId)((nexus.personality + 1) % PERSONALITY_COUNT);
if (nexus.expressionAuto) personality.automatic(nexus);
storage.savePersonality(nexus.personality);
break;
case 4: nexus.page = PAGE_ABOUT; break;
case 5: nexus.page = PAGE_SETTINGS; break;
}
} else if (nexus.page == PAGE_TIMER) {
if (timers.idle()) timers.startPomodoro();
else timers.pauseResume();
} else nexus.page = PAGE_MENU;
}
}
void onCommand(const String& command) {
String c = command;
c.trim();
c.toUpperCase();
if (c == "HOME") nexus.page = PAGE_FACE;
else if (c == "MENU") nexus.page = PAGE_MENU;
else if (c == "POMODORO") timers.startPomodoro();
else if (c == "PAUSE") timers.pauseResume();
else if (c == "STOP") timers.stop();
else if (c == "AUTO" || c == "EXPR AUTO") personality.automatic(nexus);
else if (c.startsWith("EXPR ")) personality.setByName(nexus, c.substring(5));
else if (c.startsWith("PERSON ")) {
personality.setPersonality(nexus, c.substring(7));
storage.savePersonality(nexus.personality);
}
nexus.lastEvent = "COMMAND:" + c;
}Remix this project
Make it yours in one click
Open a full copy of this project in your own Schematik workspace, diagram, code, parts, and assembly steps included. Swap the sensor, add features, or redesign the whole thing with AI. The author's original stays untouched.




