SKU:RB-02S088 电流检测传感器

来自ALSROBOT WiKi
跳转至: 导航搜索
Dianliuchuanganqi002.jpg

目录

产品概述

此产品由一个电流感应器TA12-200组成构成。可以将大的电流量转换为幅度小的电压量输出。该模块采用沉金工艺,外观更加美观,同时采用防插反3Pin接口,操作更加安全,插口一边有大写字母A表示该模块位模拟量传感器,另一边是电流表的图标标志表示该模块具有测试电流的功能。此产品可以应用于交流电的电流检测,最大可检测的电流为5A。

规格参数

  1. 工作电压 :+5v
  2. 最大检测电流:5A
  3. 检测类型:交流电
  4. 尺寸大小:30mm x 25mm
  5. 重量大小:8g
  6. 信号类型:模拟信号
  7. 孔径:4.96mm
  8. TA12 - 200 电流互感器参数:
02S088001.png
  1. 接口定义
  • S:信号引脚
  • NC:不需要连接
  • -:电源地


工作原理

电流传感器是根据电磁感应原理设计的,本传感器使用一个线圈,导线穿过线圈,当导线中产生交流电时,由于电磁感应的原因,模块的线圈中会产生电流,从而使 Arduino 的模拟接口感测到,通过 Arduino 控制器自带的 10 位 AD 转换来读取信号。

使用方法

example1_Arduino

  • 主要硬件
  • 硬件连接
实物连接图
连接图

引脚接线说明:

传感器引脚 所接引脚
电位计模块 + 引脚 穿过电流传感器接在UNO的D13 S 引脚
电位计模块 S 引脚 振动马达 S 引脚
电位计模块 - 引脚 悬空
电流传感器 控制器 A0 引脚
振动马达 + — 引脚 分别接在控制器Vcc和GND


注:NC可以不接

  • 示例程序
#define ELECTRICITY_SENSOR A0 
int mada = 13;
float amplitude_current;                 

void setup() 
{
	Serial.begin(9600); 
	pins_init();
        pinMode(mada, OUTPUT);  
}
void loop() 
{
        digitalWrite(mada, HIGH);  
	int sensor_max;
	sensor_max = getMaxValue();
	Serial.print("sensor_max = ");
	Serial.println(sensor_max);
	//the VCC on the RobotBase interface of the sensor is 5v
	amplitude_current=((float)sensor_max * (5 / 1024)) / 800 * 1000 * 2000;// 输入电流,单位mA
						
	Serial.println("The amplitude of the current is(in mA)");
	Serial.println(amplitude_current,1);//Only one number after the decimal point
}
void pins_init()
{
	pinMode(ELECTRICITY_SENSOR, INPUT);
}
int getMaxValue()
{
	int sensorValue;         
	int sensorMax = 0;
	uint32_t start_time = millis();
	while((millis()-start_time) < 1000)//sample for 1000ms
	{
		sensorValue = analogRead(ELECTRICITY_SENSOR);
		if (sensorValue > sensorMax) 
		{
		sensorMax = sensorValue;
		}
	}
	return sensorMax;
}
  • 程序效果

程序正常编译上传以后,打开 Arduino IDE 自带的串口监视器之后,会显示出当前检测到的电流值。

02S0880401.png

资料下载

Erweima.png
  • 产品资料

下载链接: https://pan.baidu.com/s/1RXJZvWrutHLR0PZsKxVOWg 提取码:o9si