Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

A Simple Ohmmeter - Design Dillema

  1. Sep 21, 2012 #1
    I've been design a simple ohm-meter which can measure resistances in the range 0.001 to 100 Ohms. I am aiming for an accuracy of 3%.

    Here's the circuit (so far):


    The circuit is basically a programmable current source which can source a current of 100, 10 or 1 mA. At junctions Va and Vb (right hand side of the circuit), I aim to connect a 500 gain instrumentation amplifier (monolithic). The issue is that I cannot connect Vb directly to ground as any rail-to-rail will have a limit on it's input. I believe a good in. amp will typically required it's input to be at least 100 mV above ground. The in. amp drives a 12-bit ADC.

    To solve this, I inserted R5. However, at different currents R5 will have to be different. I'd like to drop approx. 100 mV across R5 just to be safe. Assume R5 is 100 Ohms. At a current of 1 mA, R5 will drop 100 mV. However, at a current of 100 mA, R5 will have to drop 10 V(!) - which is obviously not possible.

    I have two solutions to this issue. I can either switch out R5 using additional MOSFETs or whatis perhaps simpler, is to remove R5 and it replace it with a schottky diode. I think a schottky would be better because it would have a lower forward voltage drop. The Vf would vary with the current but only slightly. As long as it's above 100 mV, I think we should be OK.

    What solution should I go for? Will I be introducing any errors with the schottky?
  2. jcsd
  3. Sep 21, 2012 #2


    User Avatar
    Science Advisor
    Gold Member

    Replace R5 with an NPN with the emitter grounded and the base and collector tied together. It should do the trick I would think. Maybe a bit more consistent than a schottky although a slightly higher voltage drop. I don't see that as a problem though. You have plenty of room if your top resistance measured is 100 ohms. What you choose as a 5 volt regulator will have a significant impact on accuracy. Also, the base current of Q1 will add in to the collector current and give you an error. I assume you will measure voltage with the ins. amp and divide that by either 1, 10 or 100 mA. While the collector current is 1, 10, or 100 mA, the emitter current will be that plus the base current. I'd try a darlington for Q1 if you stay with this scheme.
    Edit: Upon looking at this again I noticed that the feedback scheme is wrong. When the power is first applied with no test resistor in place the inverting input of the op-amp will go to 5 volts and the non-inverting input will be someplace below that no matter which range you are in. The output will go to zero and no matter what you put in for a test resistor it will not change. If the circuit is powered up with a zero ohm test resistor the output of the op-amp may go to 5 volts in which case you may see some smoke. I think you can fix this by swapping the inputs on your op-amp.
    Last edited: Sep 21, 2012
  4. Sep 21, 2012 #3


    User Avatar

    As you're planning on using an instrumentation amp, which is differential, to do the Vab measurement I think you're fine with any diode.

    Do you have a plan to calibrate? If not I doubt you'll make the 3% accuracy requirement in every range.

    Also remember, the tolerance of the 5V supply is in your error budget. So even if you calibrate at start-up or something that supply needs to not move to hold the accuracy over time.
  5. Sep 22, 2012 #4

    Got it: Replace Q1 with a darlington. Makes sense. Your second point, regarding changing the swapping the inputs of the op-amp confuses me. This is my first analogue circuit (I have designed and implemented digital circuits before). My question is, why would the circuit be better if I simply swap the inputs?

    If there is no test resistor than V- will be at 5V. Because V- is at 5V, wouldn't the op-amp also try to bring V+ to 5V but be unable to as it's feedback cannot do anything for V+? Why would the output be 0 V and why would it get stuck there?

    When there is a zero ohm test resistor, the circuit should have no problem dropped 1 V across R1 (I say 1 V because the controller will select this range as it would have been detecting ~0 at the ADC for any other range). Hence, the current would be 100 mA. There would no drop at the test resistor about 200 mV or so at the diode/bjt. Rest of the volage should be on the Collector-Emitter of Q1. Am I way off the mark here? Why would I see smoke?

    Yes, we only plan on building a few units so calibration is easy. I understand what you mean by the regulator. The regulator must not sag as the current range is changed from, say, 1 mA to 100 mA. The other point about the regulator is that it should have high PSRR.

    I'm thinking that a 1 A regulator would not sag as it would only be under 100 mA load max (1/10th rated load). Another option is that I could measure how much the regulator sags for each range and take that into account with the software.

    For the 12-bit ADC and the instrumentation amplifier, I'm considering a separate 25 mA ultra high PSRR (90 db) regulator. This would ensure that even if the volage sags a bit on the other regulator, the ADC's reference doesn't change at all (we're going for a simple ADC whose reference is tied to VCC).
  6. Sep 22, 2012 #5


    User Avatar
    Science Advisor

    Because the BJT will invert your signal from base to collector, making your overall feedback +ive instead of negative. It cannot work in it's present form.

    Another option would be to replace the npn with a pnp and reverse the collector and emitter to make it a cc instead of ce in the feedback loop. This would be my first choice.
  7. Sep 22, 2012 #6


    User Avatar
    Science Advisor
    Gold Member

    Concerning what I took the liberty of putting in bold: You will see smoke because as UART described you have an overall positive feedback and this causes the op-amp to swing all the way one way or the other and stay there. In the case of a shorted test resistor the output of the op-amp will swing positive causing the collector voltage to drop which causes the output of the op-amp to swing more positive and over and over until it is maxed out. Now you have the op-amp trying to put max voltage across the base emitter junction of the transistor.
  8. Sep 22, 2012 #7
    uart and averagesupernova,

    Thank you very much for that explanation. I simulated the circuit in LTSpice and you were right - the ckt doesn't work. I think I missed the fact that an NPN would cause the feedback to be positive instead of negative.

    One question, however, does this handle the case of no test resistor at all? In the simulation it doesn't. In the sim, the op-amp is driving the transistor very hard. So much so that it's sinking a lot of current from it's base (in the order of 20+ mA). But perhaps the most curious thing is that V- does not go to +5V.

    Note that I didn't remove the resistor in the sim. I changed it to a value of 1K and 10M. Both results were the same.

    However, if I switch the inputs of the op-amp and use an NPN the circuit works fine. It works when there is a zero ohm resistance and also when there's no test resistor.
    Last edited: Sep 22, 2012
  9. Sep 22, 2012 #8


    User Avatar
    Science Advisor
    Gold Member

    Not sure exactly what you mean here. What configuration do you have everything when this happens? Maybe an updated schematic would be helpful.
  10. Sep 23, 2012 #9
    Here we go... sorry I didn't supply a schematic earlier.


    Note, Q1 is now a generic PNP transistor. In the LTspice sim. This circuit works when there is a zero ohm test resistor but when there is an open circuit present at the test resistor the current flows through R1, through the emitter and goes into the base of Q1. From there, the op-amp is sinking all of this current. None of the current makes it to the collector.

    The voltage at the emitter of Q1 is around 4.8V and the collector is at 0V. As I see it, if there is an open circuit present after the emitter then the emitter ought to be around 5V.

    However, if I change Q1 back to an NPN but also swap the op-amp inputs the circuit works perfectly in the simulation. When there is no test resistor, the circuit draws no current. When there is a short circuit, the circuit provides the rated current(100 mA or whatever range is selected).

    Side question: You recommend I should go with a darlington because the op-amp would require less base current and hence there would be less of an error at the load. However, what if I use a MOSFET?

    The high input resistance means there would be basically be zero current into the gate and the MOSFET would basically be controlled by the output voltage of the op-amp. However, would the relatively high gate capacitance cause stability problems for the op-amp?
  11. Sep 23, 2012 #10


    User Avatar
    Science Advisor
    Gold Member

    Ok, that is what I thought you had done. When the collector is left open any current going into the emitter will have to go out the base. The way the circuit is set up this is what I would expect. The emitter will be as far down from 5 volts as the op-amp is able to pull it through the base-emitter junction. I don't know why the sim would show the collector at 0 in this case, that seems just wrong. I thought UART had a good suggestion with the PNP but I didn't see this coming. That is what electrical engineering is all about. There are tradeoffs in every situation. Try the MOSFET idea. I am not that familiar with using them other than in power switching applications so I didn't want to suggest it before. One thing you could try with the PNP is to insert a base series resistor to prevent excessive current coming out of the op-amp. Under normal operation it certainly won't matter especially if you use a darlington pair. If you are concerned with gate capacitance you can use a series resistor in series with the gate as well since op-amps don't like capacitive loads. BUT, a general design rule of mine is to keep as much capacitance as possible out of negative feedback loops. It can turn negative feedback into positive at certain frequencies and cause hunting/oscillations. This is why it is a good idea to put the test resistor in the collector as you have done since any capacitance that ends up there will affect the feedback loop less than if it were in the emitter.
    Last edited: Sep 23, 2012
  12. Sep 23, 2012 #11


    User Avatar
    Science Advisor

    He just needs a base resistor to let the thing saturate gracefully when it is unable to supply the reference current into the given load.

    Edit. Whoops I didn't read far enough, you already said that two sentences later.:redface:
  13. Sep 23, 2012 #12


    User Avatar
    Science Advisor

    I agree, I was thinking mosfet too. It would solve the saturation current problem and also eliminate the [itex]\frac{\beta}{\beta + 1}[/itex] inaccuracy. The only issue is being sure to choose one with a low enough threshold that is consistent with the 5V supply. Something with a threshold voltage less than 3 volts should work here.
    Last edited: Sep 23, 2012
  14. Sep 23, 2012 #13
    Thanks uart and averagesupernova. Im going to try and build this circuit a bit before I commit to the design.

    One question about the MOSFET: you state I need one with low threshold voltage and that I completely understand. However, normally, a MOSFET's source is tied to ground and the gate voltage needs to be above the source for the MOSFET to turn on. This can problematic in high-side switches as in a H-Bridge but in this case we're not turning the MOSFET fully on normally.

    Since I'm dropping some voltage on the test resistor and some on the diode I'm guessing that this is why you specify a threshold of 3V and not 5V? Assuming the source of the MOSFET is at 2V, the op-amp just needs to provide 5V (3V relative to the source) at the gate to turn the MOSFET fully on - something a rail-to-rail op-amp should do easily.

    If I use a N-Channel MOSFET, I assume that it would also invert the feedback loop? So I have a choice between a P-Channel MOSFET and an N-Channel one?
  15. Sep 23, 2012 #14


    User Avatar
    Science Advisor

    If you kept your original design (as per opening post) and just reversed the op-amp inputs then you could use an n-channel mosfet. In this case unfortunately the mosfet threshold could be particularly problematic.

    With the revised pnp design however you could replace the pnp transistor with a p-channel mosfet fairly easily. The source voltage is 4.0V or greater, so depending on how close the OP-amp output can swing toward the negative rail you should be able to get |Vgs| around 3 to 4 volts. A nice low threshold voltage of about 2 volts would be ideal.
  16. Sep 26, 2012 #15
    So after looking at both PNPs and P-Channel MOSFETs, I think I'll go with the MOSFET variation.

    But I've run into another problem here and am looking for advice. The cable that I'm measuring can be upto 500m long. This in itself isn't a problem but the cable picks up all sorts of noise. There are 50 Hz components and also RF components to this interference.

    To solve this, I was recommended a double pole RC filter (one pole for LF and another for HF) at both inputs of the op-amp. This takes care of my problem quite well.

    However, this made me realize that I'm connecting my very noisy cable to my ground plane just through a diode. Will this noise get into my ground plane, through the wire, and wreak havoc there?
  17. Sep 28, 2012 #16


    User Avatar
    Science Advisor
    Gold Member

    The first thing I would do in a case like this is redesign so that test resistor is a balanced load. This means each lead has the same impedance to ground. Your simple ohmeter is no longer so simple.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: A Simple Ohmmeter - Design Dillema
  1. Simple intercom (Replies: 8)

  2. Simple railgun (Replies: 8)

  3. Series-type ohmmeter (Replies: 22)