CircuitTool 2.2.1

dotnet add package CircuitTool --version 2.2.1
                    
NuGet\Install-Package CircuitTool -Version 2.2.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CircuitTool" Version="2.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CircuitTool" Version="2.2.1" />
                    
Directory.Packages.props
<PackageReference Include="CircuitTool" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CircuitTool --version 2.2.1
                    
#r "nuget: CircuitTool, 2.2.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CircuitTool@2.2.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CircuitTool&version=2.2.1
                    
Install as a Cake Addin
#tool nuget:?package=CircuitTool&version=2.2.1
                    
Install as a Cake Tool

๐Ÿ”Œ CircuitTool

Build Status NuGet Version NuGet Downloads GitHub Release License: MIT

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

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

  1. ๐Ÿด Fork the repository
  2. ๐ŸŒฟ Create a feature branch (git checkout -b feature/amazing-feature)
  3. โœจ Add your changes with tests and documentation
  4. ๐Ÿ“ Commit your changes (git commit -m 'Add amazing feature')
  5. ๐Ÿš€ Push to the branch (git push origin feature/amazing-feature)
  6. ๐Ÿ”„ 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

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.2.1 92 6/27/2025
2.2.0 82 6/27/2025
2.1.0 118 6/27/2025
2.0.0 127 6/26/2025
1.0.13 127 6/26/2025
1.0.11 129 6/26/2025
1.0.7 128 6/26/2025
1.0.5 126 6/26/2025
1.0.4 127 6/26/2025
1.0.3 127 6/26/2025
1.0.2 127 6/26/2025
1.0.1 134 6/26/2025
1.0.0 134 6/26/2025

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.