Interfacing ADC121C With Arduino Nano(I2C)

by Dcube Tech Ventures in Circuits > Arduino

2960 Views, 0 Favorites, 0 Comments

Interfacing ADC121C With Arduino Nano(I2C)

Screenshot (8).png

Hello,

Good Greetings..!!

Today I (Somanshu Choudhary) on the behalf of Dcube tech ventures going to control ADC121C device using Arduino , it is one of the applications of I2C protocol to read analog data via Arduino.

Overview

IMG-20160224-WA0010.jpg
  1. ADC121C021 is a I2C-Compatible10-Bit Analog-to-Digital convertor
  2. DATASHEET Link: http://www.ti.com/lit/ds/symlink/adc121c021.pdf
  3. This project measure voltage ranging from (1v to 5v)

What You Need / Links

pencil-cell-250x250.jpg
IMG-20160223-WA0003.jpg
  1. Arduino Nano Link:https://store.arduino.cc/
  2. I²C Shield for Arduino Nano Link:https://www.controleverything.com/content/I2C-Mast...
  3. 1-Channel 12-Bit Analog to Digital Conversion Link:https://www.controleverything.com/content/Analog-D...

  4. USB Cable Type A to Micro Type B 6 Feet Long Link:https://www.controleverything.com/content/USB-Cabl...

  5. I²C Cable Link:https://www.controleverything.com/content/I2C-Cabl...
  6. Battery max upto 5 volts

Circuit Diagram

IMG_20160223_153548.jpg
Screenshot (9).png

Programming

Screenshot (10).png

ARDUINO CODE :

#include
void setup() {

// I2C address of the ADC121C021

#define ADC_ADDR 0x50

// Join I2C Bus as master

Wire.begin();

// Start serial communication and set baud rate Serial.begin(9600); }

void loop()

{

// Begin transmission with given device on I2C bus

Wire.beginTransmission(ADC_ADDR);

// Calling conversion result register, 0x00 Wire.write(0x00);

delay(500);

// Request 2 bytes

Wire.requestFrom(ADC_ADDR, 2);

// Read the bytes if they are available

if(Wire.available() == 2)

{

int msb = Wire.read();

int lsb = Wire.read();

// End transmission and release I2C bus

Wire.endTransmission();

// Converting value

int rawADC = msb * 256 + lsb;

rawADC = rawADC & 0x0fff;

double volt = rawADC * 5.0 / 4096.0;

// Output to the screen

Serial.print("volt Value : ");

Serial.println(volt);

}

else

{

Serial.println("Not enough bytes available on wire.");

}}

For further quires Feel free to visit our site:

www.dcubetechnologies.com