Abstract
The rapid growth of electric vehicles (EVs) and rising electricity demand call for intelligent, secure and efficient smart-grid systems. This paper presents an IoT-based smart-grid framework for hybrid renewable energy monitoring, real-time voltage and current analysis, intelligent energy auditing, AI-based load forecasting and EV charging management, built around the ESP32 microcontroller and integrated with an OpenAI-based decision layer and the Ethereum blockchain. Field-level sensors capture solar, wind and battery voltage, AC voltage, AC current, AC power, cumulative energy units and a peak-status flag, which are logged to the ThingSpeak cloud. Solidity smart contracts create, manage and verify peer-to-peer (P2P) energy trades, and SHA-256 hashes of the IoT telemetry are committed on-chain so that any later modification of stored energy records can be detected. A Streamlit dashboard provides real-time visualisation, blockchain transaction tracking, data-integrity verification and P2P trading. Experimental results from the ThingSpeak channel, a private Proof-of-Authority (PoA) Ethereum network, the Sepolia test network and the dashboard confirm reliable data acquisition, deterministic 5 s block sealing, 6.8 s end-to-end logging latency, 100 % detection of tampered records, automated energy auditing with loss flagging, and a block-ordered, verifiable trade ledger. The integration of IoT, generative AI, blockchain and P2P trading offers a scalable, secure and decentralised smart-grid architecture suitable for residential, commercial, EV-charging and smart-city applications.