Skip to content

Chamuditha20/Smart-Meter-Analytics---IoT-Energy-Monitoring-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Smart Meter Analytics & IoT Energy Monitoring System

React Laravel Python Arduino

A comprehensive, full-stack IoT solution designed to monitor electrical energy consumption in real-time. This project simulates a smart energy meter, captures live power usage, and visualizes the data through an interactive, responsive web dashboard with automated billing capabilities.

Key Features

  • Real-Time Data Visualization: Live Area Charts displaying the most recent power usage trends using Recharts.
  • Smart Budget Tracker: Interactive slider allowing users to set monthly kWh goals, with dynamic progress bars and over-limit warning alerts.
  • Automated PDF Billing: Generates professional, downloadable PDF energy bills filtered by specific date ranges using jsPDF and autoTable.
  • Historical Data Filtering: Search and filter historical energy consumption data using an intuitive dual-calendar interface.
  • Modern UI/UX: Clean, enterprise-level interface utilizing soft gradients, Bootstrap typography, and Lucide-React icons.

Architecture: How It Works

This project integrates hardware simulation, a middleware bridge, a robust backend, and a dynamic frontend. Here is the step-by-step data flow:

  1. Hardware Simulation (Arduino + Proteus)

    • An Arduino circuit is simulated using Proteus. A potentiometer acts as the variable electrical load (simulating household power usage).
    • The Arduino reads the analog values, calculates the current power demand (kW) and total consumed units (kWh) over time.
    • This data is serialized into a JSON string and transmitted via a virtual serial port (COM1).
  2. Middleware Serial Bridge (Python)

    • A Python script (bridge.py) utilizing the pyserial library listens to the virtual serial port (COM2 via VSPE).
    • It captures the live JSON data stream from the Proteus simulation, decodes it, and instantly forwards it to the web backend via HTTP POST requests.
  3. Backend API (Laravel + MySQL)

    • A Laravel RESTful API receives the incoming POST requests from the Python bridge.
    • It calculates the estimated bill amount based on a predefined unit price and securely stores the meter_id, current_usage, total_units, and bill_amount into a MySQL database.
    • It provides GET endpoints to serve this data, supporting date-range filtering for the frontend.
  4. Frontend Dashboard (React + Vite)

    • The React application continuously polls the Laravel API to fetch the latest readings.
    • State management is used to instantly update the UI summary cards, alert systems, and live charts without requiring a page refresh.

Tech Stack

  • Frontend: React.js, Vite, Bootstrap, Recharts, jsPDF, Lucide-React.
  • Backend: Laravel (PHP), Eloquent ORM, MySQL.
  • Middleware Bridge: Python 3, PySerial, Requests.
  • IoT / Hardware: Arduino (C++), Proteus Design Suite, Virtual Serial Port Emulator (VSPE).

Quick Start / Setup Guide

1. Backend (Laravel) Setup

cd smart-meter-api
composer install
cp .env.example .env
php artisan key:generate
# Update your .env file with your database credentials
php artisan migrate
php artisan serve

About

A full-stack IoT energy monitoring system that simulates a smart meter to capture and visualize real-time power usage. Built with React, Laravel, Python, and Arduino.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors