Skip to content

venkyr/lightning-windsurf

Repository files navigation

Solar Monitoring System

A Python-based monitoring system for solar power systems, collecting data from AC currents, battery status, charger, and inverter states, and storing it in InfluxDB.

Features

  • Real-time monitoring of AC currents (line in, charger, inverter)
  • Battery status monitoring (voltage, current, SOC, charge, capacity)
  • Controller state monitoring (inverter and charger)
  • Data storage in InfluxDB with configurable polling interval

Requirements

  • Python 3.7+
  • InfluxDB 2.x
  • Raspberry Pi (for GPIO control)
  • Adafruit ADS1115 ADC (for current sensing)
  • JBD BMS (for battery monitoring)

Installation

  1. Clone the repository:
git clone <repository-url>
cd solar-monitoring
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Copy the configuration template and edit it:
cp config.ini.template config.ini
# Edit config.ini with your InfluxDB credentials

Configuration

The system uses a configuration file (config.ini) with the following sections:

[influxdb]

  • url: URL of your InfluxDB instance
  • org: Your InfluxDB organization name
  • token: Your InfluxDB authentication token
  • bucket: Name of the bucket to store data

[monitor]

  • interval: Polling interval in seconds (default: 60)

Running the System

To start the monitoring system:

python data_collector.py

The system will run continuously, collecting data every configured interval and sending it to InfluxDB. Use Ctrl+C to stop the system.

Data Collection

The system collects and stores the following measurements:

  • AC_Currents: AC current readings
    • Fields: line_in, charger, inverter
  • Battery: Battery status
    • Fields: voltage, current, soc, charge, capacity
  • Controllers: Controller states
    • Fields: inverter (0/1), charger (0/1)

Hardware Connections

  • AC Current Sensors: Connected to ADS1115 ADC
  • Battery Management System: Connected via UART
  • Inverter Control: Connected to GPIO 21
  • Charger Control: Connected to GPIO 12

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

My evaluation of AI coding assistants - Windsurf

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages