Skip to content

stefanbocane/Project-StoryBox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

StoryBox

A screen-free, AI-powered storytelling companion for children.
Tap a toy on the box. It tells a story. Every story is unique.

ESP32-S3 Python 3.11 C Firmware React 18 507 tests


How It Works

A child places their toy on the box. An NFC tag identifies which character it is. A cloud API generates an original story starring that character, narrates it with emotion-aware voice synthesis, and the built-in speaker brings it to life — all in seconds, no screen involved.

         ┌──────────┐
         │  Tap Toy  │
         └────┬─────┘
              │
              ▼
     ┌────────────────┐      ┌─────────────────┐      ┌──────────────┐
     │  NFC Identify   │ ──▶ │  Cloud Story API  │ ──▶ │  Voice Synth  │ ──▶ 🔊 Built-in Speaker
     │  "Who is this?" │      │  "Write a story"  │      │  "Narrate it"  │
     └────────────────┘      └─────────────────┘      └──────────────┘
                                      │
                                      ▼
                              ┌───────────────┐
                              │  LED Ring glows │
                              │  with emotions  │
                              └───────────────┘

Every story is generated fresh — no two are the same. Characters have their own personalities, voice styles, and catchphrases. The RGBW LED ring shifts colors to match the emotion of the narration, and glows warm white as a nightlight between stories.




Three Modes

Story

Default mode. Original adventures starring the child's toy characters. Interactive voice choices let the child steer the narrative at decision points.

Learning

Educational mode. Characters explore real-world topics grounded in parent-uploaded documents via retrieval-augmented generation.

Memory

Family mode. Personal family stories narrated with cloned family voices — a child can hear grandma tell a bedtime story, even from far away.




Features

Storytelling

  • AI-generated stories with emotion-aware narration (voice tone evolves across the story arc)
  • Interactive voice choices — children speak to steer the story at decision points
  • Multilingual support (29 languages)
  • Personalized — narrator addresses the child by name at key moments

Hardware (V1)

  • Custom ESP32-S3 device with built-in speaker, NFC reader, microphone, and RGBW LED ring
  • Single-board design — no Raspberry Pi, no Bluetooth pairing, no external speaker
  • ~5 inch cube enclosure: frosted acrylic glowing top, fabric sides, wood trim
  • Tap-to-story in seconds over WiFi
  • ~$25 BOM per unit at scale

Cloud API

  • Production-hardened FastAPI server (507 tests across 19 test files)
  • Multi-device architecture — each StoryBox gets its own scoped data
  • Device identity provisioned from MAC address, validated on every request
  • Analytics telemetry with session metrics, character popularity, and error tracking
  • Input validation, path traversal guards, prompt injection defense

Web Portal

  • React 18 + TypeScript management interface
  • QR code device pairing — scan the sticker on the box to connect
  • Multi-device family support with device switcher
  • Character management, RFID tag pairing, learning topics, memory stories, voice bank, transcript viewer, analytics dashboard

Voice

  • Cloud TTS with emotion mapping (Edge TTS for V1 pilot — $0/month)
  • Voice cloning — record a family member's voice, stories narrate in that voice
  • On-device voice activity detection via INMP441 MEMS microphone
  • Speech-to-text for interactive voice choices



Architecture

┌───────────────────────────┐
│   StoryBox Device (ESP32)  │
│                            │
│  NFC Reader ─── State      │
│  Microphone ─── Machine    │ ◄──── WiFi ────►  Cloud API (FastAPI)
│  Speaker ────── Audio      │                    ├── Story Engine (LLM)
│  LED Ring ───── Emotions   │                    ├── Voice Synthesis (TTS)
│                            │                    ├── Speech Recognition (STT)
└───────────────────────────┘                    ├── Analytics Telemetry
                                                  └── Device Management
         ┌──────────────┐
         │  Web Portal   │ ◄──── HTTPS ────► Cloud API
         │  (React 18)   │
         │  QR Pairing   │
         │  Management   │
         └──────────────┘

The ESP32 handles all hardware interaction and audio playback. The cloud API handles story generation, voice synthesis, and data management. The web portal lets parents manage characters, content, and settings from their phone. Each device is scoped by a unique ID derived from its MAC address.




Hardware (V1)

Component Purpose
ESP32-S3-WROOM-1 (8MB PSRAM) Main compute — WiFi, NFC, audio, LEDs, mic
MFRC522 NFC reader (SPI) Identifies toys via NTAG215 NFC stickers
MAX98357A I2S amplifier Drives built-in 2.5" Dayton Audio speaker
SK6812 RGBW LED ring Emotion-synced colors + warm white nightlight
INMP441 MEMS microphone Voice input for interactive choices
Custom PCB (KiCad, JLCPCB) Single 80x80mm board, all components integrated

Total hardware cost: ~$55 (breadboard) / ~$25 per unit at PCB scale.




Current Status

Won 3rd place at SCU Ciocca Center pitchathon with $600 seed funding. Originally built as a Raspberry Pi prototype in 48 hours, now being developed into a standalone hardware product.

V1 progress:

  • Cloud API — complete, production-hardened (507 tests, 9 audit passes including multi-agent swarms)
  • ESP32 firmware — complete, all 7 states verified, device ID provisioning, NULL/volatile hardened
  • Web portal — complete, production rewrite with device pairing and analytics
  • Hardware — entering breadboard validation phase, components ordered
  • Target: pilot deployment at a daycare

Unit economics: $0.004 per story ($12/month at 100 stories/day). Hardware ~$25/unit at scale.




Why This Exists

What if a child's toys could tell them stories? Not pre-recorded, not from a screen — genuinely new stories, generated in real time, narrated with character and emotion. A box that feels like magic.

StoryBox started as a hackathon idea and is becoming a real product. The source code is in a private repository — this page exists to share what we're building.



Built by Stefan Bocanegra

About

A screen-free, AI-powered storytelling companion — custom ESP32-S3 hardware that turns toys into story characters. Won 3rd at Hack for Humanity.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors