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

来自ALSROBOT WiKi
2016年11月16日 (三) 15:02Arduino77讨论 | 贡献的版本

跳转至: 导航搜索
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

接口定义

  • S:信号引脚
  • NC:不需要连接
  • -:电源地

使用方法

工作原理

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

实验硬件

接线示意图

实物连接图
连接图

引脚接线:

传感器引脚 所接引脚
电位计模块 + 引脚 穿过电流传感器接在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

购买地址

电流检测传感器

周边产品推荐

Arduino 旋转角度传感器
通用传感器连接线 3P杜邦连接线

相关问题解答

相关学习资料

奥松机器人技术论坛