GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - chandrasaptadeep7-cell/Python-ESP8266-Laptop-Charging-Control: IoT-based laptop battery charging cutoff system using Python and ESP8266. Automatically controls charger state over Wi-Fi based on battery percentage to improve battery longevity.

BranchesTags
Open more actions menu

Latest commit

 

History

47 Commits
47 Commits

Folders and files

NameName
Last commit message
Last commit date
Laptop_charging_automation.jpeg
Laptop_charging_automation.jpeg
 
 
README.md
README.md
 
 
Wemos_D1mini_auto_cut_charger.py
Wemos_D1mini_auto_cut_charger.py
 
 
Wemos_D1mini_laptop_charger_schematic.pdf
Wemos_D1mini_laptop_charger_schematic.pdf
 
 
laptop_charger.txt
laptop_charger.txt
 
 
wemos_laptop_auto_cut_charger.ino
wemos_laptop_auto_cut_charger.ino
 
 

Repository files navigation

Python ESP8266 Laptop Charging Control

Python-based desktop application that communicates with an ESP8266 over Wi-Fi to automate external laptop charger control based on battery percentage. Developed to demonstrate hardware-software integration, HTTP networking, and embedded IoT programming. An IoT-based battery management system that automatically controls a laptop charger using Python and an ESP8266 over Wi-Fi based on real-time battery percentage. This project demonstrates Python-to-Hardware communication, embedded firmware development, and IoT networking. I built a prototype to demonstrate hardware-software integration using Python and ESP8266. The battery percentage served as a real-world event source to automate charger control over Wi-Fi.

Project Overview

An automated battery management system that utilizes an ESP8266-controlled relay to regulate charging based on laptop battery thresholds. The system achieves autonomous power control via a Python-based agent, effectively minimizing thermal and electrical stress on the battery to improve overall hardware lifespan.

Key Features

  1. Automatic battery monitoring
  2. Relay-based charging control
  3. Wi-Fi communication
  4. HTTP server on ESP8266
  5. mDNS support
  6. Configurable charging thresholds
  7. Real-time automation

Software Components

Software / Library Purpose
Python Main application for battery monitoring and automation logic.
psutil Retrieves the laptop's battery percentage and charging status.
requests Sends HTTP POST requests to the ESP8266.
Arduino IDE Used to develop and upload firmware to the ESP8266.
VS Code To write and run the python script
ESP8266WiFi Connects the ESP8266 to the local Wi-Fi network.
ESP8266WebServer Implements the embedded HTTP server that receives control commands.
ESP8266mDNS Enables hostname-based access (esp8266.local) without using a fixed IP address.
Embedded C++ Programming language used for developing the ESP8266 firmware.

Hardware Components

Component Purpose
ESP8266 NodeMCU Acts as the IoT controller by hosting an HTTP server, processing incoming commands, and controlling the relay module.
Relay Module (1-Channel) Connects or disconnects the laptop charger based on commands received from the ESP8266.
Laptop Runs the Python application that monitors battery status and communicates with the ESP8266 over Wi-Fi.
Wi-Fi Router / Local Network Provides wireless communication between the laptop and the ESP8266 using HTTP requests.

Documents

The repository includes:

  1. Circuit Diagram
  2. Pictures
  3. Source Code
  4. Working Manual

Communication Flow

  1. Python reads battery percentage of the laptop.
  2. Sends HTTP request to Esp8266.
  3. ESP8266 receives request.
  4. Relay switches charger.
  5. System repeats in infinite loop.

Working Overview

  • Connectivity: The ESP8266 and the laptop are synchronized via a local Wi-Fi network.

  • Monitoring: A Python script tracks battery percentage in real-time.

  • Automation: At ≥95%: The script sends an HTTP request to the ESP8266 to trip the relay and stop charging. At ≤35%: The script instructs the ESP8266 to release the relay, enabling the charging circuit.

Technical Highlights

  1. Python Automation
  2. Embedded C/C++
  3. HTTP Client-Server Communication
  4. REST API
  5. Embedded Networking
  6. IoT
  7. mDNS
  8. GPIO Programming
  9. Relay Interfacing
  10. Error Handling
  11. Wi-Fi Communication

Challenges Faced

  1. Network timeout handling
  2. Reliable Wi-Fi reconnection
  3. While communication through IP address

Limitations

  1. Requires Wi-Fi connectivity.
  2. No authentication for HTTP requests.
  3. Single-client design.
  4. No watchdog recovery if ESP8266 hangs.
  5. Battery percentage polling interval could be optimized.

About

IoT-based laptop battery charging cutoff system using Python and ESP8266. Automatically controls charger state over Wi-Fi based on battery percentage to improve battery longevity.

Topics

arduinoautomationbattery-management-systemelectronics-developmentembedded-systems-engineeringesp8266hardwarehttpiotmicrocontrollerpythonrelaywifi

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.