Resistance measurement and stacking breakout literature?
2386 Views - Created 19/05/2016
Based on the problem you have described an ADC Differential Pi may be a better option for measuring resistance. The ADC Differential Pi is basically the same circuit as the ADC Pi Plus but with the voltage dividers removed so it has a voltage range of -2.048V to +2.048V instead of the 0-5V on the ADC Pi Plus. For measuring resistance this would give you a better resolution at lower voltages and also has a higher input impedance which will improve accuracy.
The ADC Differential Pi and ADC Pi Plus use the I2C bus to communicate with the Raspberry Pi. The I2C bus uses two wires for communicating and each ADC chip needs to be set with its own I2C address. If you look on the ADC Differential Pi page about halfway down on the left column it explains how to set the I2C addresses using the jumpers provided on the board. Each ADC chip can be set to one of eight I2C addresses between 0x68 and 0x6F. There are two ADC chips on each board so you can stack up to 4 ADC Differential Pi boards on a single Raspberry Pi giving you a maximum of 32 inputs. As all of the boards communicate over the same two pins that leave the rest of the GPIO pins available for other uses.
To communicate with the ADC Differential Pi we have software libraries available in Python 2, Python 3 and C. In python to set up communication with an ADC Differential Pi, you create an instance of the board and set the two I2C addresses that have been preset using the jumpers using the line plus the bit rate you want to board to sample with.
adc = ADCDifferentialPi(bus, 0x68, 0x69, 18)
If you want to communicate with more than one board you just need to create separate instances of the adc object for each board.
adc1 = ADCDifferentialPi(bus, 0x68, 0x69, 18)
adc2 = ADCDifferentialPi(bus, 0x6A, 0x6B, 18)
adc3 = ADCDifferentialPi(bus, 0x6C, 0x6D, 18)
adc4 = ADCDifferentialPi(bus, 0x6E, 0x6F, 18)
The read voltage demo in the python library folder shows how to set up the ADC Differential Pi and read a voltage.
To measure resistance you will need to convert that resistance into a voltage for the ADC input. The easiest way to do that will be to use a constant current source to supply a fixed current to the resistor and then measure the voltage across the resistor. You can use ohms law to calculate the resistance based on the current source and the voltage. As you have a wide range of resistances from 0.2R to 100K that complicates the circuit a bit. To get an accurate reading across the full resistance range you will need several different current source values and possibly use OpAmps to change the voltage gain before feeding it into the ADC inputs. There is quite a bit of information on google if you search for "measuring resistance using adc" so it may be worth looking around and seeing if someone else has already built a circuit you can copy.
Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view, download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.