A comprehensive C# library for electrical engineering and electronics calculations. Compatible with .NET Framework 4.5+, .NET Core 3.1+, .NET 6.0+, .NET 8.0+, .NET 9.0+, and .NET Standard 2.0+.
$ dotnet add package CircuitToolA comprehensive C# library for electrical engineering and electronics calculations
CircuitTool is a modern, high-performance library that provides utilities for circuit analysis, power calculations, unit conversions, microcontroller development, and much more. Designed for engineers, students, and developers working with electronic systems.
Install CircuitTool via NuGet Package Manager:
# .NET CLI
dotnet add package CircuitTool
# Package Manager Console
Install-Package CircuitTool
# PackageReference (add to .csproj)
<PackageReference Include="CircuitTool" Version="2.1.0" />
using CircuitTool;
// 🧮 Ohm's Law calculations
double voltage = OhmsLawCalculator.Voltage(current: 2.0, resistance: 100); // 200V
double power = PowerCalculator.Power(voltage: 12.0, current: 2.0); // 24W
// 🔧 LED current limiting resistor
double resistor = LEDCalculator.CalculateResistorValue(
supplyVoltage: 5.0,
ledVoltage: 2.1,
ledCurrent: 0.02 // 20mA
); // 145Ω
// 📡 AC circuit analysis
double reactance = CapacitorCalculator.CapacitiveReactance(
frequency: 1000, // 1kHz
capacitance: 1e-6 // 1µF
); // ~159Ω
// 🤖 Arduino development
double analogVoltage = ArduinoTools.AnalogToVoltage(512); // 2.5V
string gpioCode = ArduinoTools.GenerateGPIOCode(pin: 13, mode: "OUTPUT");
// 📊 Advanced analysis
var noiseAnalysis = NoiseCalculator.ThermalNoise(resistance: 1000, temperature: 25);
var powerEfficiency = PowerCalculator.Efficiency(inputPower: 100, outputPower: 85);
| Resource | Description | Link |
|---|---|---|
| 📖 API Documentation | Complete API reference with examples | API Docs |
| 🚀 Getting Started | Step-by-step tutorial guide | Getting Started |
| 💻 Interactive CLI | Command-line interface guide | CLI Documentation |
| 🏗️ Architecture Guide | Project structure and modules | Code Map |
| 🔧 Hardware Guides | Platform-specific tutorials | Hardware Docs |
| 📋 Examples | Real-world usage examples | Examples |
| 🎓 Tutorials | Learning materials | Tutorials |
Explore CircuitTool capabilities with the interactive command-line interface:
# 🎯 Interactive mode (guided menu)
CircuitTool.CLI
# 🧮 Direct calculations
CircuitTool.CLI basic ohms --voltage 12 --current 2
CircuitTool.CLI component led --supply 5 --forward 2.1 --current 0.02
CircuitTool.CLI ac impedance --resistance 100 --reactance 50
# 📊 Performance testing
CircuitTool.CLI benchmark --iterations 10000
CircuitTool.CLI performance --test vectorized
// Power supply design
var powerSupply = PowerCalculator.DesignLinearRegulator(
inputVoltage: 12.0,
outputVoltage: 5.0,
loadCurrent: 1.0
);
// Component tolerance analysis
var tolerance = ToleranceCalculator.WorstCaseAnalysis(
nominalValues: new[] { 100, 200, 300 },
tolerances: new[] { 0.05, 0.01, 0.02 }
);
// ESP32 power optimization
var batteryLife = ESP32Tools.CalculateBatteryLife(
batteryCapacity: 2000, // mAh
activeCurrentMA: 160,
sleepCurrentUA: 10,
activeTimePercent: 1
);
// Communication protocol analysis
var uart = UARTCommunicationCalculator.CalculateTiming(
baudRate: 115200,
dataBits: 8,
stopBits: 1
);
CircuitTool is organized into focused, cohesive modules for maximum usability:
| Module | Classes | Purpose | Key Features |
|---|---|---|---|
| 🧮 Calculators | 23 | Core electrical calculations | Ohm's Law, Power, Components, Filters |
| 🔧 Hardware | 10 | Platform-specific tools | Arduino, ESP32, RPi, Code generation |
| 📊 Analysis | 5 | Advanced engineering analysis | Signal integrity, EMC, Thermal |
| ⚡ Performance | 6 | Optimization & efficiency | Vectorization, Caching, Async |
| 📚 Documentation | 4 | Examples & learning materials | Tutorials, Interactive guides |
| 🔢 Math | 2 | Mathematical operations | Matrix operations, FFT/DFT |
| 💾 Serialization | 1 | Data persistence | JSON/XML circuit export |
| 📏 Units | 3 | Measurement systems | Voltage, Current, Resistance units |
Input Parameters → Validation → Core Calculation → Unit Conversion → Result
↓ ↓ ↓ ↓ ↓
User Values → Range Check → Algorithm → Format → Typed Output
For detailed architecture information, see the Project Code Map.
dotnet add package CircuitTool
# Requires GitHub authentication
dotnet add package CircuitTool --source https://nuget.pkg.github.com/jomardyan/index.json
We welcome contributions! Here's how to get involved:
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)See GitHub Releases for complete changelog.
This project is licensed under the MIT License - see the LICENSE file for details.
For more information, visit the GitHub repository or check out the Getting Started Guide.