VoltSense is an IoT-enabled smart switch that allows users to monitor power usage, control appliances remotely, and gain insights into energy consumption patterns. It includes a web dashboard and a mobile app for seamless user interaction.
- Overview
- Features
- Hardware Components
- Software Components
- Setup and Installation
- Usage
- Backend Server
- ESP32 Firmware
- Frontend Application
- Google AI Integration
- Contributing
- License
VoltSense aims to provide an affordable and scalable solution for smart energy management in households and small businesses. By leveraging IoT and cloud technologies, it empowers users with real-time data and actionable insights to promote energy conservation.
- Real-time monitoring of power usage.
- Remote control of appliances.
- Historical data visualization.
- Energy-saving recommendations.
- Carbon footprint tracking.
- Google AI-powered insights and anomaly detection.
- Web dashboard and mobile app for device management.
- ESP32 Microcontroller: For managing IoT functionalities.
- ACS712 Current Sensor: To measure current flow.
- Relay Module: To control the connected appliances.
- Voltage Regulator: To power the ESP32 and peripherals.
- Enclosure: Fireproof casing for safety.
- Backend: Express.js server handling MQTT messages and database interactions.
- Frontend: Next.js for the web dashboard.
- MQTT Broker: Hosted on Google Cloud VM.
- Database: Firebase Firestore for storing user data and metrics.
- Mobile App: Flutter-based app for mobile control and insights.
git clone https://github.com/yourusername/voltsense.git
cd voltsense
Navigate to the server
directory and install dependencies:
cd server
npm install
Start the Express server:
npm start
Navigate to the client
directory and install dependencies:
cd client
npm install
Start the Next.js application:
npm run dev
Flash the provided firmware onto the ESP32 to start sending MQTT messages to the broker.
- Web Dashboard: Access the web dashboard at http://localhost:3000 to monitor and control connected appliances.
- Mobile App: Install the Flutter app on your mobile device for remote management.
- MQTT Broker: Ensure the MQTT broker is running on your Google Cloud VM and accessible from your network.
The backend is built using Express.js and handles the following:
- Connecting to the MQTT broker to receive messages.
- Storing and retrieving data from Firebase Firestore.
- Exposing APIs for the frontend to fetch real-time and historical data.
GET /message
: Fetches the latest MQTT message.POST /control
: Sends control commands to the ESP32.
The ESP32 firmware is programmed to:
- Connect to the specified MQTT broker.
- Publish power usage data to the esp32/messages topic.
- Listen for control commands on the esp32/control topic.
The frontend is a Next.js application that:
- Provides a user-friendly interface for monitoring and controlling appliances.
- Visualizes power usage data and insights.
- Fetches data from the Express backend through REST APIs.
The project integrates with Google AI to:
- Analyze power usage data.
- Provide insights into energy consumption patterns.
- Detect anomalies and suggest energy-saving practices.
Contributions are welcome! Please fork the repository and create a pull request with your changes. Ensure that your code adheres to the project's coding standards and includes relevant tests.
This project is licensed under the MIT License. See the LICENSE file for more details.