BlueNode is a Smart Water Quality Monitoring, Prediction, and Assistance Dashboard built with Flask, MQTT, OpenAI GPT-4o, and real-time Machine Learning.
It connects to an ESP32-based TDS sensor to display live water quality metrics, predicts future water availability, and features a built-in AI chatbot for real-time guidance based on sensor data.
- Real-time TDS monitoring from ESP32 sensor via MQTT
- Simulated Temperature and Tank Level readings
- AI-powered WaterSense Chatbot using OpenAI GPT-4o, answering user queries based on live sensor data
- Live Graphs for TDS, Temperature, and Tank Level
- System Alerts triggered if TDS exceeds safe drinking limits
- Tank Empty Time Prediction using simple Linear Regression
- Water Usage Forecasting using simulated data
- Interactive Issue Reporting Form
- Responsive and modern dashboard design
- TDS values are real-time readings from an ESP32 and TDS sensor, sent using MQTT.
- Temperature and Tank Level are randomly simulated (for now, to simulate full functionality).
- ESP32 setup is required for TDS monitoring.
- AI Chatbot generates human-like, precise, and safe water-related responses using OpenAI GPT-4o based on live sensor readings.
- Backend: Flask (Python)
- Frontend: HTML, CSS, JavaScript (Chart.js)
- AI Integration: OpenAI GPT-4o
- IoT Communication: MQTT with ESP32
- Machine Learning: scikit-learn (Linear Regression)
git clone https://github.com/jaidevreddy/BlueNode.git
cd BlueNodepython3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtExample requirements.txt:
Flask
openai
paho-mqtt
scikit-learn
python-dotenv
Create a .env file:
OPENAI_API_KEY=your_openai_api_key_here
python app.pyVisit:
http://127.0.0.1:5000
- Microcontroller: ESP32
- Sensor: TDS Sensor Module
- Communication: MQTT
- Topic:
sensor/tds
Your ESP32 must:
- Connect to the same Wi-Fi network as your laptop
- Publish TDS values to the MQTT broker on port 1883
- Broker Address: your laptop's local IP (example:
192.168.x.x)
Example Arduino MQTT Publish Code Snippet:
client.publish("sensor/tds", String(tdsValue).c_str());Ensure Mosquitto or another MQTT broker is running locally.
BlueNode/
├── app.py
├── templates/
│ └── index.html
├── static/
│ └── style.css
├── requirements.txt
└── README.md
- Replace simulated Temperature and Tank Level with actual sensors
- Notification system (SMS/Email) for water quality alerts
- Data history dashboard for analysis
- Full smart home integration (Home Assistant, Alexa)
This project is licensed under the MIT License.
Developed and maintained by K Jaidev Shankar Reddy, Adoksh M Bharadwaj, Manvitha R Kabbathi and Ajay S Prakash