Skip to content

Repository files navigation

Solar Mining Simulator

A simulation environment for developing and testing dynamic control systems for off-grid solar-powered ASIC cryptocurrency mining operations.

Overview

Running ASIC miners on solar power presents unique challenges due to intermittent energy generation. This simulator models the complex interplay between:

  • Fluctuating solar generation (day/night cycle, cloud cover)
  • Battery storage with degradation modeling
  • ASIC miner power management and efficiency curves
  • Base infrastructure loads

The goal is to develop intelligent controllers that maximize mining profitability while protecting equipment.

Features

  • Solar Panel Simulation: Configurable max output, day/night cycle, cloud cover modeling
  • Battery Model: Accurate kWh energy flow, SoC tracking, charge/discharge limits, voltage simulation, wear calculation
  • ASIC Miner Model: Power range control, efficiency curves (underclocking benefits), cooldown periods, hashrate calculation
  • Pluggable Controllers: Easy to implement and test new control strategies
  • PySide6 GUI: Real-time Plotly charts, system status monitoring, save/load state

Requirements

pip install PySide6 numpy plotly pandas PySide6-WebEngine

Usage

python main.py

Use the GUI to:

  • Configure simulation parameters
  • Select controller logic
  • Start/pause/reset simulation
  • Monitor real-time metrics (SoC, hashrate, power flows)
  • Save/load simulation states

Controller Development

Controllers are defined in controller.py. To add a new strategy:

  1. Define a function that accepts SimulationState and returns power decisions for each miner
  2. Add it to CONTROLLER_MAP
  3. Select it from the GUI dropdown

The advanced_controller includes:

  • Solar trend prediction
  • Dynamic power buffering
  • Efficiency-based allocation
  • Runtime load balancing

Project Structure

minesimulator/
├── main.py          # Entry point
├── gui.py           # PySide6 GUI with Plotly charts
├── simulation.py    # Core simulation logic
├── controller.py    # Control strategies
└── utils.py         # Constants, helpers, efficiency curves

Key Optimization Goals

  1. Maximize solar utilization - Use all available solar for mining
  2. Maximize profitability - Leverage underclocking efficiency gains
  3. Protect batteries - Minimize unnecessary cycling
  4. Protect miners - Prevent flapping (frequent power changes)
  5. Ensure stability - Balance generation and consumption in real-time

About

Solar-powered bitcoin mining profitability simulator — model energy costs and mining returns

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages