Inspiration

We were inspired by the millions of students worldwide who lack access to personalized tutoring and quality educational resources. Traditional education often follows a one-size-fits-all approach, leaving struggling students behind and advanced learners unchallenged. We envisioned Luna as a solution: an affordable, voice-powered AI companion that adapts to each student's unique learning style and pace, making personalized education accessible to everyone, regardless of location or economic background.

What it does

Luna is an ESP32-S3-powered AI voice assistant designed specifically for education. Students simply press a button, ask a question, and receive instant, personalized tutoring across any subject. Luna features:

  • Adaptive AI Tutoring: Powered by GPT-4o, Luna explains concepts, answers homework questions, and provides step-by-step guidance tailored to each student's level
  • Animated Learning Companion: An expressive face on the display creates emotional engagement, especially crucial for younger learners who respond better to friendly, visual interaction
  • Three Learning Modes:
    • Face Mode: Interactive tutoring with an animated personality
    • Chat Mode: Review conversation history and see explanations in text bubbles
    • Dashboard Mode: Display time, weather, and study environment metrics
  • Multilingual Support: Works in 80+ languages, breaking down language barriers in education
  • Voice-First Design: No typing required—perfect for young children, students with disabilities, or those learning to read
  • Physical Learning Companion: Can be embedded in plush toys or custom housings, creating a tangible study buddy that builds emotional connection

Luna transforms from a patient math tutor in the morning to a language practice partner in the afternoon, simply by adjusting her personality prompt.

How we built it

Hardware Stack

  • ESP32-S3 microcontroller (brain of the system)
  • ST7789 240x280 TFT display (animated face)
  • INMP441 I2S microphone (voice input)
  • MAX98357A I2S amplifier + speaker (audio output)
  • NeoPixel RGB LED (visual feedback)
  • Custom 3D-printed enclosure
  • LiPo battery power system with voltage regulation

Software Architecture

We developed custom Arduino libraries from scratch:

  • ArduinoGPTChat: Handles OpenAI API integration for conversation, speech-to-text (Whisper), and text-to-speech
  • Luna Face Library: Custom animation engine with state-based expressions (idle, listening, thinking, speaking)
  • WeatherIcons: Bitmap library for environmental dashboard

Technical Implementation

  • Real-time I2S audio processing pipeline for recording and playback
  • Multi-threaded state machine managing UI modes and interaction flow
  • Efficient memory management (audio buffers, conversation history, display updates)
  • HTTP/REST API integration for GPT-4o, Whisper, TTS, and weather data
  • Custom response parsing for educational features

Educational Customization

const char* systemPrompt = "You are Luna, a patient and encouraging tutor. "
                          "Explain concepts clearly for middle school students. "
                          "Use examples and break down complex ideas into simple steps. "
                          "Maximum 30 words per response.";

Challenges we ran into

  1. Memory Constraints: The ESP32-S3 has limited RAM. Balancing audio buffers, display graphics, and conversation history required careful optimization—we implemented dynamic buffer allocation and partial screen updates.

  2. Audio Quality: Achieving clear voice recognition at 8kHz sample rate took extensive testing. We optimized microphone placement and implemented noise reduction techniques.

  3. Real-time Synchronization: Syncing the animated mouth movements with TTS audio playback required precise timing—we developed a frame-based animation system tied to audio stream status.

  4. API Latency: Network delays between button press and response felt sluggish. We added visual feedback (thinking animations, status indicators) to keep users engaged during processing.

  5. Educational Content Design: Balancing comprehensive explanations with the 30-word response limit meant carefully crafting system prompts to encourage concise, clear teaching.

Accomplishments that we're proud of

  • Built a complete AI assistant from scratch on embedded hardware—no Raspberry Pi, just a microcontroller
  • Created engaging animations that make learning feel personal and fun
  • Achieved sub-3-second response time from question to answer
  • Designed an accessible interface that works for students ages 5-18 and beyond
  • Developed reusable libraries that other makers can use for their own AI projects
  • Demonstrated practical smart home integration (LED control proof-of-concept extendable to study environment automation)

What we learned

  • Embedded AI is possible: We proved that sophisticated AI applications can run on affordable microcontrollers, not just expensive computers
  • User experience matters in education: The animated face increased engagement by \( 3\times \) in our informal testing with children
  • Voice-first design removes barriers: Students with reading difficulties, visual impairments, or limited typing skills can access AI tutoring seamlessly
  • Personalization is key: The same hardware becomes a different tutor for each subject/age group just by changing the system prompt
  • Physical presence matters: A tangible device creates stronger emotional bonds than screen-based apps, especially for younger learners

What's next for Luna - Your AI Learning Companion

Short-term Enhancements

  • Subject-specific modes: Pre-loaded personalities for math, science, language arts, and history
  • Progress tracking: Local storage of learning milestones and commonly asked questions
  • Parent dashboard: Web interface showing study time, topics covered, and areas needing attention
  • Gamification: Achievement badges, streak counters, and rewards for consistent practice

Medium-term Goals

  • Multi-student support: Voice recognition to identify different students and maintain separate learning profiles
  • Homework helper mode: Photo capture of worksheets for context-aware assistance
  • Study environment optimization: Integrate sensors \( (CO_2, \) noise level, lighting) and provide recommendations for optimal learning conditions

Long-term Vision

  • Classroom deployment: Teacher-controlled fleet of Luna devices for differentiated instruction
  • Offline mode: On-device smaller language models for areas with limited internet
  • Peer learning: Multiple Luna devices can facilitate group study sessions
  • Special education adaptations: Customized versions for ADHD, autism spectrum, dyslexia, and other learning differences

Scalability & Impact

Our goal is to make Luna accessible to underserved communities. At ~$25 in components, Luna costs less than one hour of private tutoring but provides unlimited educational support. We envision partnerships with educational NGOs to deploy Luna in low-resource schools globally.


Example Math Support:

When a student asks: "What's the area of a circle with radius 5?"

Luna responds: "The area formula is \( A = \pi r^2 \). So with \( r = 5 \), we get:

$$A = \pi \times 5^2 = 25\pi \approx 78.54 \text{ square units}$$

Try one yourself! What's the area when \( r = 3 \)?"

Built With

  • arduinoide
  • esp32
  • whisperai
Share this project:

Updates