0
\$\begingroup\$

I need to read several variable resistors (max 5 Mega Ohm) through SPI interface into MCU. Can anyone help me to find the right SPI IC usable? I considered the MCP41xxx but it says the largest external potentiometer can be 100K?

\$\endgroup\$
5
  • 4
    \$\begingroup\$ What's the application? Accuracy? Normally you deal with this sort of thing by adding a bit of signal conditioning in front of an appropriate ADC. MCP41xxx are digital pots, not ADCs. \$\endgroup\$ Commented Apr 18, 2014 at 18:38
  • 1
    \$\begingroup\$ To expand on Spehro's comment: the MCP41xxx are digitally-controlled potentiometers. That is: your MCU controls the value of this external resistor. I think you are trying to do the opposite -- READ the value of an external resistor. Is that right? \$\endgroup\$
    – gwideman
    Commented Apr 19, 2014 at 2:07
  • \$\begingroup\$ What MCU are you using? How fast do you need to update your readings of the pots? (Are these hand-turned pots, or connected to a machine, or?), Is there a reason not to use the MCU's analog inputs? \$\endgroup\$
    – gwideman
    Commented Apr 19, 2014 at 2:08
  • \$\begingroup\$ As others have mentioned, a major obstacle in your scenario is the high value of your pots. Are you stuck with those, or can you instead choose pots more in the 10k to 100k range... which will work better with many ADC or analog inputs. Let us know if this part of your spec is flexible. \$\endgroup\$
    – gwideman
    Commented Apr 19, 2014 at 2:19
  • \$\begingroup\$ I see I wasn't clear enough what I try to do. My ENglish isn't very well and that may cause some problems. I have at least 7 maybe 8 variabel resistors which are located at different places upt to 20 feet in distance. Since I can only use one MCU (probably a MPC430xxx) i'd like to use either SPI or I2C. With that I'd need an active IC located with the resistors. Since I don't know if such an IC exist, I placed this question here. \$\endgroup\$
    – user40542
    Commented Apr 19, 2014 at 19:24

4 Answers 4

1
\$\begingroup\$

There are a plethora of SPI analogue to digital converters that can do this. Many are multiple channel devices with 2, 4, 6 and 8 converters in one chip. Just connect the potentiometer between Vref and 0v with the wiper to the input of the ADC and you should be up and running.

\$\endgroup\$
1
\$\begingroup\$

Here is an example of a simple signal conditioning circuit that gives a nonlinear count-to-resistance equation. C1 should be a low leakage film type.

schematic

simulate this circuit – Schematic created using CircuitLab

You can calculate the resistance \$R_B\$ from

\$R_B\$ = \$\frac {C_t R_A}{2^n - C_t}\$ where \$C_t\$ is the count from an n-bit ADC.

If \$C_t\$ approaches \$2^n\$ too closely you should determine it to be overrange and avoid the calculation to avoid a divide-by-zero error, and since the resolution is so low as to be useless at that point.

Say you have a 12-bit ADC and \$R_A\$ is 1M ohm.

Measuring 5M, the count is 3413 (1 count is about 9K = 0.18%) Measuring 1M, the count is 2048 (1 count is about 1K = 0.1%) Measuring 200K, the count is 683 (1 count is about 0.35K = 0.18%)

The resolution is at a maximum when \$R_A\$ (which you pick) is equal to RB (which you measure) and gets worse in either direction.

You could get a linear relationship (and constant resolution in ohms) by using a constant current source (for example by tacking another voltage reference on top of the output of U1 and feeding the bootstrapped reference voltage to RA, but then there are two references that will never quite agree with each other, so errors are increased. The circuit I've shown has a count that is (ideally) dependent only on the reference resistor \$R_A\$.

\$\endgroup\$
0
\$\begingroup\$

You probably won't find an ADC that can do this directly, because they will require a much lower driving impedance. I think what you will need to do is make a voltage divider using the variable resistances and a precise fixed resistance and use it to divide the ADC's reference voltage. You'll have to follow that with a unity-gain buffer that has a high input impedance...it shouldn't be too hard to find a usable operational amplifier.

Selecting the fixed resistance for the voltage divider might be tricky. You want to maximize the change in voltage for the expected change in resistance, but you also want to keep the operating range a bit away from ground and Vref.

\$\endgroup\$
0
\$\begingroup\$

We don't know what kind of MCU you are using, nor why you don't want to use the MCU's analog inputs. However, supposing you are using Arduino (ATMega MCU), and you don't want to dedicate many analog inputs to reading a bunch of pots... so you want an SPI-connected peripheral chip to do the work.

If you have developed some expertise in your particular MCU, you might consider simply taking another such MCU and programming it as the external peripheral chip, communicating with your "main" MCU by SPI. This is not necessarily a winning choice for every situation, but having the capability to do this is very handy... and applies to a variety of I/O tasks.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.