(SKU:DFR0051)模拟电压检测模块
来自DFRobot Product Wiki
目录 |
概述
基于电阻分压原理的电压检测模块,配合Arduino传感器扩展板可以完成对电压电量大小的检测,可以监控互动媒体作品的电量或机器人供电的电量。电压检测模块能使输入的电压缩小5倍。由于Arduino模拟输入电压最大为5V,故电压检测模块的输入电压不能大于5Vx5=25V。Arduino的模拟分辨率最小为0.0049V,所以电压检测模块输入最小电压为0.0049Vx5=0.0245V。被测电源引线到蓝色接线柱上,正接VCC,负接GND。
技术规格
- 类型:模拟
- 输入电压(DC):最大25V,最小0.0245V
- 3针PH2.0接口
引脚定义
1.信号输出
2.电源地(GND)
3.空脚
链接示意图
示例代码
void setup() { Serial.beign(9600); } void loop() { // read the input on analog pin 0: int sensorValue = analogRead(A0); //This divider module will divide the measured voltage by 5, the maximum voltage it can measure is 25V. float voltage = sensorValue * (25.0 / 1023.0); // print out the value you read: Serial.println(voltage); }