Giter Club home page Giter Club logo

voltage-divider's Introduction

Python Resistor Divider Calculator

This is a Python application to calculate the standard resistors values needed in a resistor divider to get the desired output voltage given the input voltage, the current flowing into the two resistors and the resistors tolerance.

Table of Contents

About

Python Resistor Divider Calculator (PRDC) calculate the standard resistors values needed in a resistor divider to get the desired output voltage given the input voltage, the current flowing into the two resistors and the resistors tolerance. Based on the resistors tolerance specified the resitors values will follow the standard "E series" values the following way:

  • 10 % -> E12
  • 5 % -> E24
  • 2 % -> E48
  • 1 % -> E96

The program iteratively searches for the resistors pair that minimizes the error on the output voltage with the constraint that the sum of the two resistors do not drain more current than specified.

It was made as an exercise to learn Python's OOP programming.

Getting Started

Prerequisites

PRDC is written in Python and uses numpy and argparse, so to be able to run the program you need to first install Python and then type the usual pip commands:

pip install numpy
pip install argparse

Installation

Clone the project

git clone https://github.com/simone-cominato/Resistor-Divider.git

And if you didn't already, install Python and the dependencies listed in Prerequisites

Usage

To learn how to use it type -h or --help

python ./resistor_divider_calculator.py --help
usage: resistor_divider_calculator.py [-h] Input Voltage Output Voltage Divider Current Resistors Tolerance

Find the correct resistors values to get the desired divide ratio.

positional arguments:
  Input Voltage        The voltage applied to the resistor divider
  Output Voltage       The desired voltage to the resistor divider output
  Divider Current      The current flowing into the divider's resistors
  Resistors Tolerance  The tolerance to use for the resistors

options:
  -h, --help           show this help message and exit

Contributing

If you wanto to contribute to this project please create an issue. Since it's a side project started for learning purpose issues will be fixed on a best effort basis.

License

Python Resistor Divider Calculator is licensed under the terms and conditions of the GPL-V3 license.

voltage-divider's People

Contributors

simone-cominato avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.