| 数据搜索系统,热门电子元器件搜索 |
|
SEN0211 数据表(PDF) 4 Page - DFROBOT |
|
|
|||||||||||||||||||||||||||||
SEN0211 数据表(HTML) 4 Page - DFROBOT |
|
4 / 7 page ![]() About Calibration Since the analog reading is affected by the accuracy of the reference voltage. For a more accurate reading, use a high-precision multimeter to measure the analog reference voltage of the controller (usually the same as the supply voltage) and modify the #define VREF 5.0 parameter in the sample code below to complete the calibration. /*! * @file readACCurrent. * @n This example reads Analog AC Current Sensor. * @copyright Copyright (c) 2010 DFRobot Co.Ltd (https://www.dfrobot.com) * @licence The MIT License (MIT) * @get from https://www.dfrobot.com Created 2016-3-10 By berinie Chen <bernie.chen@dfrobot.com> Revised 2019-8-6 By Henry Zhao<henry.zhao@dfrobot.com> */ const int ACPin = A2; //set arduino signal read pin #define ACTectionRange 20; //set Non-invasive AC Current Sensor tection range (5A,10A,20A) // VREF: Analog reference // For Arduino UNO, Leonardo and mega2560, etc. change VREF to 5 // For Arduino Zero, Due, MKR Family, ESP32, etc. 3V3 controllers, change VREF to 3.3 #define VREF 5.0 float readACCurrentValue() { float ACCurrtntValue = 0; float peakVoltage = 0; float voltageVirtualValue = 0; //Vrms for (int i = 0; i < 5; i++) { peakVoltage += analogRead(ACPin); //read peak voltage delay(1); } peakVoltage = peakVoltage / 5; voltageVirtualValue = peakVoltage * 0.707; //change the peak voltage to the Virtual Value of voltage /*The circuit is amplified by 2 times, so it is divided by 2.*/ voltageVirtualValue = (voltageVirtualValue / 1024 * VREF ) / 2; ACCurrtntValue = voltageVirtualValue * ACTectionRange; return ACCurrtntValue; } |
|
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |