Build a Sci-Fi Glove That Talks to ChatGPT
Strap an OLED screen and ESP32 onto a glove, press a button, and ask it anything — a real wearable AI assistant glowing right on your wrist, like something out of a sci-fi movie. 🧤✨
What Are We Actually Building?
Imagine Tony Stark's glove — but one you build yourself, that actually answers questions using real AI. This project straps a tiny computer (ESP32), a glowing OLED screen, and a push button onto a glove. Press the button, speak or type your question through a connected app, and ChatGPT's answer scrolls across the screen on the back of your hand.
The glove will:
- Connect to WiFi using the ESP32's built-in radio
- Wait for you to press the wrist button to "wake up"
- Send your question to the OpenAI ChatGPT API over WiFi
- Display the AI's answer, scrolling smoothly across the OLED screen
- Light up fingertip LEDs in a "thinking" animation while it waits for a reply
It's a genuinely wearable computer — small, low-power, and entirely built and coded by you.
How the Glove Works
Every time you press the button and ask a question, your words travel through five stages before lighting up your wrist.
Press
Wrist button wakes the ESP32 and shows "Listening..." on the OLED.
›Send
You type your question into a simple phone web page hosted by the glove itself.
›Ask AI
ESP32 sends your question over WiFi to the OpenAI ChatGPT API.
›Think
Fingertip LEDs chase in sequence while the glove waits for a reply.
›Display
The answer scrolls smoothly across the OLED screen, letter by letter.
The Tech Behind the Glow
📟 SSD1306 OLED
A tiny 0.96" screen with no backlight needed — each pixel lights itself up, giving that crisp sci-fi glow even in daylight.
🧠 ESP32 Microcontroller
A postage-stamp-sized computer with built-in WiFi and Bluetooth — powerful enough to call cloud AI APIs directly.
🌐 Captive Web Server
The ESP32 hosts its own mini website. Your phone connects directly to the glove's WiFi — no app install needed!
💬 ChatGPT API
The same AI model behind ChatGPT, called directly from your glove's code using a simple HTTPS request.
Parts Checklist
All parts are common hobby electronics. Ask an adult to help with ordering.
ESP32 Dev Board (WROOM-32)
The brain — WiFi built in, small enough to mount on a wrist cuff.
0.96" SSD1306 OLED Display (I²C)
128×64 pixel monochrome screen — perfect for scrolling AI text.
Push Button (6mm tactile)
Mounted on the wrist cuff — press to wake the glove and ask a question.
5× WS2812B Addressable LEDs
One per fingertip. Individually controllable colour — perfect for a "thinking" chase animation.
3.7V LiPo Battery (500mAh) + Charging Module
Keeps the glove fully wireless and rechargeable via USB-C.
Slide Switch (power on/off)
Simple on/off control so the glove doesn't drain battery when not in use.
Thin Fabric Glove + Velcro Cuff
A snug-fitting glove (cotton or sports glove) as the base. Velcro cuff holds the electronics enclosure.
Conductive/Flexible Wire (30 AWG silicone)
Thin, flexible wire that can bend with the glove fabric without breaking.
Small Project Box / 3D Printed Cuff Case
Houses the ESP32 and battery on the wrist, keeping wiring protected and tidy.
OpenAI API Key
Sign up at platform.openai.com — free starting credits cover hundreds of glove questions.
Full Wiring Diagram
The OLED uses I²C (just 2 wires for data), the LEDs use a single data line with WS2812B's built-in protocol, and the button is a simple digital input.
All 5 WS2812B LEDs share one data wire (GPIO13) — each LED has its own tiny chip that passes the signal to the next one in the chain. The push button uses a 10kΩ pull-down resistor so it reads LOW when not pressed and HIGH when pressed. Battery connects through the TP4056 module for safe charging via USB-C.
ESP32 & Library Setup
Install ESP32 Board Support in Arduino IDE
Open Arduino IDE → Preferences → paste this URL into "Additional Board Manager URLs":
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
Then go to Tools → Board → Board Manager, search "esp32", and install it.
Install Required Libraries
Open Library Manager (Tools → Manage Libraries) and install:
Adafruit GFX Library— text/graphics engine for the OLEDAdafruit SSD1306— driver for the OLED displayAdafruit NeoPixel— controls the WS2812B fingertip LEDsArduinoJson— parses the ChatGPT API's JSON response
Get Your OpenAI API Key
Ask a parent to sign up at platform.openai.com/api-keys and create a new secret key. Keep it safe — you'll paste it into the code in a moment.
Step-by-Step Build
Prepare the Glove
Lay the glove flat. Decide where the OLED will sit (back of hand) and where the 5 fingertip LEDs will go (one near each fingertip, just below the nail). Mark these spots lightly with chalk or fabric pen.
Sew or Glue Down the LEDs
Using fabric glue (or a few small stitches), attach each WS2812B LED at its marked fingertip spot, facing outward. Leave enough wire slack at each knuckle so the glove can still flex without snapping a connection.
Wire the LED Chain
Connect the LEDs in a daisy chain: Data-Out of LED 1 → Data-In of LED 2, and so on. Route the wires along the back of the hand toward the wrist cuff. Connect the first LED's Data-In to GPIO13, and all LEDs' power/ground to the shared rail.
Mount the OLED on the Hand
Secure the OLED display (screen facing up) on the back of the hand using a small fabric pocket, Velcro, or hot glue around its edges only (avoid the screen surface). Run its 4 wires (VCC, GND, SDA, SCL) toward the wrist.
Build the Wrist Cuff Electronics Box
- Mount the ESP32, LiPo battery, TP4056 charging module, and slide switch inside the project box or 3D printed case.
- Wire the push button on the outside of the cuff for easy thumb access.
- Connect all wires from the glove (OLED + LEDs) into the cuff box, following the circuit diagram.
- Strap the cuff box onto the wrist using Velcro.
Test Each Component Individually
Before combining everything, run small test sketches: blink the OLED with "Hello!", cycle the 5 LEDs through colours, and confirm the button reads HIGH when pressed in Serial Monitor. Catching problems here is much easier than after final assembly.
Full ESP32 Glove Code
This sketch connects to WiFi, hosts a simple web page for typing questions, calls ChatGPT, animates the fingertip LEDs while thinking, and scrolls the answer on the OLED.
/* Sci-Fi ChatGPT Glove — ESP32 + OLED + WS2812B Hosts a mini web page to type questions, calls ChatGPT, scrolls the answer on the OLED display. */ #include <WiFi.h> #include <HTTPClient.h> #include <WebServer.h> #include <ArduinoJson.h> #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #include <Adafruit_NeoPixel.h> // ── CONFIG ───────────────────────────────────────────────────── const char* WIFI_SSID = "YourWiFiName"; const char* WIFI_PASS = "YourWiFiPassword"; const char* OPENAI_KEY = "sk-YourOpenAIKeyHere"; #define BUTTON_PIN 5 #define LED_PIN 13 #define LED_COUNT 5 #define SCREEN_W 128 #define SCREEN_H 64 Adafruit_SSD1306 oled(SCREEN_W, SCREEN_H, &Wire, -1); Adafruit_NeoPixel leds(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800); WebServer server(80); String lastAnswer = "Press the button on your wrist to ask me something!"; bool isThinking = false; // ── OLED HELPERS ─────────────────────────────────────────────── void showMessage(String msg) { oled.clearDisplay(); oled.setTextSize(1); oled.setTextColor(SSD1306_WHITE); oled.setCursor(0, 0); oled.println(msg); oled.display(); } void scrollAnswer(String text) { // Simple word-wrapped scroll: redraw in chunks oled.clearDisplay(); oled.setTextSize(1); oled.setTextColor(SSD1306_WHITE); oled.setCursor(0, 0); oled.println("ChatGPT says:"); oled.println("-------------"); oled.print(text); oled.display(); } // ── LED "THINKING" ANIMATION ─────────────────────────────────── void thinkingChase() { static int pos = 0; leds.clear(); leds.setPixelColor(pos, leds.Color(120, 0, 200)); // violet leds.setPixelColor((pos + 1) % LED_COUNT, leds.Color(0, 180, 200)); // cyan trail leds.show(); pos = (pos + 1) % LED_COUNT; delay(120); } void ledsOff() { leds.clear(); leds.show(); } void ledsReady() { for (int i = 0; i < LED_COUNT; i++) leds.setPixelColor(i, leds.Color(0, 200, 120)); // green = ready leds.show(); } // ── CHATGPT API CALL ─────────────────────────────────────────── String askChatGPT(String question) { HTTPClient http; http.begin("https://api.openai.com/v1/chat/completions"); http.addHeader("Content-Type", "application/json"); http.addHeader("Authorization", String("Bearer ") + OPENAI_KEY); StaticJsonDocument<512> doc; doc["model"] = "gpt-4o-mini"; doc["max_tokens"] = 60; // keep replies short for the small screen JsonArray messages = doc.createNestedArray("messages"); JsonObject sys = messages.createNestedObject(); sys["role"] = "system"; sys["content"] = "You are a tiny wearable AI on a glove screen. Answer in one short sentence, under 15 words."; JsonObject usr = messages.createNestedObject(); usr["role"] = "user"; usr["content"] = question; String payload; serializeJson(doc, payload); int code = http.POST(payload); String answer = "Hmm, I couldn't connect. Check WiFi!"; if (code == 200) { String response = http.getString(); StaticJsonDocument<1024> resDoc; deserializeJson(resDoc, response); answer = resDoc["choices"][0]["message"]["content"].as<String>(); } http.end(); return answer; } // ── WEB PAGE (hosted directly on the glove!) ─────────────────── const char* PAGE = R"rawliteral( <html><body style="font-family:sans-serif;text-align:center;padding-top:40px;"> <h2>🧤 Sci-Fi Glove Assistant</h2> <form action="/ask"> <input name="q" placeholder="Ask me anything..." style="padding:10px;width:80%;font-size:16px;"> <br><br> <input type="submit" value="Ask ChatGPT" style="padding:10px 24px;font-size:16px;"> </form></body></html> )rawliteral"; void handleRoot() { server.send(200, "text/html", PAGE); } void handleAsk() { String question = server.arg("q"); server.send(200, "text/html", "<h3>Thinking... check the glove screen!</h3>"); isThinking = true; showMessage("Thinking..."); for (int i = 0; i < 10; i++) thinkingChase(); // ~1.2s of animation lastAnswer = askChatGPT(question); isThinking = false; ledsReady(); scrollAnswer(lastAnswer); } // ── SETUP ────────────────────────────────────────────────────── void setup() { Serial.begin(115200); pinMode(BUTTON_PIN, INPUT_PULLDOWN); Wire.begin(); oled.begin(SSD1306_SWITCHCAPVCC, 0x3C); leds.begin(); leds.setBrightness(80); ledsOff(); showMessage("Connecting WiFi..."); WiFi.begin(WIFI_SSID, WIFI_PASS); while (WiFi.status() != WL_CONNECTED) { delay(400); Serial.print("."); } showMessage("WiFi connected!\nOpen: " + WiFi.localIP().toString()); Serial.println(WiFi.localIP()); server.on("/", handleRoot); server.on("/ask", handleAsk); server.begin(); ledsReady(); delay(2000); scrollAnswer(lastAnswer); } // ── MAIN LOOP ────────────────────────────────────────────────── void loop() { server.handleClient(); // Wrist button shows the connection info again (handy reminder) if (digitalRead(BUTTON_PIN) == HIGH && !isThinking) { showMessage("Open this on your phone:\n" + WiFi.localIP().toString()); delay(1500); scrollAnswer(lastAnswer); } }
Your Glove's First Activation
Power On
Flip the wrist slide switch. The OLED should show "Connecting WiFi..." then your glove's local IP address once connected.
Open the Web Page
On your phone (connected to the same WiFi), open a browser and type in the IP address shown on the OLED. You should see "🧤 Sci-Fi Glove Assistant" with a text box.
Ask Your First Question
Type something like "What is the largest planet?" and tap "Ask ChatGPT." Watch the fingertip LEDs chase in a violet-to-cyan pattern while it thinks, then the answer should scroll across the OLED!
Try the Wrist Button
Press the wrist button anytime to redisplay the glove's WiFi address — handy if you reconnect or want to ask from a different phone.
🛑 Safety Rules
- Adult supervision required for all soldering, wiring, and especially LiPo battery handling.
- LiPo batteries can be dangerous if punctured, overcharged, or short-circuited. Always use a proper charging module (TP4056) and never charge unattended.
- Check polarity carefully before connecting the battery — reversed wiring can permanently damage the ESP32.
- Keep your OpenAI API key private — never share it or upload code containing it to a public website.
- Set a spending limit on your OpenAI account so API usage costs stay controlled.
- Test all electronics fully before sewing them permanently into the glove fabric.
- Avoid wearing the powered glove in water or very humid conditions — electronics and moisture don't mix.
Troubleshooting
The OLED stays blank.
Check the I²C address — most SSD1306 boards use 0x3C, but some use 0x3D. Also confirm SDA→GPIO21 and SCL→GPIO22 are correctly wired, and the OLED is getting 3.3V power.
The ESP32 won't connect to WiFi.
Double-check your WIFI_SSID and WIFI_PASS spelling in the code — they're case sensitive. ESP32 only supports 2.4GHz WiFi networks, not 5GHz, so make sure your router broadcasts a 2.4GHz band.
ChatGPT returns an authentication error.
Your API key may be incorrect or expired. Generate a new key at platform.openai.com/api-keys and make sure there are no extra spaces when you paste it into the code.
The fingertip LEDs don't light up.
WS2812B LEDs need correct data direction — Data-In must connect to GPIO13, not Data-Out. Also check the LED strip's power wire connects to 5V (not 3.3V) if your battery setup supports it; otherwise the colors may appear dim.
The text on the OLED is cut off or overlaps.
The screen is small (128×64 pixels) — keep the system prompt instruction "answer in one short sentence" in the code so ChatGPT's replies stay short enough to fit.
The glove takes a long time to respond.
This is usually WiFi signal strength. Try moving closer to your router, or reduce max_tokens in the code for faster (shorter) replies.
Fun Facts for Your Mission Log
The first wearable computer prototypes were built — decades before smartwatches existed.
The dual-core ESP32 processor speed — fast enough to handle WiFi, a web server, and animations all at once.
Typical power draw of an OLED screen — incredibly efficient since unused pixels stay completely off.
Colours possible from each WS2812B LED — your 5 fingertips can display millions of color combinations.
Level Up Your Glove
You just built a real wearable computer that connects to the internet and talks to AI — strapped right onto your hand. That's not science fiction anymore. That's something you made. 🧤✨

Comments
Post a Comment