{"id":24605627,"url":"https://github.com/abdullahrfa/power_management_iot_project","last_synced_at":"2025-03-18T10:13:30.016Z","repository":{"id":271431578,"uuid":"913424475","full_name":"AbdullahRFA/Power_Management_IOT_Project","owner":"AbdullahRFA","description":"Create a Smart Energy Monitoring System that uses CT and PT to measure voltage and current, calculate the power consumption of electrical devices, and estimate the cost based on usage. This system will provide real-time data through a web interface accessible via a smartphone or computer.","archived":false,"fork":false,"pushed_at":"2025-01-12T07:14:53.000Z","size":22100,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-24T16:18:06.040Z","etag":null,"topics":["ct","current-sensor","esp-project-package","esp32","oled-display","power-management","pt","relay-modules","voltage-sensor"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AbdullahRFA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-07T16:53:03.000Z","updated_at":"2025-01-12T07:14:57.000Z","dependencies_parsed_at":"2025-01-07T18:31:32.655Z","dependency_job_id":"8fa85419-857d-412f-bd8f-57d4792c70cf","html_url":"https://github.com/AbdullahRFA/Power_Management_IOT_Project","commit_stats":null,"previous_names":["abdullahrfa/power_management_iot_project"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbdullahRFA%2FPower_Management_IOT_Project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbdullahRFA%2FPower_Management_IOT_Project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbdullahRFA%2FPower_Management_IOT_Project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbdullahRFA%2FPower_Management_IOT_Project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AbdullahRFA","download_url":"https://codeload.github.com/AbdullahRFA/Power_Management_IOT_Project/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244198405,"owners_count":20414443,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ct","current-sensor","esp-project-package","esp32","oled-display","power-management","pt","relay-modules","voltage-sensor"],"created_at":"2025-01-24T16:18:11.565Z","updated_at":"2025-03-18T10:13:29.997Z","avatar_url":"https://github.com/AbdullahRFA.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Power Management System with ESP32, ACS712, and ZMPT101B\n\n# Overview\n\nThis project demonstrates a Power Management System using the ESP32 microcontroller, current sensor (ACS712), voltage sensor (ZMPT101B), OLED display (SSD1306), and Blynk IoT platform. It monitors voltage, current, power, and energy usage, and allows relay control via Blynk. Additionally, it calculates energy cost based on a specified per-unit cost.\n\n# Features\n\t1.\tReal-time Monitoring:\n\t•\tMeasures voltage (V), current (mA), and power (W).\n\t•\tCalculates energy (kWh) and cost (TK).\n\t2.\tOLED Display:\n\t•\tDisplays measured parameters (Voltage, Current, Power, Energy, and Cost) in real-time.\n\t3.\tIoT Integration:\n\t•\tSends data to the Blynk IoT app for remote monitoring and control.\n\t4.\tRelay Control:\n\t•\tControls a relay module using the Blynk app.\n\t5.\tData Logging:\n\t•\tLogs measurements for easy debugging via the Serial Monitor.\n\n# Components Used\n\n# Hardware:\n\t1.\tESP32: Main microcontroller for processing data and WiFi connectivity.\n\t2.\tACS712 (Current Sensor): Measures current in the system.\n\t3.\tZMPT101B (Voltage Sensor): Measures AC voltage.\n\t4.\tSSD1306 OLED Display: Displays real-time measurements.\n\t5.\tRelay Module: Toggles connected electrical devices ON/OFF.\n\t6.\tResistors and Capacitors: For noise filtering and stability.\n\n# Software:\n\t1.\tArduino IDE: For programming the ESP32.\n\t2.\tBlynk IoT Platform: For remote data monitoring and relay control.\n\t3.\tLibraries:\n\t•\tWiFi.h and BlynkSimpleEsp32.h for Blynk and WiFi integration.\n\t•\tACS712.h and ZMPT101B.h for sensor readings.\n\t•\tAdafruit_GFX.h and Adafruit_SSD1306.h for OLED display.\n\n# How It Works\n\n# Core Functionalities:\n\t1.\tVoltage Measurement:\n\t•\tThe ZMPT101B sensor reads the RMS voltage from the AC source.\n\t•\tSensitivity is calibrated using the setSensitivity() method.\n\t2.\tCurrent Measurement:\n\t•\tThe ACS712 sensor reads the AC current flowing through the load.\n\t•\tNoise is filtered, and a calibration factor is applied for accuracy.\n\t3.\tPower \u0026 Energy Calculation:\n\t•\tPower (￼) = Voltage (￼) × Current (￼).\n\t•\tEnergy (￼) = Power × Time.\n\t•\tCost is calculated using a predefined per-unit cost (12.67 TK).\n\t4.\tRelay Control:\n\t•\tA relay is toggled using Virtual Pin ￼ on the Blynk app.\n\t•\tON: Activates relay to power the load.\n\t•\tOFF: Deactivates relay.\n\t5.\tOLED Display:\n\t•\tDisplays Voltage, Current, Power, Energy, and Cost in real-time.\n\t6.\tBlynk IoT Integration:\n\t•\tSends measurements to Blynk app on Virtual Pins:\n\t•\t￼: Voltage\n\t•\t￼: Current\n\t•\t￼: Power\n\t•\t￼: Energy\n\t•\t￼: Cost\n\t•\tControls relay via ￼.\n\n# Pin Configuration\n\n# \tComponent\t\t\t\tPin\t\t\t\t\tDescription\n\tACS712 (Current Sensor)\t\t\tGPIO 34\t\t\t\t\tReads current values.\n\tZMPT101B (Voltage Sensor)\t\tGPIO 35\t\t\t\t\tReads voltage values.\n\tOLED Display (SSD1306)\t\t\tSDA: GPIO 21\t\t\t\tI2C Data line.\n\t\t\t\t\t\tSCL: GPIO 22\t\t\t\tI2C Clock line.\n\tRelay Module\t\t\t\tGPIO 2\t\t\t\t\tToggles the relay.\n\n# Setup Instructions\n\t1.\tHardware Setup:\n\t•\tConnect the ACS712, ZMPT101B, OLED Display, and Relay to the ESP32 as per the pin configuration.\n\t2.\tInstall Libraries:\n\t•\tInstall required libraries via the Arduino Library Manager:\n\t•\tBlynk\n\t•\tAdafruit GFX\n\t•\tAdafruit SSD1306\n\t•\tACS712\n\t•\tZMPT101B\n\t3.\tCode Configuration:\n\t•\tReplace the WiFi credentials:\n\n# char ssid[] = \"YourWiFiSSID\";\n# char pass[] = \"YourWiFiPassword\";\n\n\n\t•\tReplace the Blynk Auth Token:\n\n# define BLYNK_AUTH_TOKEN \"YourBlynkAuthToken\"\n\n\n\t4.\tUpload Code:\n\t•\tCompile and upload the code to your ESP32 using the Arduino IDE.\n\t5.\tBlynk App Setup:\n\t•\tAdd widgets for displaying Voltage, Current, Power, Energy, and Cost.\n\t•\tAdd a Button widget for Relay control on Virtual Pin ￼.\n\t6.\tCalibration:\n\t•\tAdjust the calibration factors for ACS712 and ZMPT101B as per your hardware setup for accurate readings.\n\n# Blynk Virtual Pins\n\n# Virtual Pin\tParameter\tDescription\n\tV0\tVoltage (V)\tReal-time voltage readings.\n\tV1\tCurrent (mA)\tReal-time current readings.\n\tV5\tPower (W)\tPower consumption in watts.\n\tV6\tEnergy (kWh)\tTotal energy consumption.\n\tV3\tCost (TK)\tEnergy cost in TK.\n\tV4\tRelay Control\tButton to toggle relay state.\n\tV2\tUptime\t\tDisplays system uptime in seconds.\n\n# Example Output\n\n# Serial Monitor:\n\n\tVoltage: 220.0 V\n\tCurrent: 500.0 mA\n\tPower: 110.0 W\n\tEnergy: 0.11 kWh\n\tCost_Per_Unit: 1.39 TK\n\n# OLED Display:\n\n\tPower Management\n\tVoltage: 220.0 V\n\tCurrent: 500.0 mA\n\tPower: 110.0 W\n\tEnergy: 0.11 kWh\n\tCost: 1.39 TK\n\n# Future Enhancements\n\t•\tIntegrate more sensors for advanced monitoring (e.g., temperature, humidity).\n\t•\tImplement data logging using an SD card or cloud storage.\n\t•\tAdd energy-saving modes or automation based on thresholds.\n\n# Author\n\n# Abdullah Nazmus-Sakib\nA passionate IoT developer and tech enthusiast.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdullahrfa%2Fpower_management_iot_project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabdullahrfa%2Fpower_management_iot_project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdullahrfa%2Fpower_management_iot_project/lists"}