Skip to main content

🌞 M-Solutions Solar Calculator

A sophisticated solar system sizing calculator that helps users determine their solar power requirements with precision and ease. Solar Calculator Preview
💡 Pro Tip: Leverage this calculator to optimize your solar setup based on your unique energy consumption and local sunlight conditions.

📊 System Architecture

🗂️ Project Structure

src/
├── components/           # UI Components
   ├── SolarCalculator/    # Main calculator components
   ├── index.tsx         # Main component
   ├── InputForm.tsx     # User input form
   ├── Results.tsx       # Results display
   └── Visualization.tsx # Charts and graphs
   └── ui/               # shadcn/ui components
├── utils/               # Utility functions
   ├── pdfGenerator.ts    # PDF report generation
   └── calculations.ts    # Solar calculations
├── types/               # TypeScript definitions
└── hooks/               # Custom React hooks

🧮 Calculation Logic

Constants

  • Panel Power Rating: 550W (0.55kW)
  • Safety Factor: 1.3 (30% overhead for inverter sizing)

Battery Specifications

Lead-acid Batteries:
  • Depth of Discharge (DoD): 50%
  • Efficiency: 80%
Lithium-ion Batteries:
  • Depth of Discharge (DoD): 80%
  • Efficiency: 95%

Calculation Formulas

Solar Panel Sizing

Daily Energy Required (kWh) ÷ Peak Sun Hours = Required Solar Panel Capacity (kW)
Number of Panels = Ceiling(Required Capacity ÷ Panel Power Rating)

Battery Bank Sizing

Battery Bank Capacity = Daily Consumption × Autonomy Days
Adjusted Battery Capacity = (Battery Bank Capacity × 1000) ÷ (Battery Voltage × DoD × Efficiency)
Number of Batteries = Ceiling(Adjusted Capacity ÷ Individual Battery Capacity)

Inverter Sizing

Inverter Size = (Peak Load × Safety Factor) ÷ 1000

🚀 Getting Started

Clone the repository

git clone <repository-url>

Install dependencies

npm install

Start the development server

npm run dev
💡 Quick Tip: Customize your environment settings for the best performance in your local setup.

📱 Features

  • Responsive Design: Seamlessly works on desktops, tablets, and mobiles.
  • Real-time Calculations: Instant feedback as you adjust your inputs.
  • Interactive Charts: Visualize system performance with dynamic graphs.
  • PDF Reports: Download detailed reports of your solar system specs.
  • Smart Defaults: Pre-configured values for common solar setups.

🔄 Input Variables

VariableDescriptionImpact on Calculation
Daily ConsumptionTotal energy used per day (kWh)Determines overall system size
Peak LoadMaximum power draw at once (kW)Affects inverter sizing
Autonomy DaysBackup power duration (days)Influences battery capacity
Sunlight HoursAverage daily sun exposure (hours)Determines solar panel quantity
Battery TypeLead-acid or Lithium-ionAffects efficiency and capacity
System Voltage12V, 24V, or 48VImpacts overall system configuration

🛠️ Technical Stack

  • Frontend: React + TypeScript
  • Styling: Tailwind CSS + shadcn/ui
  • Charts: Recharts
  • PDF Generation: jsPDF
  • State Management: React Query
  • Build Tool: Vite

📄 License

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

🤝 Contributing

Contributions are welcome! Please review our contributing guidelines before submitting pull requests.
⚠️ Important: Ensure you enter accurate data to obtain reliable solar sizing calculations.
Made with ☀️ and 🌱 by BrianKN019

📧 Contact

For questions or feedback, reach out: 📨 Email: [email protected] 🌐 Portfolio: Brian Kimemia GitHub: BrianKN019
Thank you for exploring this project! Let’s innovate and build secure AWS solutions together. 🚀