I am looking to measure a resistance value using a voltage divider and Arduino ADC. Does anyone know how I would go about determining the fixed resistor value if the range I need to measure ranges from 0.5 mega ohms to 100,000 mega ohms with a reference voltage of 3.3V?
Set this up:
3.3V to fixed known resistor R1, to unknown resistor R2, to ground.
Junction Vout goes to analog pin.
So basicn voltage divider Vout = Vin x R2/(R1 + R2)
Solve the equation For R2.
Vout will be known: Vanalog_pin = equals 4.88mV x reading with Aref @ 5V
Vin is known, 3.3V
R1 is known
Solve for R2:
Vout = Vin x R2/ (R1 + R2)
(R1 +R2) x Vout = Vin x R2
R1 x Vout + R2 x Vout = Vin x R2
R1 x Vout = Vin x R2 - Vout x R2
R1 x Vout = (Vin - Vout) x R2
Thus:
(R1 x Vout)/(Vin - Vout) = R2
An example: If R1 = 100,000, and Vout = 1.52V:
(100,000 x 1.52)/(3.3 - 1.52) = 85.4K
The numbers are right but I am only looking for rough figures at the top end, the bulk of the info lies between 100 M? & 0.5M?. If practicalities dictate I can forget anything above 100M?
Put the formula in a spreadsheet and do some playing.
Vout = (Vin x R2)/(R1 + R2)
Vin R1 R2 Vout Vout/4.88mV current (micro-Amps)
3.3 100,000,000 1,000,000 0.032673267 6.695341665 0.032673267
3.3 500,000 1,000,000 2.2 450.8196721 2.2
analogRead value
totalcurrent draw = Vin(R1 + R2)
With that little current flowing, you may have to play with the analogRead settings to let the internal Sample & Hold capacitor charge up for a reliable reading. Or make multiple readings and wait for it to settle.
There is no way you can read those values directly on an arduino.
You will need a FET input op amp at least and very very good construction techniques. The resistance of the grease from a fingerprint is in the order of 10M so you are wanting to measure ten times greater than this. This is not a simple project.
Out of curiosity what is there at 50M that you need to measure?
I'm hoping to measure moisture content of materials using the resistance method I have been fiddling around a bit using the kind info here - with an 18bit ADC (MCP3424) I am able to measure 0.5M? with reasonable accuracy beyond that it seems to drift quite a bit. Not sure where to go from here, would the MAX424x provide any additional benefit?
I'm hoping to measure moisture content of materials using the resistance method
What sort of materials?
I was once involved in a project to measure moisture in grain. However, we had to resort to micro wave absorption to get any sort of accurate reading around and below 18%.
As I said you need an op amp with a very high input impedance. These tend to have FET inputs.
The AD820 from Analog Devices has a 1Gohm input impedance that might just do the trick but this is not the sort of thing you just throw together on strip board, or normal PCB material.
I have been tinkering with this circuit I found online, seems to be giving some reasonable output for the mositure content concerned in mV so wondering if this might be a good option.... my question is: does anyone know what is the circuit doing, I can't find any explaination for it?
R2 & JP1 act as resistor for current the base of Q1. As more current goes in, Q1 turns on more letting current flow across R3, creating a voltage that the arduino analog pin can read.
Thanks CrossRoads, I always think of transistors as switches but I guess there is more to them than that... time for me to look up and learn some more basic electronics.
With the circuit shown, can I adjust the sensitivity by swapping out R2 and/or R3 (I mean for a different pot)? Might I ask if it is possible to determin the sensitivity of the circuit given?... and given that the Arduino is outputting mVolts... is it possible to calculate a resistance value from the info availalble or is more circuitry required to find a current too?
I always think of transistors as switches but I guess there is more to them than that... time for me to look up and learn some more basic electronics.
That is because in context of arduino applications transistor are used mostly as full on or full off switching devices. However you can think of a transistor as the water value on your garden hose, which if turned fully off no water flows and it turned full open, maximum water flows determined by source water pressure and the diameter of the hose. However you can turn the value partially open and obtain any flow desired between 0 and max flow, a transistor operates the same way, by controlling the amount of base current the transistor can 'regulate' the current flowing between it's emitter and collector terminals. Transistors are often used in such a analog application rather then just digital switching applications.
Here's another way to hook it up.
Easier to follow with an NPN transistor.
Current flow will depend on the Gain (Hfe) of the transistor.
Vce of the transistor when full on can vary from 0.2V to 0.7V depending on the part you select.
Changing the trim pot (shown here as 2 resistors) will change the range of voltage out.
This is all very intersting, thank you ALL, I'm learning
At the moment my probes are sat in timber with 16% Moisture, the ADC is giving me about 320uV and the pot is set very low at about 20ohms - lets see if I can get to a resistance value that I can get back to the 16% MC.