Sci-fi gloves using esp32 and oled that acts like a chaat gpt companion

Sci-Fi ChatGPT Glove with OLED Display & ESP32 – Robotics Project for Kids
Wearable Tech · ESP32 · OLED · ChatGPT

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. 🧤✨

Medium Difficulty 1–2 Weekends Build Time Age 11+ With Adult Help ~₹1,500–₹2,200 Cost Arduino C++ Language
Start Building ↓
Mission Briefing

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.

🔑 You'll need a free OpenAI API key. Ask a parent to sign up at platform.openai.com — new accounts get free starting credits.
The Signal Path

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.

Shopping List

Parts Checklist

All parts are common hobby electronics. Ask an adult to help with ordering.

~₹450

ESP32 Dev Board (WROOM-32)

The brain — WiFi built in, small enough to mount on a wrist cuff.

~₹250

0.96" SSD1306 OLED Display (I²C)

128×64 pixel monochrome screen — perfect for scrolling AI text.

~₹40

Push Button (6mm tactile)

Mounted on the wrist cuff — press to wake the glove and ask a question.

~₹80

5× WS2812B Addressable LEDs

One per fingertip. Individually controllable colour — perfect for a "thinking" chase animation.

~₹150

3.7V LiPo Battery (500mAh) + Charging Module

Keeps the glove fully wireless and rechargeable via USB-C.

~₹100

Slide Switch (power on/off)

Simple on/off control so the glove doesn't drain battery when not in use.

~₹150

Thin Fabric Glove + Velcro Cuff

A snug-fitting glove (cotton or sports glove) as the base. Velcro cuff holds the electronics enclosure.

~₹100

Conductive/Flexible Wire (30 AWG silicone)

Thin, flexible wire that can bend with the glove fabric without breaking.

~₹100

Small Project Box / 3D Printed Cuff Case

Houses the ESP32 and battery on the wrist, keeping wiring protected and tidy.

Free

OpenAI API Key

Sign up at platform.openai.com — free starting credits cover hundreds of glove questions.

Circuit Diagram

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.

ESP32 Dev Board GPIO21 (SDA) GPIO22 (SCL) GPIO5 (Button) GPIO13 (LED data) 3V3 GND VIN (5V) OLED SSD1306 I²C Push Button 10kΩ pulldown to GND 5× WS2812B Fingertip LEDs 3.7V LiPo Battery + TP4056 charge module ON/OFF
I²C bus (SDA/SCL)
Button signal
LED data line
Power (+)
Ground (–)

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.

Software Setup

ESP32 & Library Setup

0A

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.

0B

Install Required Libraries

Open Library Manager (Tools → Manage Libraries) and install:

  • Adafruit GFX Library — text/graphics engine for the OLED
  • Adafruit SSD1306 — driver for the OLED display
  • Adafruit NeoPixel — controls the WS2812B fingertip LEDs
  • ArduinoJson — parses the ChatGPT API's JSON response
0C

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.

🔑 Set a spending limit on the OpenAI account (Settings → Billing → Usage limits) so costs stay controlled.
Assembly Log

Step-by-Step Build

1

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.

2

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.

🧵 Conductive thread is a great alternative to wire for connecting fingertip LEDs — it bends naturally with fabric.
3

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.

4

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.

5

Build the Wrist Cuff Electronics Box

  1. Mount the ESP32, LiPo battery, TP4056 charging module, and slide switch inside the project box or 3D printed case.
  2. Wire the push button on the outside of the cuff for easy thumb access.
  3. Connect all wires from the glove (OLED + LEDs) into the cuff box, following the circuit diagram.
  4. Strap the cuff box onto the wrist using Velcro.
⚠️ Double-check polarity on the LiPo battery connector before plugging in — reversed polarity can damage the battery and ESP32.
6

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.

Main Code

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);
  }
}
📲 How to use it: Power on the glove. It connects to your home WiFi and shows its IP address on screen. Open that IP address in your phone's browser, type a question, hit "Ask ChatGPT" — watch the fingertip LEDs chase while it thinks, then read the answer scroll across your wrist!
First Activation

Your Glove's First Activation

T1

Power On

Flip the wrist slide switch. The OLED should show "Connecting WiFi..." then your glove's local IP address once connected.

T2

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.

T3

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!

T4

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.
Debug Console

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.

Data Log

Fun Facts for Your Mission Log

1981

The first wearable computer prototypes were built — decades before smartwatches existed.

240MHz

The dual-core ESP32 processor speed — fast enough to handle WiFi, a web server, and animations all at once.

0.3W

Typical power draw of an OLED screen — incredibly efficient since unused pixels stay completely off.

16M+

Colours possible from each WS2812B LED — your 5 fingertips can display millions of color combinations.

What's Next?

Level Up Your Glove

LEVEL 2

Voice Input

Add a small INMP441 microphone module and use a speech-to-text API so you can speak your question instead of typing it.

LEVEL 2

Gesture Control

Add a flex sensor to one finger — bending it could trigger the "ask" action instead of a button press.

LEVEL 3

Haptic Feedback

Add a small vibration motor that buzzes once when the AI's answer is ready — useful when you're not looking at the screen.

LEVEL 3

Bluetooth Speaker Output

Pair the ESP32 with a Bluetooth speaker so the glove can read the answer out loud using text-to-speech.

LEVEL 4

Solar Charging

Add a small flexible solar panel on the back of the cuff to trickle-charge the LiPo battery during the day.

LEVEL 4

Custom Persona

Change the system prompt to make your glove answer as a specific character — a sci-fi AI companion with its own personality.

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. 🧤✨

Sci-Fi ChatGPT Glove with OLED Display — ESP32 Wearable Robotics Project for Kids 🧤

Tags: ESP32 glove · OLED display · ChatGPT wearable · sci-fi robotics · WS2812B LEDs · STEM project · wearable AI assistant

Comments

Product Cards
Buddy Bot eBook
⭐ New 2026 Release
Build Your
Own Robot!
3D design, wiring &
Arduino coding.
Young inventors love it!
🖨️
3D Print
All parts
Wire it
Circuit guide
💻
Code it
Arduino IDE
🤖
Watch it
Walk & react
📋 Your Details
Enter your name
Valid 10-digit no.
Enter a valid email
Special Website Offer
₹499 300
🌍 International: $5 USD
One-time · Instant digital delivery
🔒 Secured by Razorpay · Your data is safe
📄 Download Free Sample Copy
🔒 Secured by Razorpay · Your data is safe
🍓
Raspberry Pi Pico Mastery
21 Projects
⚡ Launch Price — 80% OFF
Learn Pico
Build 21 Projects!
MicroPython · Wokwi
IoT · Certificate
Perfect for beginners!
🖥️
Wokwi
No hardware
🐍
MicroPy
From zero
🔨
21 Projects
IoT + sensors
📄
Certificate
Verified cert
📋 Your Details
Enter your name
Valid 10-digit no.
Enter a valid email
Special Launch Offer
₹999 200 80% OFF
🌍 International: $5 USD
One-time · Lifetime access · No subscription
🔒 Secured by Razorpay · UPI · Cards · NetBanking
🎉

You're in!

Payment successful! Your Buddy Bot eBook is ready. Time to build!

📖 Access Your eBook Now
🎉

Enrolled!

Payment successful! Lifetime access to all 21 Pico Projects is yours!

🍓 Go to My Course