模拟交流电流传感器

简介

当你想要测量交流电流的时候,你是不是还在为怎么剪线,接线,搭电路感到烦恼。DF出品的模拟量交流电流传感器能够很方便的帮助您解决这个问题,不再需要您剪线,搭电路。只需要将我们的开合式交流互感器打开套在您的交流线上,然后将交流互感器的3.5mm耳机插头插到我们的模块上,就可以方便快捷的读取到当前的交流电流值。即插即用,随套随测。可以很方便的用于交流电机、照明设备、空压机等的电流测量、监控和保护。 科普小常识:什么是交流电?

产品参数

信号转换模块

开合式交流互感器探头

引脚说明

SEN0211_overview
标号 名称 功能描述
1 - 电源负极
2 + 电源正极(3.3V - 5.5V)
3 A 模拟信号输出(0.2V-2.8V,DC)
4 Φ3.5mm三芯耳机座 交流互感器接头

使用教程

本教程将介绍如何用交流互感器探头与交流传感器模块来检测交流电流的大小。

准备

接线图

交流互感器的探头只能夹住两根交流线其中的一根,不能两根线同时夹住!

样例代码

测量交流电电流(串口打印)

关于校准:
由于模拟读数受到参考电压的影响,较大程度影响读数精度。为了得到更准确的读数,可使用高精度万用表测量主控的模拟参考电压(通常与供电电压一致),并修改下方样例代码中的“#define VREF 5.0”的参数,完成校准。
/*!
       @file readACCurrent.
       @n This example reads Analog AC Current Sensor.

       @copyright   Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
       @licence     The MIT License (MIT)
       @get from https://www.dfrobot.com

     Created 2016-3-10
     By berinie Chen <bernie.chen@dfrobot.com>

     Revised 2019-8-6
     By Henry Zhao<henry.zhao@dfrobot.com>
*/

const int ACPin = A2;         //set arduino signal read pin
#define ACTectionRange 20;    //set Non-invasive AC Current Sensor tection range (5A,10A,20A)

// VREF: Analog reference
// For Arduino UNO, Leonardo and mega2560, etc. change VREF to 5
// For Arduino Zero, Due, MKR Family, ESP32, etc. 3V3 controllers, change VREF to 3.3
#define VREF 5.0

float readACCurrentValue()
{
  float ACCurrtntValue = 0;
  float peakVoltage = 0;
  float voltageVirtualValue = 0;  //Vrms
  for (int i = 0; i < 5; i++)
  {
    peakVoltage += analogRead(ACPin);   //read peak voltage
    delay(1);
  }
  peakVoltage = peakVoltage / 5;
  voltageVirtualValue = peakVoltage * 0.707;    //change the peak voltage to the Virtual Value of voltage

  /*The circuit is amplified by 2 times, so it is divided by 2.*/
  voltageVirtualValue = (voltageVirtualValue / 1024 * VREF ) / 2;

  ACCurrtntValue = voltageVirtualValue * ACTectionRange;

  return ACCurrtntValue;
}

void setup()
{
  Serial.begin(115200);
  pinMode(13, OUTPUT);

}

void loop()
{
  float ACCurrentValue = readACCurrentValue(); //read AC Current Value
  Serial.print(ACCurrentValue);
  Serial.println(" A");
  digitalWrite(13, HIGH);
  delay(500);
  digitalWrite(13, LOW);
  delay(500);
}

测量交流电电流(LCD显示)

/*!
       @file readACCurrent_LCD.
       @n This example reads Analog AC Current Sensor and display on the LCD.

       @copyright   Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
       @licence     The MIT License (MIT)
       @get from https://www.dfrobot.com

     Created 2016-3-10
     By berinie Chen <bernie.chen@dfrobot.com>

     Revised 2019-8-6
     By Henry Zhao<henry.zhao@dfrobot.com>
*/

#include <LiquidCrystal.h>

LiquidCrystal lcd(8, 9, 4, 5, 6, 7);        // select the pins used on the LCD panel

const int ACPin = A2;         //set arduino signal read pin
#define ACTectionRange 20;    //set Non-invasive AC Current Sensor tection range (5A,10A,20A)

// VREF: Analog reference
// For Arduino UNO, Leonardo and mega2560, etc. change VREF to 5
// For Arduino Zero, Due, MKR Family, ESP32, etc. 3V3 controllers, change VREF to 3.3
#define VREF 5.0

float readACCurrentValue()
{
  float ACCurrtntValue = 0;
  float peakVoltage = 0;
  float voltageVirtualValue = 0;  //Vrms
  for (int i = 0; i < 5; i++)
  {
    peakVoltage += analogRead(ACPin);   //read peak voltage
    delay(1);
  }
  peakVoltage = peakVoltage / 5;
  voltageVirtualValue = peakVoltage * 0.707;    //change the peak voltage to the Virtual Value of voltage

  /*The circuit is amplified by 2 times, so it is divided by 2.*/
  voltageVirtualValue = (voltageVirtualValue / 1024 * VREF ) / 2;

  ACCurrtntValue = voltageVirtualValue * ACTectionRange;

  return ACCurrtntValue;
}

void setup()
{
  Serial.begin(115200);
  lcd.begin(16, 2);                       // start the library
  pinMode(13, OUTPUT);
}

void loop()
{
  lcd.setCursor(3, 0);
  float ACCurrentValue = readACCurrentValue(); //read AC Current Value
  //  Serial.println(ACCurrentValue);
  lcd.print("AC CURRENT");
  lcd.setCursor(5, 1);
  lcd.print(ACCurrentValue);
  lcd.print("  A");
  digitalWrite(13, HIGH);
  delay(500);
  digitalWrite(13, LOW);
  delay(500);
}

常见问题

还没有客户对此产品有任何问题,欢迎通过qq或者论坛联系我们!

更多问题及有趣的应用,可以 访问论坛 进行查阅或发帖!

更多

原理图

元件孔位图

DFshopping_car1.png SEN0287 Gravity: 模拟交流电流传感器(5A) DFRobot商城购买链接

DFshopping_car1.png SEN0288 Gravity: 模拟交流电流传感器(10A) DFRobot商城购买链接

DFshopping_car1.png SEN0211 Gravity: 模拟交流电流传感器(20A) DFRobot商城购买链接