教你打造电子测量工具-电流转电压表

2019-07-171.2万
AI 快速预览详细 收起
本文介绍了如何使用Arduino Uno和Nokia 5110打造一个电子测压表,将0~25mA电流信号转换成0~3V电压信号。所用模块包括Arduino Uno和Nokia 5110。该模块采用0.1%高精密检流电阻和超低噪声轨到轨零漂移运放,精度高,无需校准。供电电压为3.3~5.5V,检测范围为0~25mA DC,测量精度为±0.5% F.S. @ 16-bit ADC,±2% F.S. @ 10-bit ADC。通过简单的连线和代码,可以轻松实现电流信号到电压信号的转换,适用于故障检测和超限检测。


有没有发现没有电流表测量电路其实挺不方便的。实际值和计算值有差距不怕,就怕差距太大,可能会烧掉元件。项目目的就是打造一个电子测压表。

所用模块如下:

教你打造电子测量工具-电流转电压表图7
Arduino uno
教你打造电子测量工具-电流转电压表图1
教你打造电子测量工具-电流转电压表图4
Nokia 5110

============================
主模块概述如下:
简介
这款电流转电压模块能将0~25mA电流信号线性转换成0~3V电压信号。工业传感器或设备通常具有4~20mA电流信号输出,主控板搭配本产
品后就能方便的读取电流信号了。
通常情况下,低于4mA的电流信号可用于故障诊断,高于20mA的电流信号可用于超限检测,因此这款模块特意设计了0~25mA的宽量程检测
范围,兼容故障检测、超限检测等需求。
本模块采用0.1%高精密检流电阻和超低噪声轨到轨零漂移运放,精度高,无需校准,使用起来简单方便。3.3V~5.5V宽电压供电、0~3V电压
信号输出,能兼容更多的主控板,适应更多的应用场景。


技术规格
供电电压:3.3~5.5V
检测范围:0~25mA DC
测量精度:±0.5% F.S. @ 16-bit ADC, ±2% F.S. @ 10-bit ADC


、、、、、、、、、、、
教你打造电子测量工具-电流转电压表图5
测试代码如下:
[mw_shl_code=applescript,true]//made by gada888-for DFRoboot.com.cn-
#define CurrentSensorPin  A2
#define VREF 5000 // ADC's reference voltage on your Arduino,typical value:5000mV
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_PCD8544.h>

Adafruit_PCD8544 display = Adafruit_PCD8544(13, 11, 5, 4, 3);

unsigned int voltage; //unit:mV
float current;  //unit:mA

void setup()
{
   Serial.begin(115200);
   display.begin();

  display.setContrast(60);
  display.clearDisplay();   // clears the screen and buffer
}

void loop()
{
  display.setTextSize(1);
  set_text(11,0,"Vol-to-CA!",BLACK);
  delay(500);

display.setCursor(0,15);
display.print("Vol(mV): ");
display.println(voltage);
display.display();
delay(1000);

display.setCursor(0,25);
display.print("CA(mA): ");
display.println(current);
display.display();
delay(1000);
  
    voltage = analogRead(CurrentSensorPin)/1024.0*VREF;
    Serial.print("voltage:");
    Serial.print(voltage);
    Serial.print("mV  ");
    current = voltage/120.0;  //Sense Resistor:120ohm
    Serial.print("current:");
    Serial.print(current);
    Serial.println("mA");
    delay(1000);

  int x=0;
  for(int i=0;i<(5.6*8);i++){
    set_text(x,40,"gada888@msn.com",BLACK);
    delay(i==0?1000:100);
    if(i<(5.6*8)-1)set_text(x,40,"gada888@msn.com",WHITE);
    if((i)<(2.74*8))x-=1;else x+=1;
  }
  delay(250);
  
  display.clearDisplay();     
}

void set_text(int x,int y,String text,int color){
  
  display.setTextColor(color);
  display.setCursor(x,y);      
  display.println(text);      
  display.display();         
}[/mw_shl_code]
================
教你打造电子测量工具-电流转电压表图6
串口数据
教你打造电子测量工具-电流转电压表图8
连线图
教你打造电子测量工具-电流转电压表图2
教你打造电子测量工具-电流转电压表图3
实际运行结果





创作许可协议

本项目采用 None(不开放任何权利,保留所有权利) 进行许可。

评论(3)
gada888
gada888
作者
只要电池电压不超过传感器额定测量值,可以直接测
fnvHThKh
fnvHThKh
这个是一个一个电池测量电压,如果有多个电池,怎么测量呢?
DFryegiK3O4
DFryegiK3O4
[backcolor=rgb(250, 250, 250)][font=微软雅黑]精度高,无需校准,使用起来简单方便 [/font][/backcolor][font=微软雅黑]铁托盘 钢托盘 [/font][font=微软雅黑]
[/font]
[font=微软雅黑]钢制托盘 金属托盘[/font]
[font=微软雅黑]
[/font]
[font=微软雅黑] 出口托盘 托盘厂家[/font]
[font=微软雅黑]
[/font]
[font=微软雅黑]
托盘价格 www.gztpcj.com[/font]
- 没有更多了 -