Connect with us

voltage divider with multiple resistors

Discussion in 'General Electronics Discussion' started by stephan, Dec 13, 2013.

Scroll to continue with content
  1. stephan

    stephan

    2
    0
    Dec 13, 2013
    Hi,

    I'm trying to build a book, with removable pages. When you remove a page I want to be able to detect that a page has been removed/ripped out and also which page has been removed. From my teacher, I have been given the advice of using a voltage divider (http://en.wikipedia.org/wiki/Voltage_divider) with multiple resistors. So it would look like the following: help-book-rip-pages.png

    The red lines are the pages, the black parts should be in the book's spine. When you rip out a page, this part of the circuit is not closed anymore and the resistor is not used.



    I understand the general idea, although I don't understand how it works exactly. Most importantly, I don't understand how it would work for multiple resistors.

    e.g. there is one example with 2 resistors (one is the "pull-up" and one the divider)

    [​IMG]

    so, how would V_out be calculated for multiple resistors such as R2, R3, R4. I tried out the following formula, but building the circuit yielded different results for V_out. Additionally, I don't understand why the resistance of resistors that are put in parallel would be summed up, when determining the voltage of a certain point.

    V_out = R_2 / (R_1 + R_2 + R_3 + R_4) * V_in



    I'm looking for a formula how to calculate V_out for multiple resistors, so I can pick resistors yielding a close to uniform distribution for V_out
     
  2. stephan

    stephan

    2
    0
    Dec 13, 2013
    got it working, I also created a javascript script for it to calculate voltages for different resistor combinations

    resistors = [
    220,
    560,
    1000,
    4700,
    10000,
    1000000,
    10000000
    ];

    voltage_in = 5;
    pull_up = 1000;


    function getVoltageOut(numberOfResistors, resistorsTakenOut) {
    resistorsTakenOut = resistorsTakenOut || [];
    var sum = pull_up;
    for(var i=0; i<numberOfResistors; i++) {
    if(resistorsTakenOut.indexOf(i) === -1) {
    sum *= resistors;
    }
    };
    return pull_up / sum * voltage_in;
    }

    var numberOfResistors = 4;
    var getVoltageOutForResistors = getVoltageOut.bind(null, numberOfResistors);
    var maxEncoding = Math.pow(2, 4);

    for(var i = 0; i < maxEncoding; i++) {
    var resistorsTakenOut = [];
    var encoding = i;
    var voltage;
    var strEncoding = '';
    //console.log('encoding '+encoding);

    if(encoding%2 == 1) {
    resistorsTakenOut.push(0);
    strEncoding += '1';
    } else {
    strEncoding += '0';
    }

    encoding = Math.floor(encoding / 2);
    if(encoding%2 == 1) {
    resistorsTakenOut.push(1);
    strEncoding = '1' + strEncoding;
    } else {
    strEncoding = '0' + strEncoding;
    }

    encoding = Math.floor(encoding / 2);
    if(encoding%2 == 1) {
    resistorsTakenOut.push(2);
    strEncoding = '1' + strEncoding;
    } else {
    strEncoding = '0' + strEncoding;
    }

    encoding = Math.floor(encoding / 2);
    if(encoding%2 == 1) {
    resistorsTakenOut.push(3);
    strEncoding = '1' + strEncoding;
    } else {
    strEncoding = '0' + strEncoding;
    }


    //console.log('strEncoding '+strEncoding);
    voltage = getVoltageOutForResistors(resistorsTakenOut);
    console.log(strEncoding+' : '+voltage+ ' V');
    }
     
  3. mursal

    mursal

    75
    0
    Dec 13, 2013
    The page resistors are in parallel, so the overall resistance of the pages (Rpages) will increase when you pull a page out.

    So, Rpages = 1/Rpages = 1/R1 + 1/R2 + 1/R3 + 1/Rn ........................
    Where R1, R2, etc are page resistors and you can have as many pages as you like up to Rn

    So for a given number of pages Vout = (Rpullup / Rpullup + Rpages) Vin

    Hope this helps
     
    Last edited: Dec 13, 2013
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-