Skip to content

PMohan-27/AURA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌟 AURA β€” Adaptive Understanding & Responsive Assistant

(Arduino + AI Voice Therapy Bot)

A compact, voice-activated AI companion built using the Arduino UNO R4, custom analog audio front-end, and a single Python backend (bridge.py).

AURA listens through an analog microphone, streams audio into a Python backend for STT β†’ AI β†’ TTS, and plays natural speech through a Class-D amplifier.

This repository includes hardware, firmware, Python backend, and 3D-printable shell CAD for a complete end-to-end build.


πŸ“¦ Repository Structure

AURA/
β”‚
β”œβ”€β”€ AURA_ARDUINO/             # PlatformIO firmware project
β”‚   β”œβ”€β”€ src/main.cpp
β”‚   β”œβ”€β”€ include/
β”‚   β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ test/
β”‚   β”œβ”€β”€ .vscode/
β”‚   └── platformio.ini
β”‚
β”œβ”€β”€ bridge.py                 # Single backend Python file (STT β†’ LLM β†’ TTS)
β”‚
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ schematic.pdf         # Full electronics schematic
β”‚   β”œβ”€β”€ architecture.png      # System architecture diagram
β”‚   └── CAD/
β”‚       β”œβ”€β”€ AURA Shell UPPER.stl
β”‚       └── AURA Shell LOWER.stl
β”‚
β”œβ”€β”€ resampled_resampy.wav     # Debug sample output
β”œβ”€β”€ README.md
└── .gitignore

🧩 Hardware Overview

AURA uses:

  • Arduino UNO R4 Minima
  • SEN0487 Analog Electret Microphone
  • PAM8302A Class-D Audio Amplifier
  • Single-ended mic input (AC-coupled)
  • High-frequency PWM speaker output
  • Custom 3D-printed enclosure

πŸ”Œ Hardware Block Diagram

 Mic β†’ Arduino ADC β†’ Serial β†’ bridge.py β†’
 Google STT β†’ Azure GPT-4o Mini β†’ TTS β†’
 Arduino PWM β†’ PAM8302 β†’ Speaker

πŸ”§ Electronics Wiring (Matches Your Schematic)

🎀 Microphone β†’ Arduino

SEN0487 Pin Arduino Pin Notes
OUT A0 (MIC_IN) Through 10 Β΅F capacitor (AC coupling)
VCC 3.3V Mic power
GND GND Common ground

πŸ”Š Arduino β†’ PAM8302 Amplifier β†’ Speaker

Arduino Pin PAM8302 Pin Purpose
D9 (SPK_OUT) A+ PWM audio signal
GND A- Ground
5V VIN Amplifier power
GND GND Power ground

Additional components used:

  • C1 = 10 Β΅F (audio smoothing)
  • R1 = 10k (pull-down resistor for stable PWM idle)

πŸ“˜ Schematic & CAD Files

πŸ”§ Electronics Schematic

docs/schematic.pdf

🧱 3D Printable Shell

Located in docs/CAD/:

  • AURA Shell UPPER.stl
  • AURA Shell LOWER.stl

πŸ’» Firmware (Arduino / PlatformIO)

The Arduino code lives inside AURA_ARDUINO/ and is built using PlatformIO (not Arduino IDE).


πŸ“ Firmware Structure

AURA_ARDUINO/
β”‚
β”œβ”€β”€ src/main.cpp            # Main firmware logic
β”œβ”€β”€ include/
β”œβ”€β”€ lib/
β”œβ”€β”€ test/
β”œβ”€β”€ .vscode/
└── platformio.ini

🧠 Firmware Responsibilities

main.cpp handles:

  • ADC sampling of microphone at ~6.5 kHz
  • Serial streaming of raw audio frames to Python
  • Receiving PCM audio from Python
  • Reconstructing audio via high-frequency PWM on D9
  • Synchronizing with Python's bridge.py

▢️ Building the Firmware

From inside AURA_ARDUINO/:

pio run
pio run --target upload

Or use VSCode PlatformIO:

  • βœ” Build
  • βœ” Upload
  • βœ” Serial Monitor

βš™ PlatformIO Config (Expected)

[env:uno_r4_minima]
platform = renesas-ra
board = uno_r4_minima
framework = arduino
monitor_speed = 921600

🧠 Python Backend (bridge.py)

The entire AI pipeline runs through one Python script.

Pipeline:

Audio β†’ STT β†’ GPT-4o Mini β†’ TTS β†’ Audio Playback

Features inside bridge.py:

  • Serial connection to Arduino
  • Audio buffer and noise preprocessing
  • Google STT
  • Azure GPT-4o Mini
  • gTTS
  • WAV β†’ PCM conversion
  • Sending PCM packets to Arduino

βš™ Setup Instructions

1. Clone repo

git clone https://github.com/l-krrish/AURA
cd AURA

2. Create Python environment

python -m venv .venv
.\.venv\Scripts\activate

3. Install dependencies

pip install -r requirements.txt

4. Configure API keys (inside bridge.py)

AZURE_ENDPOINT = "https://therapy-bot.openai.azure.com/"
AZURE_API_KEY = "<your key>"
AZURE_DEPLOYMENT = "gpt-4o-mini"
GOOGLE_CREDENTIALS = "credentials.json"

5. Upload firmware

Inside AURA_ARDUINO/:

pio run --target upload

▢️ Running AURA

python bridge.py

You should see:

Connected to Arduino on COM7
AI Therapy Bot Ready.
Recording...

Speak β†’ AURA replies β†’ audio plays.


πŸš€ Features

  • Real-time conversational feedback
  • GPT-4o Mini reasoning
  • Hardware-accurate PWM audio
  • Full schematic + CAD for reproducibility
  • Single-file backend for simplicity
  • Custom enclosure design

πŸ§ͺ Future Improvements

  • Wake-word activation
  • Noise reduction filters
  • ESP32-S3 upgrade
  • Local quantized LLM support
  • LED expressions + servo motion

πŸ‘€ Authors & Contributors

Krrish Lala

Waterloo Computer Engineering


Parasinder Mohan

Waterloo Computer Engineering


Luca Seaman

Waterloo Computer Engineering


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •