“SKU:RB-02S088 电流检测传感器”的版本间的差异
来自ALSROBOT WiKi
(→例子程序) |
(→资料下载) |
||
(未显示1个用户的4个中间版本) | |||
第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个 | + | * 主要硬件 |
− | * | + | :* 振动马达 * 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 | ||
第97行: | 第105行: | ||
</pre> | </pre> | ||
− | + | * 程序效果 | |
程序正常编译上传以后,打开 Arduino IDE 自带的串口监视器之后,会显示出当前检测到的电流值。 | 程序正常编译上传以后,打开 Arduino IDE 自带的串口监视器之后,会显示出当前检测到的电流值。 | ||
− | [[文件: | + | [[文件:02S0880401.png|500px|有框|居中]] |
− | == | + | ==资料下载== |
[[文件:erweima.png|230px|无框|右]] | [[文件:erweima.png|230px|无框|右]] | ||
− | + | * 产品资料 | |
− | + | 下载链接: https://pan.baidu.com/s/1RXJZvWrutHLR0PZsKxVOWg | |
− | + | 提取码:o9si | |
− | + | * 产品购买链接:http://www.alsrobot.cn/goods-689.html | |
− | + | ||
− | + | ||
− | + | ||
− | + |
2021年10月8日 (五) 11:40的最后版本
目录 |
产品概述
此产品由一个电流感应器TA12-200组成构成。可以将大的电流量转换为幅度小的电压量输出。该模块采用沉金工艺,外观更加美观,同时采用防插反3Pin接口,操作更加安全,插口一边有大写字母A表示该模块位模拟量传感器,另一边是电流表的图标标志表示该模块具有测试电流的功能。此产品可以应用于交流电的电流检测,最大可检测的电流为5A。
规格参数
- 工作电压 :+5v
- 最大检测电流:5A
- 检测类型:交流电
- 尺寸大小:30mm x 25mm
- 重量大小:8g
- 信号类型:模拟信号
- 孔径:4.96mm
- TA12 - 200 电流互感器参数:
- 接口定义
- S:信号引脚
- NC:不需要连接
- -:电源地
工作原理
电流传感器是根据电磁感应原理设计的,本传感器使用一个线圈,导线穿过线圈,当导线中产生交流电时,由于电磁感应的原因,模块的线圈中会产生电流,从而使 Arduino 的模拟接口感测到,通过 Arduino 控制器自带的 10 位 AD 转换来读取信号。
使用方法
example1_Arduino
- 主要硬件
- 振动马达 * 1个
- 电位计模块 * 1个
- 电流传感器 * 1个
- Arduino UNO 控制器 * 1个
- 传感器扩展板 V5.0 * 1个
- 杜邦线 * 若干
- 硬件连接
引脚接线说明:
传感器引脚 | 所接引脚 |
电位计模块 + 引脚 | 穿过电流传感器接在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 自带的串口监视器之后,会显示出当前检测到的电流值。
资料下载
- 产品资料
下载链接: https://pan.baidu.com/s/1RXJZvWrutHLR0PZsKxVOWg 提取码:o9si