“SKU:RB-02S088 電流檢測(cè)傳感器”的版本間的差異
來(lái)自ALSROBOT WiKi
(以“右 ==產(chǎn)品概述== 此產(chǎn)品由一個(gè)電流感應(yīng)器TA12-200組成構(gòu)成??梢詫⒋蟮碾娏髁哭D(zhuǎn)換為幅...”為內(nèi)容創(chuàng)建頁(yè)面) |
(→?資料下載) |
||
(未顯示1個(gè)用戶的6個(gè)中間版本) | |||
第10行: | 第10行: | ||
# 信號(hào)類型:模擬信號(hào) | # 信號(hào)類型:模擬信號(hào) | ||
# 孔徑:4.96mm | # 孔徑:4.96mm | ||
? | + | # TA12 - 200 電流互感器參數(shù): | |
+ | [[文件:02S088001.png|600px|縮略圖|居中]] | ||
+ | |||
+ | # 接口定義 | ||
* S:信號(hào)引腳 | * S:信號(hào)引腳 | ||
* NC:不需要連接 | * NC:不需要連接 | ||
* -:電源地 | * -:電源地 | ||
? | + | ||
? | + | ||
+ | ==工作原理== | ||
電流傳感器是根據(jù)電磁感應(yīng)原理設(shè)計(jì)的,本傳感器使用一個(gè)線圈,導(dǎo)線穿過(guò)線圈,當(dāng)導(dǎo)線中產(chǎn)生交流電時(shí),由于電磁感應(yīng)的原因,模塊的線圈中會(huì)產(chǎn)生電流,從而使 Arduino 的模擬接口感測(cè)到,通過(guò) Arduino 控制器自帶的 10 位 AD 轉(zhuǎn)換來(lái)讀取信號(hào)。 | 電流傳感器是根據(jù)電磁感應(yīng)原理設(shè)計(jì)的,本傳感器使用一個(gè)線圈,導(dǎo)線穿過(guò)線圈,當(dāng)導(dǎo)線中產(chǎn)生交流電時(shí),由于電磁感應(yīng)的原因,模塊的線圈中會(huì)產(chǎn)生電流,從而使 Arduino 的模擬接口感測(cè)到,通過(guò) Arduino 控制器自帶的 10 位 AD 轉(zhuǎn)換來(lái)讀取信號(hào)。 | ||
? | === | + | |
? | * 振動(dòng)馬達(dá) * 1個(gè) | + | ==使用方法== |
? | * [http://gharee.com/goods-167.html 電位計(jì)模塊] * 1個(gè) | + | ===example1_Arduino=== |
? | * 電流傳感器 * 1個(gè) | + | * 主要硬件 |
? | * | + | :* 振動(dòng)馬達(dá) * 1個(gè) |
? | * [http://gharee.com/goods-147.html 傳感器擴(kuò)展板 V5.0] * 1個(gè) | + | :* [http://gharee.com/goods-167.html 電位計(jì)模塊] * 1個(gè) |
? | * [http://gharee.com/goods-94.html 杜邦線] * 若干 | + | :* 電流傳感器 * 1個(gè) |
? | + | :* Arduino UNO 控制器 * 1個(gè) | |
+ | :* [http://gharee.com/goods-147.html 傳感器擴(kuò)展板 V5.0] * 1個(gè) | ||
+ | :* [http://gharee.com/goods-94.html 杜邦線] * 若干 | ||
+ | |||
+ | * 硬件連接 | ||
[[文件:dianliuchuanganqi01.jpg|700px|縮略圖|居中|實(shí)物連接圖]] | [[文件:dianliuchuanganqi01.jpg|700px|縮略圖|居中|實(shí)物連接圖]] | ||
[[文件:02S08801.png|700px|縮略圖|居中|連接圖]] | [[文件:02S08801.png|700px|縮略圖|居中|連接圖]] | ||
? | + | 引腳接線說(shuō)明: | |
{|border="1" cellspacing="0" align="center" cellpadding="5" width="400px" | {|border="1" cellspacing="0" align="center" cellpadding="5" width="400px" | ||
|- | |- | ||
第37行: | 第45行: | ||
|- | |- | ||
|align="center"|電位計(jì)模塊 S 引腳 | |align="center"|電位計(jì)模塊 S 引腳 | ||
? | |align="center"|振動(dòng)馬達(dá) | + | |align="center"|振動(dòng)馬達(dá) S 引腳 |
|- | |- | ||
|align="center"|電位計(jì)模塊 - 引腳 | |align="center"|電位計(jì)模塊 - 引腳 | ||
第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; |
? | + | ||
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 | + | amplitude_current=((float)sensor_max * (5 / 1024)) / 800 * 1000 * 2000;// 輸入電流,單位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 | ||
? | |||
? | |||
} | } | ||
void pins_init() | void pins_init() | ||
第84行: | 第88行: | ||
pinMode(ELECTRICITY_SENSOR, INPUT); | pinMode(ELECTRICITY_SENSOR, INPUT); | ||
} | } | ||
? | |||
int getMaxValue() | int getMaxValue() | ||
{ | { | ||
? | int sensorValue; | + | 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) | ||
{ | { | ||
? | |||
sensorMax = sensorValue; | sensorMax = sensorValue; | ||
} | } | ||
第102行: | 第104行: | ||
} | } | ||
</pre> | </pre> | ||
? | + | ||
+ | * 程序效果 | ||
程序正常編譯上傳以后,打開(kāi) Arduino IDE 自帶的串口監(jiān)視器之后,會(huì)顯示出當(dāng)前檢測(cè)到的電流值。 | 程序正常編譯上傳以后,打開(kāi) Arduino IDE 自帶的串口監(jiān)視器之后,會(huì)顯示出當(dāng)前檢測(cè)到的電流值。 | ||
? | [[文件: | + | [[文件:02S0880401.png|500px|有框|居中]] |
? | == | + | ==資料下載== |
[[文件:erweima.png|230px|無(wú)框|右]] | [[文件:erweima.png|230px|無(wú)框|右]] | ||
? | + | * 產(chǎn)品資料 | |
? | + | 下載鏈接: https://pan.baidu.com/s/1RXJZvWrutHLR0PZsKxVOWg | |
? | + | 提取碼:o9si | |
? | + | * 產(chǎn)品購(gòu)買鏈接:http://gharee.com/goods-689.html | |
? | + | ||
? | + | ||
? | + | ||
? | + |
2021年10月8日 (五) 11:40的最后版本
目錄 |
產(chǎn)品概述
此產(chǎn)品由一個(gè)電流感應(yīng)器TA12-200組成構(gòu)成??梢詫⒋蟮碾娏髁哭D(zhuǎn)換為幅度小的電壓量輸出。該模塊采用沉金工藝,外觀更加美觀,同時(shí)采用防插反3Pin接口,操作更加安全,插口一邊有大寫(xiě)字母A表示該模塊位模擬量傳感器,另一邊是電流表的圖標(biāo)標(biāo)志表示該模塊具有測(cè)試電流的功能。此產(chǎn)品可以應(yīng)用于交流電的電流檢測(cè),最大可檢測(cè)的電流為5A。
規(guī)格參數(shù)
- 工作電壓 :+5v
- 最大檢測(cè)電流:5A
- 檢測(cè)類型:交流電
- 尺寸大?。?0mm x 25mm
- 重量大?。?g
- 信號(hào)類型:模擬信號(hào)
- 孔徑:4.96mm
- TA12 - 200 電流互感器參數(shù):
- 接口定義
- S:信號(hào)引腳
- NC:不需要連接
- -:電源地
工作原理
電流傳感器是根據(jù)電磁感應(yīng)原理設(shè)計(jì)的,本傳感器使用一個(gè)線圈,導(dǎo)線穿過(guò)線圈,當(dāng)導(dǎo)線中產(chǎn)生交流電時(shí),由于電磁感應(yīng)的原因,模塊的線圈中會(huì)產(chǎn)生電流,從而使 Arduino 的模擬接口感測(cè)到,通過(guò) Arduino 控制器自帶的 10 位 AD 轉(zhuǎn)換來(lái)讀取信號(hào)。
使用方法
example1_Arduino
- 主要硬件
- 振動(dòng)馬達(dá) * 1個(gè)
- 電位計(jì)模塊 * 1個(gè)
- 電流傳感器 * 1個(gè)
- Arduino UNO 控制器 * 1個(gè)
- 傳感器擴(kuò)展板 V5.0 * 1個(gè)
- 杜邦線 * 若干
- 硬件連接
引腳接線說(shuō)明:
傳感器引腳 | 所接引腳 |
電位計(jì)模塊 + 引腳 | 穿過(guò)電流傳感器接在UNO的D13 S 引腳 |
電位計(jì)模塊 S 引腳 | 振動(dòng)馬達(dá) S 引腳 |
電位計(jì)模塊 - 引腳 | 懸空 |
電流傳感器 | 控制器 A0 引腳 |
振動(dòng)馬達(dá) + — 引腳 | 分別接在控制器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; }
- 程序效果
程序正常編譯上傳以后,打開(kāi) Arduino IDE 自帶的串口監(jiān)視器之后,會(huì)顯示出當(dāng)前檢測(cè)到的電流值。
資料下載
- 產(chǎn)品資料
下載鏈接: https://pan.baidu.com/s/1RXJZvWrutHLR0PZsKxVOWg 提取碼:o9si
- 產(chǎn)品購(gòu)買鏈接:http://gharee.com/goods-689.html