Inspiration
The growing need for efficient energy management inspired us to develop a system that could simulate, track, and visualize electricity consumption in real-time. With the rise of smart homes and sustainable living, it’s essential to have transparent, accessible tools to monitor power usage. This project brings that idea to life using accessible open-source technologies.
What it does
This project simulates, logs, and visualizes real-time power consumption data using a Python Flask backend, MySQL database, and a live JavaScript dashboard. It mimics a smart energy monitoring system and provides a graphical interface that updates every 2 seconds with new data.
How we built it
Backend: We used Python and Flask to build a REST API that handles simulated power readings and interacts with a MySQL database.
Database: A simple MySQL table stores power consumption records along with timestamps. Every few seconds, a new reading is generated and inserted into the database.
Frontend: The web dashboard is created using HTML, JavaScript, and Chart.js. It fetches live data from the backend and dynamically updates the graph to reflect the most recent power readings.
System Flow: 1.Simulate power data. 2.Insert into MySQL. 3.Fetch last 10 readings via API. 4.Display as a live chart on the frontend.
Challenges we ran into
1.Managing real-time data flow between backend and frontend. 2.Ensuring the database updates reflect immediately in the frontend graph. 3.Debugging cross-origin request issues (CORS) during frontend-backend communication. 4.Setting up a responsive chart that doesn't get cluttered with too much data. 5.Keeping the data lightweight and readable while maintaining accuracy.
Accomplishments that we're proud of
1.Successfully built a real-time, full-stack system from scratch. 2.Created a responsive and visually appealing energy dashboard.
What we learned
1.How to integrate Flask APIs with MySQL databases. 2.Real-time data visualization using Chart.js. 3.Simulating IoT-like sensor data in a backend environment. 4.Importance of asynchronous data fetching and frontend updates. 5.How to build a full-stack application with real-time feedback.
What's next for PowerPulse
We built a fully functional prototype that logs power consumption every 2 seconds and displays it on a live dashboard. The system is scalable and ready for integration with real hardware sensors like Arduino or ESP32 in the future.
Built With
- javascripta
- library
- logic
- python
Log in or sign up for Devpost to join the conversation.