CircuitTool 2.2.1
dotnet add package CircuitTool --version 2.2.1
NuGet\Install-Package CircuitTool -Version 2.2.1
<PackageReference Include="CircuitTool" Version="2.2.1" />
<PackageVersion Include="CircuitTool" Version="2.2.1" />
<PackageReference Include="CircuitTool" />
paket add CircuitTool --version 2.2.1
#r "nuget: CircuitTool, 2.2.1"
#:package CircuitTool@2.2.1
#addin nuget:?package=CircuitTool&version=2.2.1
#tool nuget:?package=CircuitTool&version=2.2.1
๐ CircuitTool
A 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.
โจ Features
๐งฎ Core Electrical Calculations
- Ohm's Law & Power: Voltage, current, resistance, and power calculations
- Component Analysis: Resistors, capacitors, inductors, transformers
- Circuit Networks: Series/parallel combinations, voltage dividers
- Unit Conversions: Comprehensive electrical units system
๐ง Component Design & Analysis
- LED Design: Current limiting resistors, brightness calculations
- Filter Design: RC/RL low-pass, high-pass, band-pass filters
- Power Systems: Efficiency, regulation, transformer calculations
- Tolerance Analysis: Worst-case and statistical analysis
๐ก AC Circuit Analysis
- Impedance & Reactance: Inductive and capacitive reactance
- Frequency Response: Magnitude and phase calculations
- Resonance: RLC circuit resonant frequency analysis
- Power Factor: Real, reactive, and apparent power
๐ค Hardware Platform Support
- Arduino: Pin configuration, ADC/PWM, code generation
- ESP32: WiFi power calculations, GPIO management
- Raspberry Pi: GPIO control, hardware interface tools
- General MCU: Universal microcontroller utilities
๐ Advanced Analysis
- Signal Integrity: Transmission line analysis, crosstalk
- EMC Compliance: Electric field strength, shielding effectiveness
- Thermal Management: Heat transfer, junction temperature
- Performance: Vectorized calculations, caching, async operations
๐ป Development Tools
- Interactive CLI: Command-line interface for testing and learning
- Code Generation: Hardware-specific code templates
- Data Export: Circuit serialization (JSON/XML)
- Documentation: Comprehensive examples and tutorials
๐ Quick Start
Installation
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" />
Platform Support
- .NET Framework: 4.5, 4.6.2, 4.8.1+
- .NET Core: 3.1+
- .NET: 6.0+, 8.0+
- .NET Standard: 2.0, 2.1
Basic Usage Examples
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);
๐ Documentation & Resources
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 |
๏ฟฝ Interactive CLI
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
๐ฏ Quick Examples
Electronics Design
// 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 }
);
Embedded Development
// 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
);
๐๏ธ Architecture & Module Overview
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 |
๐ Calculation Flow
Input Parameters โ Validation โ Core Calculation โ Unit Conversion โ Result
โ โ โ โ โ
User Values โ Range Check โ Algorithm โ Format โ Typed Output
๐ฏ Design Principles
- Type Safety: Strong typing with unit-aware calculations
- Performance: Vectorized operations and intelligent caching
- Extensibility: Plugin architecture for custom calculators
- Cross-Platform: Consistent behavior across all supported frameworks
- Documentation: Comprehensive XML docs and examples
For detailed architecture information, see the Project Code Map.
๐ฏ Common Use Cases
Electronics Design
- LED current limiting resistor calculations
- Power supply design and analysis
- Component tolerance and worst-case analysis
- EMC compliance verification
Embedded Development
- Arduino/ESP32 pin configuration and code generation
- Power consumption optimization
- Communication protocol (I2C/SPI/UART) analysis
- Battery life estimation
Education & Learning
- Interactive tutorials and examples
- Step-by-step calculation guidance
- Performance benchmarking and testing
- Real-world circuit analysis
Industrial Applications
- Power factor correction calculations
- Energy consumption monitoring
- Signal integrity analysis for high-speed designs
- Thermal management calculations
๐ฆ Package Distribution
NuGet.org (Primary)
dotnet add package CircuitTool
- Package URL: https://www.nuget.org/packages/CircuitTool
- Latest Version: 2.0.0
- Total Downloads:
GitHub Packages (Secondary)
# Requires GitHub authentication
dotnet add package CircuitTool --source https://nuget.pkg.github.com/jomardyan/index.json
๐ค Contributing
We welcome contributions! Here's how to get involved:
Quick Contribution Guide
- ๐ด Fork the repository
- ๐ฟ Create a feature branch (
git checkout -b feature/amazing-feature
) - โจ Add your changes with tests and documentation
- ๐ Commit your changes (
git commit -m 'Add amazing feature'
) - ๐ Push to the branch (
git push origin feature/amazing-feature
) - ๐ Open a Pull Request
Development Guidelines
- Follow C# coding standards and conventions
- Add XML documentation for all public methods
- Include unit tests for new functionality
- Update documentation with usage examples
- Ensure cross-platform compatibility
Areas for Contribution
- ๐งฎ New Calculators: Specialized calculation modules
- ๐ง Hardware Support: Additional microcontroller platforms
- ๐ Analysis Tools: Advanced simulation capabilities
- ๐ Internationalization: Multi-language support
- ๐ Documentation: Examples, tutorials, and guides
๐ Version History
Version 2.0.0 (Current)
- ๐ Modern C# Features: Records, pattern matching, init-only properties
- ๐ API Redesign: Consistent naming, better separation of concerns
- โ๏ธ Dependency Injection: Service-based architecture, plugin system
- ๐ Integration: Extension methods for UI frameworks, scientific computing
- ๐ฑ Mobile Support: Xamarin/MAUI optimizations, offline calculations
- โก Performance: SIMD/vectorized calculations, enhanced caching
Previous Versions
- 1.x Series: Core electrical calculations, basic hardware support
- 0.x Series: Initial proof-of-concept and foundational features
See GitHub Releases for complete changelog.
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
License Summary
- โ Commercial Use: Use in commercial projects
- โ Modification: Modify the source code
- โ Distribution: Distribute the library
- โ Private Use: Use in private projects
- โ Liability: No warranty or liability
- โ Trademark: No trademark rights included
๐ Support & Community
Get Help
- ๐ Documentation: Check DOCUMENTATION.md and Getting Started
- ๐ Issues: Report bugs or request features on GitHub Issues
- ๐ฌ Discussions: Join community discussions on GitHub Discussions
Contact
- ๐ง Email: Create an issue for general inquiries
- ๐ฆ GitHub: @jomardyan
For more information, visit the GitHub repository or check out the Getting Started Guide.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 is compatible. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCoreApp 3.1
- System.IO.Ports (>= 8.0.0)
- System.Numerics.Vectors (>= 4.5.0)
- System.Text.Json (>= 8.0.5)
-
.NETFramework 4.5
- Microsoft.Bcl.Async (>= 1.0.168)
- System.Numerics.Vectors (>= 4.5.0)
- System.ValueTuple (>= 4.5.0)
-
.NETFramework 4.6.2
- System.IO.Ports (>= 8.0.0)
- System.Numerics.Vectors (>= 4.5.0)
- System.ValueTuple (>= 4.5.0)
-
.NETFramework 4.8.1
- System.IO.Ports (>= 8.0.0)
- System.Numerics.Vectors (>= 4.5.0)
- System.ValueTuple (>= 4.5.0)
-
.NETStandard 2.0
- System.IO.Ports (>= 8.0.0)
- System.Numerics.Vectors (>= 4.5.0)
- System.Text.Json (>= 8.0.5)
-
.NETStandard 2.1
- System.IO.Ports (>= 8.0.0)
- System.Numerics.Vectors (>= 4.5.0)
- System.Text.Json (>= 8.0.5)
-
net6.0
- System.IO.Ports (>= 8.0.0)
- System.Text.Json (>= 8.0.5)
-
net8.0
- System.IO.Ports (>= 8.0.0)
- System.Text.Json (>= 8.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v2.2.0: Major documentation overhaul with professional DocFX integration, comprehensive learning paths, modern navigation, and 98% clean builds. Complete backward compatibility maintained. See https://github.com/jomardyan/CircuitTool/releases for full details.