簡體   English   中英

稱重傳感器 Arduino HX711 上下波動

[英]Load cell Arduino HX711 Fluctuating up

我構建了一個帶有四個 50 Kg 稱重傳感器和 HX711 放大器的 Arduino 浴室秤。 一些稱重傳感器線連接在一起以形成惠斯通電橋布置。 我使用的是 Arduino MEGA 2560。我之前在另一個站上建立了相同的規模,它工作得很好。 我的新站不停地波動,即使秤上沒有任何重量。 這是我的校准:

#include "HX711.h"

#define LOADCELL_DOUT_PIN  3
#define LOADCELL_SCK_PIN  2

HX711 scale;

float calibration_factor = -6440; //-6440 worked for my previous scale setup

void setup() {
  Serial.begin(9600);
  Serial.println("HX711 calibration sketch");
  Serial.println("Remove all weight from scale");
  Serial.println("After readings begin, place known weight on scale");
  Serial.println("Press + or a to increase calibration factor");
  Serial.println("Press - or z to decrease calibration factor");

  scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
  scale.set_scale();
  scale.tare(); //Reset the scale to 0

  long zero_factor = scale.read_average(); //Get a baseline reading
  Serial.print("Zero factor: "); //This can be used to remove the need to tare the scale. Useful in permanent scale projects.
  Serial.println(zero_factor);
}

void loop() {

  scale.set_scale(calibration_factor); //Adjust to this calibration factor

  Serial.print("Reading: ");
  Serial.print(scale.get_units(), 2);
  Serial.print(" kg"); //Change this to kg and re-adjust the calibration factor if you follow SI units like a sane person
  Serial.print(" calibration_factor: ");
  Serial.print(calibration_factor);
  Serial.println();

  if(Serial.available())
  {
    char temp = Serial.read();
    if(temp == '+' || temp == 'a')
      calibration_factor += 10;
    else if(temp == '-' || temp == 'z')
      calibration_factor -= 10;
  }
}

我最近買了一些非常便宜(10.00 美元 5 個)的 HX 711 板。 我注意到你做的同樣的事情; 價值向上漂移。 我檢查了車載稱重傳感器電源,它似乎有缺陷。 應該是 1.25 伏的帶隙參考電壓 (VBG) 實際上是 1.9 伏,因此板載調節器只是將輸入的 5 伏直接發送到稱重傳感器; 沒有規定。 5伏可能漂移,HX711上的傳輸晶體管的電壓降可能隨溫度變化。 我買的所有 5 塊板都以相同的方式運行。 如果我只是將發射極短接到傳輸晶體管上的集電極,我可能會得到更少的漂移。 我會嘗試購買“真實”板,看看是否更好。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM