Resistance - HELP

Hi all,

I am trying to devise a way to test resistance using arduinos, to test fencing (sport sword fighting) equipment.

It is really simple, I need to test a length of wire (nothing else) for resistance and display it on the screen. The range has to be from at least one ohm, as the max to allow the cables to be used is 3 ohms.

I was thinking of using the ANALOGREAD function, running the wire from the 5+ line.

Is this possible, if so how would I do it and how would I convert the value to Ohms?

That's quite a low resistance to be measuring. May I suggest a constant-current circuit that puts, say, 100mA through the wire, and then measure the voltage across it. Use analogRead, as you suggest. You may need to use an op-amp to amplify the small voltage drop up to a more reasonable range for the Arduino's analog input pins. If you use a constant current, voltage will be proportional to resistance.

You'll find constant-current circuits used for LED drivers, as well as NiCad and NiMH battery chargers. A simple one uses a single transistor, a couple of diodes and a couple of resistors. More complex, and more accurate, ones include an op-amp.

As much as I love the Arduino, I'd have to say that for the problem described, you'd really be better off with a medium priced multimeter... that 3 ohms is a pretty demanding target. Not only is such a small resistance hard to read, but you need high accuracy (or is it precision?)... i.e. it isn't good enough if your circuit measures 3 ohms + or - 4 ohms, is it?!

Anyway.... if you are getting into Arduinos, and don't already have a pretty good (or better) multimeter, you should get one, anyway!

Another thought: If you DO go ahead with building your own... the constant current solution in the previous post makes sense.... and for just a little more ciruitry (an op amp set up as a comparator?), you can finish the "fencing circuit tester" entirely in hardware, no Arduino needed. There will simply be a red LED that comes on if the resistance is too high.... or a row of red LEDs, the more on, the more over 3 ohms, if you want to get fancy!

But that doesn't mean I wouldn't use an Arudino for almost anything else!

For such low resistance, your best bet is to use a bridge with op-amps. Take a look at (http://www.opamp-electronics.com/tutorials/bridge_circuits_1_08_10.htm), it has some examples on measuring low resistance.

All that my forerunners have said is absolutely true and recommendable.
However 3 Ohms is not really a “small” resistance…

If your heart hangs on an Arduino solution, do just this:

(a) Design something where this wire to be measured can be connected very tightly (electrically speaking). It will most likely turn out that the main issues will be plugs, screws, … the contact resistance of which is not negligable.
(b) Buy a 0,1% 28 Ohms 2 Watt precision resistor (which could cost 1 USD). In fact there will be no advantage compared to a 1% resistor, but this is meant to care for the psychological side of this project. But take 2 Watt please, I had forgotten to mention this in the first version…
(c) Make a voltage devider from Arduino 5V supply to the 28 Ohms resistor, to the wire to be measured, to the Arduino ground.
(d) Make the connection from the point where wire and 28 Ohms meet to an Arduino ADC pin with a 10k resistor of whatever kind.

• Without a wire: 1023
• With a 4 Ohms wire: 4/32 *1023 = 128
• With a 3 Ohms wire: 3/31*1023 = 99
• With a 2 Ohms wire: 2/30*1023 = 68

You have a resolution of 30 milliOhms in the requested range which is very very good.

The current flowing is < 5V/28 = 170mA. This is not really high but could become an issue. You can change to a 100 Ohms resistor if this should be an issue…

Note that the current has to flow only a very short time - use a (reed) relais to switch it on and off if needed.

Note that this set-up is independant of the true supply voltage - it works with any volts without any change.

Note that you should make 10 to 100 measurment (during 100 ms or so) to average noise which especially can come through the mains (59/60 Hz)

And note that the readings are not linear! But this is something where software is made for to handle…

Ok, I am thinking of going with deSliva's solution, it is the simplest, best explained, and the solution I am looking for. Btw, The connection plugs for fencing are very tight electrically speaking so contact resistance is not an issue (DW, I'll use alot of solder and high grade wire).

I don't entirely understand your solution though. I don't understand what the voltage devider is/does. Is just acting like a pullup, or is it magnifying the effect of the resistance of the wire?

And will this formula you made work all the way up to 10-12 ohms? How did you develop that formula thingy? (4 Ohms = 4/32*1023=128)

Thanks Sooooo much.

And @ others: I cannot use a multimeter, I intend to develop this idea to graph on a computer and detect microbreaks and other diagnostic tools that may be needed in testing but cannot be performed using a multimeter.

To explain:
This “voltage divider” just - devides a voltage, in this case 5 Volts.

So when you have a configuration

+5V ---- 28 Ohms resistor ---- * ------ 3 Ohms “victim” ---- ground

You will measure at the spot marked * a voltage of 5V*3/(28+3)

• measuring something that gives you a reasonable resolution , i.e. so you can distinguish 3 from 4 and 2 Ohms in the first place.
• not needing too much current, to avoid heating things up.

The latter is computed by multiplying the current flowing to the square multiplied and the resistance: IIR

The current through 30 Ohms is 5/30 = 160 mA which is high considering standards in the sensor business…

The heat generated is:
0,160,1630 = 0,8 Watts, which sounds not so much but it will make the resistor “feel” hot… It might even already smell a little bit, so the advice to use a resistor rated for 2 Watt. Those things are considerably larger, beeing their own “heat sink” so to speak…

I suggested this approach for its simplicity. With a little more effort it can be improved in two ways.

(1) After your first reading shows something around 3 Ohms, you can change the ADC settings to use a 1,1 Volts reference; the reading then will show a five-fold value, increasing the resolution. But this will only be an improvement when you are very sure of the value of your supply voltage. However you can measure that also with a little trick (see …). This is just a little bit more complexity in the software only.

(2) You can also use a voltage smaller than 5 Volts somehow derived from the supply voltage. There are a lot of considerations involved there, another simple voltage devider can do.

I had not thougt of this previously, but this can be realized by just 3 resistors.

+5V —220 --(a)-- 47 Ohms – ground
(a)-- 47 Ohms – (b) – the 3 Ohms – ground

The voltage at (a) will be around 0.5V = around 220 ADC counts
when something is connected, and 1 V if the circuit is open
The voltage at (b) will be around 60mV = around 30 ADC counts when a 3 Ohms wire is connected

This gives you a resolution of 0.1 Ohms around 3 Ohms.

The prerequisites

• Change the ADC setting to a reference of 1.1V
• It suffices to use 1% standard metal resistors 1/4 Watt
• you have to measure at point (a) and at point (b)

The last thing will simplyfy the evaluation considerable, as the formula is

(b) = X/(X+47 Ohms) * (a)

So X = 47*(b) /((a)-(b))

This does not look simple, but it is. Note that there is no need to exactly KNOW any voltage (or have any exact voltage), it all cancels out by itsself.

The current involved in this modification is 20 mA (rather than 160). Worth the trouble?

P.S. Before someone else comes to this: You can put a 220nF capacitor in parallel to the 220 Ohms resistor, but you need not really.

I wonder why this extremely simply application moves still in my head...

I talked of optionally using a relais (reed variants directly connect to any Arduino output) - but any kind of transistor (rated for 2 W) will also work - to reduce the current spoil.

In the latter design (drawing 20mA) you can even use an Ardiono output to power the whole sensing set-up. Which means the current will only flow for some hundred ms during the measurement...

I included the upper 47 Ohms resistor to stabilize the open loop situation, but this not strictly necessary. If you ommit that resistor, current will flow only when a wire is attached.

THANKYOU THANKYOU THANKYOU.

Ok. I understand. I think I will go with your original solution. There are actually 3 lines to measure simutaniously. The A and B line connect to the foil and they break when a hit is scored, and the C line connects to the jacket to determine if the opponents hit was on target. Thus, if I have 3 lines I cannot use a system that require 2 analog inputs per line. I will go with the original solution.

Digital pin out ---- 28 Ohms resistor ---------------- Testing line ---- ground | 10K resistor | Analog in This will allow me to check each line individually over say 10 lots of 10ms, store in array, then check minimun and determine an average. Also being able to turn on current for a line allows me to detect crossovers in the lines from shotty armouring (weapon building), and test much more proficiently than any device available.

And for computing the analog in value(on arduino) to ohms can I ???use??? devide(Analogvalue) ???Some kind of array holding all the 4/31, 3/32 values or is there a better way?

THX SO MUCH!!!!