Maker Pro
Maker Pro

[HELP] Op-Amp used in resistance detection circuit.

Boltar

Nov 18, 2013
12
Joined
Nov 18, 2013
Messages
12
Hi and thanks for reading my post.

I am currently working on a project that requires me to detect very low resistances in the range of 0 to 10 ohms and I need to do this with an op-amp and arduino. The load being tested MUST be connected to the ground rail (no exceptions). Any ideas on how to arrange this?

Kind regards,
Marc
 
Last edited:

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
That looks quite good but R5 is not necessary.

The output will not be linear since the current will depend on R4. This could be taken care of by calculation.

An alternative method would be to use a constant current power supply of 40mA giving 0.4V with a 10 ohm resistor. Would this give sufficient resolution without the op-amp?
 

Boltar

Nov 18, 2013
12
Joined
Nov 18, 2013
Messages
12
Thanks, I'll investigate constant current sources.
 
Last edited:

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Using a constant current source followed by an op-amp to amplify that by a factor of 10 you would get 0 to 4 volts giving you a wider range. At this point I would either reduce the current or the gain so that the input to the arduino has a range from 0 to 800 counts. This will give you simple calculations and a resolution of 1/80 ohms.

You need an op amp which can run from a 5v supply, allows the inputs to go to the negative supply rail, and which can pull its output as close as possible to the negative supply. (note that op amps which run from a single supply refer to the negative rail as ground)
 
Last edited:

Boltar

Nov 18, 2013
12
Joined
Nov 18, 2013
Messages
12
Thanks, I'll attempt to source a suitable op-amp.
 
Last edited:

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
There are lots of op-amps and I am not up to speed with them.

A constant voltage supply holds the voltage constant regardless of the current draw.

A constant current supply holds the current constant regardless of the voltage necessary.

There is obviously a limit what can be done. An LM317T constant voltage chip wired as a constant current source should be able to output up to 1A at up to 2V from 5V. All you have to do is fit a resistor that drops 1.25V with the current you want.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
because I have no idea what a constant current power supply is ;)

Edit: Is a constant current supply one that adjusts the voltage depending on the resistance of the load in order to keep the current across that load constant?
[/quote]

You say that, yet you showed that you can figure it out for yourself. In fact I think you grasped to concept very quickly.

Added to that, there are well known circuits using op-amps (and others using discrete components) which can give you the constant current you need without having to understand a great deal.

As for the Op-Amp I need, what you said also went beyond me. I think I'll just leave it and send it off to a company for design, there's literally hundreds of different Op-Amps out there and I have no clue what I'm looking for, I don't even understand the terminology yet.

There are a lot of concepts to grasp. However the ones you need for this are not that exhaustive.

Conceptually, an op-amp is a perfect device having certain unachievable characteristics which allows it to flawlessly perform a number of tasks.

Practically, op-amps are imperfect and different designs have different limitations and deviations from the theoretically perfect device.

The ones that are important to you are that:

a) it can operate from a single 5V supply.
b) the input common mode range includes ground (don't worry too much about this other than it means the op-amp will work with both inputs grounded)
c) the output pulls very close to ground.

An LM358 might do the trick. I think the main limitation will be the fact that it can only pull the output down to within 20mV of the ground rail (maybe a little better).

If you are going for a count of 0 to 800 (corresponding to 0 to 3.906V) then 20 mV corresponds to a count of 4, which is (assuming full scale is 10 ohms) is 0.1 ohm.

That's probably not good enough.

I need to ask. Why are you doing this? If it's to measure low resistances then there are devices you can purchase cheaper than getting someone to design and build them.
 

Boltar

Nov 18, 2013
12
Joined
Nov 18, 2013
Messages
12
Thanks, that resolution is good enough. That seems ok.
 
Last edited:

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Lol, I was just looking at an LM358 on HT's site. The only thing that confused me was the 20mA per channel source. If I guessed right, that means the max current applied to the +IN of the op-amp? In which case, my circuit just goes above that, 21-22mA, although I could increase R3 and R2 a little I suppose.

No, that is the maximum current that can flow to ground from the output. You should not need to get anything close to that.

The inputs themselves draw almost zero current.

The circuit is going to be used to detect the resistance of a heating coil in an electronic cigarette. These coils are generally between 1 ohm and 4 ohm, but in some cases can get as low as 0.5 or as high as 10, only very rarely do people use coils lower than 0.5 unless they are total nutters. So the inability to detect 0.1 or below is not really an issue in this application, so that's perfectly fine. (In fact anything lower than 0.2 would be recognized as a short) think the LM358 will fit the job. I can use programmatic tricks to adjust and calibrate using a very sensitive meter I have for comparison.

Many thanks to everyone for their help and advice.

Sounds like the 358 will do the job for you. It's a dual op-amp, so you may be able to use the other one to make a current source.

You will note that the 358 can only source 20mA. That's not a problem... You use a transistor to source most of that, with the LM358 supplying only a very small current to control the transistor.

EDIT: Ahhh, now I get it. A constant current supply is basically a voltage regulator wired differently.[/QUOTE]

It can be. Generally current regulators keep a voltage across a sense resistor constant (that means the current through the sense resistor is constant) although there are other ways to measure current.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
The LM358's output stage has a Darlington pull-up so it won't pull up closer than about 1.5V below the positive supply rail, which would limit the output voltage to about 3.5V. It also has an input offset voltage in the millivolt range so it would cause significant measurement error.

As for alternatives, in through-hole your best bet would be the Texas Instruments OPA2340 (the dual version):
http://www.digikey.com/product-detail/en/OPA2340PA/OPA2340PA-ND/266130
There are cheaper options such as the Microchip MCP6022 (also dual):
http://www.digikey.com/product-detail/en/MCP6022-E/P/MCP6022-E/P-ND/683219

Options in SMT include the Texas Instruments LMV722: http://www.digikey.com/product-detail/en/LMV722IDGKR/296-27988-1-ND/2451270 and other devices with lower input offset voltages (but higher prices).

I agree with Steve and Duke in recommending that you use one half of the dual op-amp as a constant current source.
 

Boltar

Nov 18, 2013
12
Joined
Nov 18, 2013
Messages
12
Thanks for the more sensitive op-amp suggestions. I'll look into those, they are much more expensive tho' but I guess that's understandable.
 
Last edited:

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
The LM358's input offset voltage is typically around 3 mV, maximum around 10 mV. With a gain of 23 that translates into a DC error of up to around 200 mV which is 4% of full scale.

The extra circuitry won't do what you want. What is its purpose?

There are lots of designs around for op-amp-based current sources. Google op-amp current source circuit. Some of them may be controllable, if that's what you want.
 

Boltar

Nov 18, 2013
12
Joined
Nov 18, 2013
Messages
12
Thanks, I think the tolerances of the LM358 are manageable however.
 
Last edited:

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
The input offset current is likely to be constant enough that you can null it out in software. But it would be best to have a reference zero and 10 ohm resistor, to set the calibration at 2 points.

In your diagram, R4 is the resistor under test.

There are a few other tricks that can be employed to make your reading a little more accurate.

The first of these is to move your current sense resistor to the ground side of R4. At the very least you'd have to swap your R1/R2 around too. I would recommend that your sense resistor be a lot lower in value, perhaps 1 ohm?, and I'd also keep the current to between 50 and 100mA.

This circuit assumes your 5V is regulated, so it is also possible to place your resistor under test between +5V and the collector of the transistor.

If you do a 2 point calibration (0 ohms and 10 ohms) then you should be able to null out the resistance of your probes and get reasonable accuracy.
 

Boltar

Nov 18, 2013
12
Joined
Nov 18, 2013
Messages
12
Thanks, unfortunately R4 HAS to be on the ground rail, so none of the suggestion will work, but I appreciate your efferots to help me.
 
Last edited:

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
How much voltage is going to be applied to the heating coil to make it heat up? Will that be AC or DC voltage?

Why do you want to measure its resistance? Are you trying to sense temperature?

Is this a one-off project?

Why don't you describe the whole project in detail. Otherwise we may spend a lot of time suggesting things that won't be workable.
 

Boltar

Nov 18, 2013
12
Joined
Nov 18, 2013
Messages
12
Usually 3-6v

Because I need to. The reason I need to is irrelevant to this post.

It's not a one off project.

I can't describe it in detail, sorry. I gave all the information needed. Resistance detection circuit using an arduino with the resistance being detected connected to the ground rail. No further elaboration should be required.
 
Last edited:

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
How are you going to regulate the voltage applied to the coil?

You could apply a fixed voltage and pulse-width-modulate the MOSFET.

Wouldn't it be simpler to sense the current flowing through the MOSFET when it's ON instead of disconnecting it and measuring the heater resistance? You would then adjust the duty cycle to give the desired amount of power.
 

Boltar

Nov 18, 2013
12
Joined
Nov 18, 2013
Messages
12
Power regulation is already taken care of, all I need to complete the system is coil resistance reading.

No that wouldn't be simpler. Also the coil does not have to be disconnected when the resistance is read, diodes make this possible.

Many thanks for all the suggestions.



EDIT: All is now working. Many thanks to steve for all the help which allowed me to finish this.
 
Last edited:

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Hey Boltar, not that fast! :)

Tell us how well it works? You mentioned compensation in software in a way that suggested to me you don't need help with the code. Tell us what you did. I'm sure that someone somewhere else is going to want to make a low-ohms meter and your practical notes may be invaluable.

Also, I'm just really curious... :D
 
Top