基于HX720D的重量采集仪

简介: 

stm32控制HX720D芯片采集重量,实现重量采集,重量信息显示在0.96寸的OLED液晶屏上,并预留串口,便于直接观测。

应用场景: 

应用于称重测试、智能电子秤、压力送变器等需要测量重量的场景。

一、产品简介

一款基于HX720D电子秤专用高精度AD转换芯片配合MCU采集处理实现的数显电子秤模块,带有0.96寸OLED显示屏接口,直观显示称重结果,具备串口输出功能,可同时串口输出称重结果。增加专用PAC转换芯片,模块可编程根据重量输出模拟电压,方便数据采集。

二、应用场景

应用于称重测试、智能电子秤、压力送变器等需要测量重量的场景。

三、 产品概述

本模块是软硬结合的形式。模块主要针对压力传感器数据进行采集处理,实现数据显示,以及串口和模拟电压的输出。带有电源指示灯,预留下载程序端子,可二次开发,实现串口不同协议不同速率,模拟电压输出设置等功能。

四、产品参数

1.输入电压:5V 1A直流电源供电,USB接口供电;

2.一路HX720D重量测量接口,用于接称重传感器;

3.一路串口对外发送数据;

4.两路LED工作指示灯,一路指示采集状态,一路指示电源状态;

5.0.96寸OLED液晶显示屏显示重量;

6.最大功率1W;

7.待机功耗小于0.1W;

8.尺寸:53mm x 55mm, 2层PCB设计,板厚1.6mm。

  • 43
    点赞
  • 31
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
好的,这是一个比较复杂的问题。下面是一个简单的流程,帮助你完成这个任务: 1. 硬件连接: 将HX711模块连接到Arduino,然后将ESP8266 WIFI模块连接到Arduino上。 2. 编写Arduino代码: 使用HX711库和ESP8266库,编写代码来读取HX711模块的值,并将其通过ESP8266 WIFI模块上传到手机app。下面是一个示例代码: ``` #include <HX711.h> #include <ESP8266WiFi.h> #include <WiFiClient.h> const char* ssid = "your_SSID"; const char* password = "your_PASSWORD"; const char* host = "your_APP_HOST"; const int port = 80; HX711 scale(DOUT_PIN, CLK_PIN); void setup() { Serial.begin(9600); scale.set_scale(SCALE_RATIO); scale.tare(); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(1000); Serial.println("Connecting to WiFi..."); } } void loop() { float weight = scale.get_units(); Serial.print("Weight: "); Serial.print(weight); Serial.println(" kg"); if (WiFi.status() == WL_CONNECTED) { WiFiClient client; if (client.connect(host, port)) { Serial.println("Connected to server"); String data = "weight=" + String(weight); client.println("POST /upload HTTP/1.1"); client.println("Host: " + String(host)); client.println("Content-Type: application/x-www-form-urlencoded"); client.println("Content-Length: " + String(data.length())); client.println(); client.println(data); Serial.println("Sent data to server"); } else { Serial.println("Connection failed"); } } else { Serial.println("WiFi not connected"); } delay(10000); } ``` 其中,DOUT_PIN和CLK_PIN分别是HX711模块的数据和时钟引脚,SCALE_RATIO是你使用HX711模块时设置的比例系数,ssid和password是你的WiFi名称和密码,host是你的app服务器主机地址。 3. 编写手机app: 使用Android Studio或其他开发工具,编写一个简单的app,用于接收从Arduino发送的数据。可以使用HTTP POST请求来接收数据。下面是一个示例代码: ``` public class MainActivity extends AppCompatActivity { private TextView mTextView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mTextView = findViewById(R.id.text_view); new Thread(new Runnable() { @Override public void run() { try { URL url = new URL("http://your_app_host/upload"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST"); conn.setDoOutput(true); conn.setDoInput(true); OutputStream os = conn.getOutputStream(); String data = "weight=0"; os.write(data.getBytes()); os.flush(); os.close(); InputStream is = conn.getInputStream(); BufferedReader br = new BufferedReader(new InputStreamReader(is)); String response = ""; String line; while ((line = br.readLine()) != null) { response += line; } br.close(); is.close(); conn.disconnect(); runOnUiThread(new Runnable() { @Override public void run() { mTextView.setText(response); } }); } catch (Exception e) { e.printStackTrace(); } } }).start(); } } ``` 其中,your_app_host是你设置的app服务器主机地址。 4. 运行程序: 将Arduino连接到电脑,上传Arduino代码。然后将ESP8266 WIFI模块连接到你的WiFi网络。最后,在手机上运行app,你应该能够看到从HX711模块读取的重量值。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值