“SKU:RB-02S088 电流检测传感器”的版本间的差异

来自ALSROBOT WiKi
跳转至: 导航搜索
接线示意图
资料下载
 
(未显示1个用户的5个中间版本)
第10行: 第10行:
 
# 信号类型:模拟信号
 
# 信号类型:模拟信号
 
# 孔径:4.96mm
 
# 孔径:4.96mm
==接口定义==
+
# TA12 - 200 电流互感器参数:
 +
[[文件:02S088001.png|600px|缩略图|居中]]
 +
 
 +
# 接口定义
 
* S:信号引脚
 
* S:信号引脚
 
* NC:不需要连接
 
* NC:不需要连接
 
* -:电源地
 
* -:电源地
==使用方法==
+
 
===工作原理===
+
 
 +
==工作原理==
 
电流传感器是根据电磁感应原理设计的,本传感器使用一个线圈,导线穿过线圈,当导线中产生交流电时,由于电磁感应的原因,模块的线圈中会产生电流,从而使 Arduino 的模拟接口感测到,通过 Arduino 控制器自带的 10 位 AD 转换来读取信号。
 
电流传感器是根据电磁感应原理设计的,本传感器使用一个线圈,导线穿过线圈,当导线中产生交流电时,由于电磁感应的原因,模块的线圈中会产生电流,从而使 Arduino 的模拟接口感测到,通过 Arduino 控制器自带的 10 位 AD 转换来读取信号。
===实验硬件===
+
 
* 振动马达 * 1个
+
==使用方法==
* [http://www.alsrobot.cn/goods-167.html 电位计模块] * 1个
+
===example1_Arduino===
* 电流传感器 * 1个
+
* 主要硬件
* [http://www.alsrobot.cn/goods-546.html Carduino UNO 控制器] * 1个
+
:* 振动马达 * 1个
* [http://www.alsrobot.cn/goods-147.html 传感器扩展板 V5.0] * 1个
+
:* [http://www.alsrobot.cn/goods-167.html 电位计模块] * 1个
* [http://www.alsrobot.cn/goods-94.html 杜邦线] * 若干
+
:* 电流传感器 * 1个
===接线示意图===
+
:* Arduino UNO 控制器 * 1个
 +
:* [http://www.alsrobot.cn/goods-147.html 传感器扩展板 V5.0] * 1个
 +
:* [http://www.alsrobot.cn/goods-94.html 杜邦线] * 若干
 +
 
 +
* 硬件连接
 
[[文件:dianliuchuanganqi01.jpg|700px|缩略图|居中|实物连接图]]
 
[[文件:dianliuchuanganqi01.jpg|700px|缩略图|居中|实物连接图]]
 
[[文件:02S08801.png|700px|缩略图|居中|连接图]]
 
[[文件:02S08801.png|700px|缩略图|居中|连接图]]
引脚接线:
+
引脚接线说明:
 
{|border="1" cellspacing="0" align="center" cellpadding="5" width="400px"
 
{|border="1" cellspacing="0" align="center" cellpadding="5" width="400px"
 
|-
 
|-
第51行: 第59行:
 
注:NC可以不接
 
注:NC可以不接
  
===例子程序===
+
* 示例程序
 
<pre style='color:blue'>
 
<pre style='color:blue'>
 
#define ELECTRICITY_SENSOR A0  
 
#define ELECTRICITY_SENSOR A0  
 
int mada = 13;
 
int mada = 13;
float amplitude_current;            
+
float amplitude_current;                
float effective_value;     
+
  
 
void setup()  
 
void setup()  
第72行: 第79行:
 
Serial.println(sensor_max);
 
Serial.println(sensor_max);
 
//the VCC on the RobotBase interface of the sensor is 5v
 
//the VCC on the RobotBase interface of the sensor is 5v
amplitude_current=(float)sensor_max/1024*5/800*2000000;
+
amplitude_current=((float)sensor_max * (5 / 1024)) / 800 * 1000 * 2000;// 输入电流,单位mA
effective_value=amplitude_current/1.414;//minimum_current=1/1024*5/800*2000000/1.414=8.6(mA)
+
 
 
 
Serial.println("The amplitude of the current is(in mA)");
 
Serial.println("The amplitude of the current is(in mA)");
 
Serial.println(amplitude_current,1);//Only one number after the decimal point
 
Serial.println(amplitude_current,1);//Only one number after the decimal point
Serial.println("The effective value of the current is(in mA)");
 
Serial.println(effective_value,1);
 
 
}
 
}
 
void pins_init()
 
void pins_init()
第84行: 第88行:
 
pinMode(ELECTRICITY_SENSOR, INPUT);
 
pinMode(ELECTRICITY_SENSOR, INPUT);
 
}
 
}
/*Function: Sample for 1000ms and get the maximum value from the SIG pin*/
 
 
int getMaxValue()
 
int getMaxValue()
 
{
 
{
int sensorValue;             //value read from the sensor
+
int sensorValue;        
 
int sensorMax = 0;
 
int sensorMax = 0;
 
uint32_t start_time = millis();
 
uint32_t start_time = millis();
第95行: 第98行:
 
if (sensorValue > sensorMax)  
 
if (sensorValue > sensorMax)  
 
{
 
{
/*record the maximum sensor value*/
 
 
sensorMax = sensorValue;
 
sensorMax = sensorValue;
 
}
 
}
第102行: 第104行:
 
}
 
}
 
</pre>
 
</pre>
===程序效果===
+
 
 +
* 程序效果
 
程序正常编译上传以后,打开 Arduino IDE 自带的串口监视器之后,会显示出当前检测到的电流值。
 
程序正常编译上传以后,打开 Arduino IDE 自带的串口监视器之后,会显示出当前检测到的电流值。
[[文件:02S08804.png|700px|有框|居中]]
+
[[文件:02S0880401.png|500px|有框|居中]]
  
==产品相关推荐==
+
==资料下载==
 
[[文件:erweima.png|230px|无框|右]]
 
[[文件:erweima.png|230px|无框|右]]
===购买地址===
+
* 产品资料
[https://item.taobao.com/item.htm?spm=a1z10.3-c.w4002-3667083713.10.RCxcrJ&id=521034929916 电流检测传感器]
+
下载链接: https://pan.baidu.com/s/1RXJZvWrutHLR0PZsKxVOWg
===周边产品推荐===
+
提取码:o9si
[http://www.alsrobot.cn/goods-167.html Arduino 旋转角度传感器]<br/>
+
* 产品购买链接:http://www.alsrobot.cn/goods-689.html
[http://www.alsrobot.cn/goods-196.html 通用传感器连接线 3P杜邦连接线]<br/>
+
===相关问题解答===
+
===相关学习资料===
+
[http://www.makerspace.cn/portal.php 奥松机器人技术论坛]
+

2021年10月8日 (五) 11:40的最后版本

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