Cảm biến dòng MCU-219 INA219 I2C

55.000₫

Còn hàng

Cảm biến dòng MCU-219 INA219 I2C có thể được thực hiện độ chính xác +- 1% ở -40 độ , ở nhiệt độ 85 độ độ lệch tối đa 100 uV.

  • Sản phẩm có độ chính xác cao kết hợp các ưu điểm của độ phân giải 12 bit. 
  • Phạm vi điện áp bus từ 0 V đến +26 V.
  • Dòng đo: lên đến 3.2A
  • Điện áp sử dụng : 3 ~ 5 V 
  • Kích Thước: 25.5x22.3 mm
  • Giao tiếp :  I2C 

 

CODE THAM KHẢO:

Thư viện Adafruit_INA219.h

/*
 * Kết nối:
 *          INA219                Uno             Mega
 *           VCC                  5V               5V
 *           GND                  GND              GND
 *           SCL                  A5               SCL
 *           SDA                  A4               SDA
 *           
 * Nạp code mở Serial Monitor chọn No line ending, baud 9600.
 */

#include <Wire.h>
#include <Adafruit_INA219.h>

Adafruit_INA219 ina219;


void setup(void) 
{
  Serial.begin(115200);
  while (!Serial) {
      delay(1);
  }

  uint32_t currentFrequency;
    
  Serial.println("Hello!");
  ina219.begin();
  Serial.println("Measuring voltage and current with INA219 ...");
}

void loop(void) 
{
  float shuntvoltage = 0;
  float busvoltage = 0;
  float current_mA = 0;
  float loadvoltage = 0;
  float power_mW = 0;

  shuntvoltage = ina219.getShuntVoltage_mV();
  busvoltage = ina219.getBusVoltage_V();
  current_mA = ina219.getCurrent_mA();
  power_mW = ina219.getPower_mW();
  loadvoltage = busvoltage + (shuntvoltage / 1000);
  
  Serial.print("Bus Voltage:   "); Serial.print(busvoltage); Serial.println(" V");
  Serial.print("Shunt Voltage: "); Serial.print(shuntvoltage); Serial.println(" mV");
  Serial.print("Load Voltage:  "); Serial.print(loadvoltage); Serial.println(" V");
  Serial.print("Current:       "); Serial.print(current_mA); Serial.println(" mA");
  Serial.print("Power:         "); Serial.print(power_mW); Serial.println(" mW");
  Serial.println("");

  delay(2000);
}

Sản phẩm liên quan

A1302KUA-T

15.000₫