Skip to content

MindEase is a mental health assistant that combines IoT hardware with AI to provide emotional support. It uses an ESP32 for audio input/output and integrates with AI models and cloud services for natural language understanding and response generation.

Notifications You must be signed in to change notification settings

tezodipta/MindEase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MindEase

Project Description

MindEase is a mental health assistant designed to provide emotional support and advice to users. It leverages an ESP32-based hardware setup for audio input/output and a fine-tuned AI model for natural language understanding and response generation. The project integrates hardware, AI, and backend services to create a seamless user experience.

Use of This Project

MindEase can be used to:

  • Provide mental health support and advice.
  • Act as a conversational assistant for emotional well-being.
  • Demonstrate the integration of IoT devices with AI models.

Hardware Requirements

To build the hardware setup, you will need:

  • ESP32 Development Board (e.g., ESP32-DevKitC).
  • INMP441 Microphone for audio input.
  • MAX98357A Amplifier for audio output.
  • LEDs for status indication:
    • WiFi connection status.
    • Audio recording status.
  • Push Button for triggering the assistant.
  • Power Supply (e.g., USB or battery).

Circuit Connections

  1. Microphone (INMP441):

    • LRC → GPIO 5
    • DOUT → GPIO 19
    • BCLK → GPIO 18
  2. Amplifier (MAX98357A):

    • DIN → GPIO 22
    • BCLK → GPIO 15
    • LRC → GPIO 21
  3. LEDs:

    • WiFi Status LED → GPIO 25
    • Audio Recording LED → GPIO 32
    • Built-in LED → GPIO 2 (optional)
  4. Push Button:

    • Connect to GPIO 4 with a pull-up resistor.
  5. Power Supply:

    • Connect the ESP32 to a 5V power source or use a Power Bank.

Backend Setup (Node.js)

  1. Install Node.js and Python.
  2. Clone this repository:
    git clone https://github.com/your-repo/MindEase.git
    cd MindEase
  3. Navigate to the Backend folder:
    cd Backend
  4. Install dependencies:
    npm install
  5. Configure environment variables:
    • Create a .env file in the Backend folder.
    • Add the following variables:
      PORT=3000
      GOOGLE_APPLICATION_CREDENTIALS=path/to/google_creds.json
      GROQ_API_KEY=your_groq_api_key
      
  6. Start the backend server:
    npm start

Backend Setup (Flask with ngrok)

  1. Install Python dependencies:
    pip install fastapi uvicorn pyngrok transformers torch accelerate
  2. Start the Flask backend:
    python app.py
  3. Use ngrok to expose the local server:
    ngrok http 8000
  4. Copy the public URL provided by ngrok and use it to access the backend API.
  5. I'm useing my own address for the backend, you can use your own address for the backend.

Using Your Own Model

To use your own fine-tuned model:

  1. Fine-tune the model using the provided notebook (Model/Model_train_colab.ipynborModel/Model_train_local.ipynb).
  2. Save the fine-tuned model in the fine_tuned_model folder. or download the model from my drive link: "Drive Link
  3. Update the backend and ESP32 code to point to your model.

Accessing the Model via API

You can use your Own api to access the model from local or use the provided MindEase_AI_backend.ipynb file to expose the model as an API. This API can be accessed from platforms like Google Colab or other applications.

License

This project is licensed under the MIT License. You are free to use, modify, and distribute this project, provided proper attribution is given.

Acknowledgments

Feel free to contribute to this project by submitting issues or pull requests!

About

MindEase is a mental health assistant that combines IoT hardware with AI to provide emotional support. It uses an ESP32 for audio input/output and integrates with AI models and cloud services for natural language understanding and response generation.

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •