EmoBrace is a wearable device project designed to monitor physiological signals and predict the user's emotional state. By leveraging sensor data and machine learning, EmoBrace provides real-time emotion detection and personalized suggestions to improve emotional well-being.
- Emotion Detection: Predicts emotions such as Happy, Sad, Neutral, Angry, Anxious, and Stressed using physiological signals.
- Sensor Integration: Reads data from:
- LM35 Temperature Sensor
- AD8232 ECG Sensor
- GSR Sensor
- Machine Learning: Utilizes a pre-trained model (
final_emotion_model.pkl) and a scaler (scaler.pkl) for emotion prediction. - Data Collection: Collects and stores sensor data for analysis and training.
- Firebase Integration: Uploads processed data and predictions to Firestore for real-time storage and analysis.
.gitignore
capstone.py
data_collection.py
google-services.json
ml_prediction.py
serviceAccountKey.json
capstone.py: Main script for real-time data collection, emotion prediction, and uploading results to Firestore.data_collection.py: Script for collecting labeled sensor data and saving it to a CSV file for training purposes.ml_prediction.py: Script for testing the emotion prediction model with live sensor data.serviceAccountKey.json: Firebase service account key for authentication (ignored by .gitignore).google-services.json: Firebase configuration file (ignored by .gitignore)..gitignore: Specifies files to exclude from version control.
-
Hardware:
- LM35 Temperature Sensor
- AD8232 ECG Sensor
- GSR Sensor
- ADS1115 ADC Module
- Raspberry Pi or compatible microcontroller with I2C support
-
Software:
- Python 3.x
- Required Python libraries (install via
pip):pip install numpy pandas joblib adafruit-circuitpython-ads1x15 firebase-admin google-cloud-firestore
-
Firebase Setup:
- Create a Firebase project.
- Download the
serviceAccountKey.jsonandgoogle-services.jsonfiles and place them in the project directory.
-
Machine Learning Model:
- Ensure
final_emotion_model.pklandscaler.pklare in the project directory.
- Ensure
Run the main script to collect sensor data, predict emotions, and upload results to Firestore:
python capstone.pyCollect labeled sensor data for training the emotion prediction model:
python data_collection.pyTest the pre-trained model with live sensor data:
python ml_prediction.py| Emotion | Suggestion |
|---|---|
| Happy | Keep enjoying the moment! |
| Sad | Take some time to relax and focus on yourself. |
| Neutral | Maintain your calm and steady approach. |
| Angry | Take deep breaths and try stepping away. |
| Anxious | Focus on your breathing and grounding techniques. |
| Stressed | Consider taking short breaks to decompress. |
- Ensure all hardware components are properly connected before running the scripts.
- The
serviceAccountKey.jsonandgoogle-services.jsonfiles are sensitive and should not be shared publicly.
- Adafruit for the ADS1115 library.
- Firebase for real-time database services.
- Scikit-learn for machine learning tools.## Emotion Labels and Suggestions


