Skip to content

Electronic Live Encouragement Via AI Text Enhancement

License

Notifications You must be signed in to change notification settings

RJTPP/ELEVATE-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ELEVATE-AI

ELEVATE-AI (Electronic Live Encouragement Via AI Text Enhancement) is an Arduino project designed to help improving office environments and encourage healthy work habits through real-time monitoring and AI-driven text prompts. Using sensors and AI analysis via the Gemini API, ELEVATE-AI provides a solution to combat office syndrome by reminding users to take breaks and optimize their workspace for productivity and well-being.

Features

  • Monitors environmental conditions in real-time: temperature, humidity, CO2 levels, UV index, and light intensity.
  • Detects user presence at the desk using ultrasonic sensors.
  • Leverages Node-RED for data processing and workflow automation.
  • Utilizes the Gemini API for AI-driven insights and text prompts.
  • Delivers a dashboard UI for data visualization and interaction.
  • Sends automated, AI-powered reminders to encourage regular movement and breaks.

AI Integration

Incorporates the Gemini API for AI-powered analysis and suggestions based on the collected environmental data.

Hardware Components

  • 2 x ESP32-S3 modules
  • DHT11 Temperature and Humidity Sensor
  • LTR390 UV and Brightness Sensor
  • MQ-135 Air Quality Sensor
  • HC-SR04 Ultrasonic Sensor
  • OLED Display I2C IIC 0.96″ SSD1306 128x64px

Software Dependencies

  • Arduino IDE
  • Node-RED
  • MQTT Broker

Arduino Libraries

  • WiFi for ESP32's WiFi capabilities.
  • PubSubClient for MQTT communications.
  • Wire for I2C communications with sensors and display.
  • Adafruit_Sensor, DHT and DHT_U for the DHT sensors.
  • LTR390 for the UV and ambient light sensor.
  • MQ135 for the air quality sensor.
  • Adafruit_SSD1306 for the OLED display control.
  • HCSR04 for the ultrasonic distance measurements.

Directories

 📦 ELEVATE-AI
 ┃
 ┣ 📁 Node-RED
 ┃ ┗ 📜 flows.json            # Node-RED flows
 ┃
 ┣ 📁 screen
 ┃ ┣ 📜 PubSubClient.cpp      # Library
 ┃ ┣ 📜 PubSubClient.h        # Library
 ┃ ┣ 📜 hardwareConfig.h      # Hardware pin configuration
 ┃ ┣ 📜 networkConfig.h       # WiFi and MQTT broker configuration
 ┃ ┣ 📜 screen.h              # Header file for the screen code
 ┃ ┗ 📜 screen.ino            # Main code for the screen ESP32 module
 ┃
 ┣ 📁 sensors
 ┃ ┣ 📜 MQ135.cpp             # Library
 ┃ ┣ 📜 MQ135.h               # Library
 ┃ ┣ 📜 hardwareConfig.h      # Hardware pin configuration
 ┃ ┣ 📜 networkConfig.h       # WiFi and MQTT broker configuration
 ┃ ┣ 📜 sensors.h             # Header file for the sensors code
 ┃ ┗ 📜 sensors.ino           # Main code for the sensors ESP32 module
 ┃
 ┣ 📜 LICENSE                 # License file
 ┣ 📜 README.md               # This file
 ┗ 📜 project-detail.md       # Project details and explanation

Configuration

ESP32 Modules

  • Update the networkConfig.h file in screen and sensors dictionary with your WiFi network details and MQTT broker information before flashing the ESP32 modules.
See networkConfig.h
#define WIFI_SSID    "<WIFI_SSID>"    // Config here
#define WIFI_PASS    "<WIFI_PASS>"    // Config here
#define MQTT_BROKER  "<MQTT_BROKER>"  // Config here
#define MQTT_USER    "<MQTT_USER>"    // Config here
#define MQTT_PASS    "<MQTT_PASS>"    // Config here


#define TOPIC_PREFIX "<TOPIC_PREFIX>" // Config here
#define TOPIC_DATA_PREFIX TOPIC_PREFIX "/sensors"

#define TOPIC_TEMPERATURE TOPIC_DATA_PREFIX "/temperature"
#define TOPIC_HUMIDITY TOPIC_DATA_PREFIX "/humidity"
#define TOPIC_AIR TOPIC_DATA_PREFIX "/air_quality"
#define TOPIC_UV TOPIC_DATA_PREFIX "/uv"
#define TOPIC_LIGHT TOPIC_DATA_PREFIX "/light"
#define TOPIC_JSON TOPIC_DATA_PREFIX "/json"

#define TOPIC_SITTING_PREFIX TOPIC_PREFIX "/sitting"
#define TOPIC_IS_SITTING TOPIC_SITTING_PREFIX "/is_sitting"
#define TOPIC_SITTING_DISTANCE TOPIC_SITTING_PREFIX "/distance"
#define TOPIC_SITTING_TIME TOPIC_SITTING_PREFIX "/time"
#define TOPIC_SITTING_JSON TOPIC_SITTING_PREFIX "/json"
#define TOPIC_SITTING_RESET TOPIC_SITTING_PREFIX "/reset"

#define TOPIC_TIME TOPIC_PREFIX "/time"


#define TOPIC_AI TOPIC_PREFIX "/ai/auto"

#define TOPIC_DEBUG TOPIC_PREFIX "/debug/data"

  • Modify the hardwareConfig.h file in screen and sensors dictionary to configure the ESP32 pin definitions to match your hardware setup before flashing the firmware onto the ESP32 modules.
See hardwareConfig.h
// screen/hardwareConfig.h

#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define REFRESH_DELAY 16

#define OLED_SCL_PIN 47
#define OLED_SDA_PIN 48

#define US_ECHO_PIN 4
#define US_TRIGGER_PIN 5

#define LED_RED_PIN 42
#define LED_YELLOW_PIN 41
#define LED_GREEN_PIN 40
#define SWITCH_PIN 2
// sensors/hardwareConfig.h

#define LTR390_I2C_ADDRESS 0x53
#define LTR_SDA_PIN 21
#define LTR_SCL_PIN 20

#define MQ135_DO_PIN 13
#define MQ135_AO_PIN 14

#define DHTPIN 15
#define DHTTYPE DHT11

#define LED_RED_PIN 42
#define LED_YELLOW_PIN 41
#define LED_GREEN_PIN 40
#define SWITCH_PIN 2

Node-RED

  • Set up the Node-RED environment variables to match your configuration, particularly the Gemini API keys and Discord chanel ID.

  • Set up the Gemini API keys in the AI Dashboard Template

node-red-env

Installation

  1. Flash the ESP32-S3 modules with the provided firmware, ensuring the networkConfig.h file is configured with your network details.
  2. Set up Node-RED with the correct environment variables and configure the Gemini API integration.
  3. Establish the MQTT broker for communication between the ESP32 modules and Node-RED.
  4. Access the dashboard through Node-RED UI to monitor environmental conditions and receive AI-based recommendations.

Developed by

  1. Rajata Thamcharoensatit @RJTPP - 6610502218
  2. Phutthiphong Rodboung @Rennis - 6610502170

This project was made for 01204114 Introduction to Computer Hardware Development.

Computer Engineering (CPE) Faculty, Kasetsart University, Bangkok, Thailand.

About

Electronic Live Encouragement Via AI Text Enhancement

Topics

Resources

License

Stars

Watchers

Forks