ADC-X Add-on
| Channels: | 8
*or 4 differential |
| Current: | 0.3 mA |
| I2C: | Yes
*up to 3.4 MHz |
| Resolution: | 8 bits |
| Sample Rate: | 70 kHz |
| Voltage: | 3.3 - 5 V |
|
BoardX Motherboard |
|
AVR-X Add-on |
|
FRAM-X Add-on |
|
PROTO-X Add-on |
|
|
Make: Electronics (Learning by Discovery) |
|
|
Making Things Talk: Using Sensors, Networks, and Arduino to see, hear, and feel your world |
Need more analog sampling? Here's a TI ADS-7830 ADC on an I2C Bus with 8 channels, each with a resolution of 8 bits.
An external or internal 2.5V reference is selectable via I2C command, and the external reference is connected to a 3-way jumper that you can cut with a razor blade and re-solder to a different position.
By default the external reference jumper is connected to the board's 3.3V power supply. Choosing this reference raises the measurement range of the device compared to the 2.5V, but lowers the resolution. You can eliminate noise and reclaim some of this lost resolution simply by taking several samples and averaging them (however you must use floating point math). This is demonstrated here: ADC-X Code Examples
Another reference option is to route it to the input socket for Channel 7 of the ADC. This will allow you to easily plug in an external voltage source to use as a reference (or output the ADC's internal 2.5V reference), but will also sacrifice the functionality of the eighth channel on the ADC if chosen.
Features Include:
- Address selection via dip-switch
- All 8 channels accessible from front-facing socket
- On the fly selection (via I2C) between a built-in 2.5 V reference and various external references.
- Differential or single ended measurement modes
- Supports high-speed I2C
- Also comes in higher resolution variants
Hook up your AVR-X Add-on and ADC-X and paste the following into the Arduino SDK to get started, or check out ADC-X Code Examples for a more detailed step-by-step guide.
#include <Wire.h>
#include <ADCX.h>
/*Initialize the ADC and use the default
ADC address that's provided */
ADCX adc(ADCX::ADCX_I2C_DEFAULT_ADDRESS);
/* this is where we will store the values we read from the ADC */
static unsigned char adc_channel_values[8] = {0,0,0,0,0,0,0,0};
void setup(){
/* we must call this before using any I2C functions! */
Wire.begin();
Serial.begin(9600);
}
void loop(){
/* max is 8 */
unsigned char number_of_channels_to_read = 8;
/* loop through the channels */
for(int i=0; i<number_of_channels_to_read; i++){
/* save the reading of channel "i" */
adc_channel_values[i] = adc.read(i);
/* print it out */
Serial.print("ADC Channel ");
Serial.print(i, DEC);
Serial.print(" was ");
Serial.print(adc_channel_values[i],DEC);
Serial.println(" ");
}
/* Handle any I2C errors */
unsigned int error = adc.errors();
Serial.print("Error code: ");
Serial.print(error,HEX);
switch(error)
{
case 0: Serial.print(" [Success!] ");
break;
case 1: Serial.print(" [Data too large for buffer] ");
break;
case 2: Serial.print(" [I2C Address was not found] ");
break;
case 3: Serial.print(" [Data was not acknowledged] ");
break;
default:Serial.print(" [There was some other error] ");
break;
}
Serial.println(" ");
delay(5000);
}
ADS-7830 Datasheet
ADC-X Schematic