loading

Hello,

Good Greetings..!!

Here I (Somanshu Choudhary) on the behalf of Dcube tech ventures going to monitor current using Arduino nano, it is one of the applications of I2C protocol to read analog data of Current Sensor TA12-200.

Step 1: Overview

  1. TA12-200 is a AC current sensor
  2. DATASHEET Link:http://berg.hatenablog.com/entry/2013/04/21/204441
  3. This project measure AC current values

Step 2: What You Need / Links

  1. Arduino Nano Link: https://store.arduino.cc/
  2. I²C Shield for Arduino Nano Link: https://www.controleverything.com/content/I2C-Mast...
  3. USB Cable Type A to Micro Type B 6 Feet Long Link: https://www.controleverything.com/content/USB-Cabl...
  4. I²C Cable Link: https://www.controleverything.com/content/I2C-Cabl...

  5. I²C AC current Sensor via ADC121C 12-Bit ADC I²C Mini Module Link: https://www.controleverything.com/find?qs=ADC121C&...

  6. CFL or Light bulb.

  7. PCV cables.

Step 3: Circuit Diagram

Step 4: Programming / Code

#include

void setup()

{

// I2C address of the ADC121C021, 0x50 interfaced with TA12-200

#define ADC_ADDR 0x50

// Join I2c Bus as master

Wire.begin();

// Start serial communication for serial console output

Serial.begin(9600);

}

void loop()

{

// Begin transmission with given device on I2C bus

Wire.beginTransmission(ADC_ADDR);

// Calling conversion result register, 0x00(0)

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();

// Calculating value

int rawADC = msb * 256 + lsb;

rawADC = rawADC & 0x0fff;

// Output to the screen

Serial.print("ADC Value : ");

Serial.println(rawADC);

}

else

{

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

}

delay(100);

}

///////////////////////////////////////////////////////////////////////////NOTE///////////////////////////////////////////////////////////////////////////////////////////////////

// These values are in mili amps

// You can also find rms value of current by finding maxinmum reading and divide it by 1.414

Step 5:

For further quires Feel free to visit our site:

www.dcubetechnologies.com

About This Instructable

626views

2favorites

More by Dcube Tech Ventures:Home Automation with Raspberry Pi using Relay board Motion Control with Raspberry Pi and LIS3DHTR, 3-Axis Accelerometer, using Python 3-Axis Accelerometer, ADXL345 with Raspberry Pi using Python 
Add instructable to: