How to read megaohm range meter

For starters, I got as far as successfully reading low-ohms accurately. But once I get into 10K or 100K ohm range, accuracy starts to suffer, and it's utterly useless for mega-ohm ranges. Which is what I need to measure.

I'm currently using the method of two resistors, one known and one unknown, aka a "voltage divider", measuring the voltage drop via one of the analog pins and doing the math. So I have the fundamentals working fine. But apparently there are esoteric things going on when you're trying to read mega-ohm range values which require more stuff to be added that I'm afraid I don't really understand yet.

A couple posts mentioned an op-amp "voltage follower" but without elaboration or demonstrating how to incorporate it. Basically I'd like to take this thread: https://forum.arduino.cc/index.php?topic=635576.0

...and pick up from post 5 (OP went AWOL).

One question I know you're going to ask me is what the range is I need to measure. And I'm afraid I don't really know yet. I'm reading resistance off a pressure sensor, and the resistance goes down as more pressure is applied. I don't yet know the upper limit of what the pressure is I'm going to be faced with. So far my calibration tests have produced resistance as low as about 1 mega-ohm with 26Kg of pressure. 4Kg resulted in 8.5 mega-ohms. I have a power curve formula already worked out which approximates Kg based on ohms (fitting the function to an X/Y scatter graph of my assorted calibration readings) sufficiently accurate for my needs, so I just need to read the ohms relatively accurately.

So I feel I've worked out 90% of the hard stuff, if I can just have some guidance on the last 10% to bring the two ends of this together.

Do you have a data sheet on the pressure transducer - the values you quote seem very odd for such a device .

The high values are in the same order as the input resistance of the analog inputs , that is the source of your error.

It is possible to measure 1MΩ, but I think that 10MΩ is too much.

The circuit impedance for a analog input should be 10kΩ or less for a reliable measurement. You can go up to 100kΩ if you accept a little less accuracy and use a filter in software to reduce the noise.

The analog inputs do not really have a input resistance. They need a little charge when taking a sample to measure. You can provide that little charge with circuit impedance of 10kΩ or less or with a capacitor.

You can go up to 1MΩ when you add a capacitor between the analog input and GND. That way there is some reservoir and the Arduino doesn't even know that it is a reservoir instead of a circuit impedance of 10kΩ. That capacitor can be for example 10nF (I think 1nF to 100nF is okay).

It is possible to select a range. Suppose your sensor is connected to GND and A0. Then you can use a resistor of 100k from D2 to A0 and a resistor of 2M from D2 to A0. Keep D2 and D3 as INPUT. Then select one of the digitals pins, set it to OUTPUT and HIGH and measure A0 and after that set the digital pin to INPUT again. Now you can select the range. You need a delay to let the 2MΩ fill the reservoir-capacitor. I often use 1k and 100k for a extended range of a LDR.

Don't forget to take the average of many samples in the sketch. That will make the measurements a lot better.

The op amp follower or unity gain op amp is used to convert a high impedance input to a low impedance output. The pH electrode is a good example. You cannot normally read the output even with a decent meter on a high impedance range, but if you feed the pH output into something like a FET op amp (MAX406 or MAX407 is my reliable standby), it can be read on any meter range. Maxim have an application note, some years old now, on how to wire it. Shielding and ground layout are crucial. With the amp as close as possible to the electrode, you can avoid expensive connectors and cable and essentially use any old cable, very satisfying.