0
  • 聊天消息
  • 系统消息
  • 评论与回复
登录后你可以
  • 下载海量资料
  • 学习在线课程
  • 观看技术视频
  • 写文章/发帖/加入社区
会员中心
创作中心

完善资料让更多小伙伴认识你,还能领取20积分哦,立即完善>

3天内不再提示

如何制作张力秤

454398 来源:网络整理 作者:佚名 2019-11-09 09:57 次阅读

步骤1:安装称重传感器

首先,我们要安装称重传感器。您的坐骑将是唯一的,但是这里是您需要遵循的准则:

1。钢制称重传感器是一块板,中间装有应变片。称重传感器通过感应称重传感器弯曲多少来测量力。

2。支架通过称重传感器梁两端的孔连接。托架的形状使拉力施加在测力传感器梁的中心。由于其形状和固定位置,拉动托架时称重传感器梁会弯曲。

3。将括号钩到要测量的内容上。为此,最好使用可以自由移动的东西(例如链,钩,结实的绳子或扎带)。您希望称重传感器和托架组件能够使其自身在称重方向上居中,以便测量准确。

步骤2:为称重传感器和HX711接线

请参阅接线图,以了解如何连接称重传感器,HX711和Arduino

在所示的行李箱式称重传感器上,有多个应变仪已经连接到惠斯通电桥。您所需要做的就是以正确的方向将导线连接到HX711板上。

步骤3:将HX711库添加到Arduino IDE

HX711库位于此处:https://github.com/bogde/HX711

有关如何将库添加到Arduino IDE的说明,请参见Arduino网站上的此链接:https://www。 arduino.cc/zh-CN/Guide/Libraries

步骤4:校准并称重!

Sparkfun有出色的Arduino程序可以运行规模。最新版本可以在GitHub上找到,并在下面转载:https://github.com/sparkfun/HX711-Load-Cell-Amplifier

第一步是确定秤的校准因子。为此,请运行以下代码

/*

Example using the SparkFun HX711 breakout board with a scale

By: Nathan Seidle

SparkFun Electronics

Date: November 19th, 2014

License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license)。

This is the calibration sketch. Use it to determine the calibration_factor that the main example uses. It also

outputs the zero_factor useful for projects that have a permanent mass on the scale in between power cycles.

Setup your scale and start the sketch WITHOUT a weight on the scale

Once readings are displayed place the weight on the scale

Press +/- or a/z to adjust the calibration_factor until the output readings match the known weight

Use this calibration_factor on the example sketch

This example assumes pounds (lbs)。 If you prefer kilograms, change the Serial.print(“ lbs”); line to kg. The

calibration factor will be significantly different but it will be linearly related to lbs (1 lbs = 0.453592 kg)。

Your calibration factor may be very positive or very negative. It all depends on the setup of your scale system

and the direction the sensors deflect from zero state

This example code uses bogde‘s excellent library:“https://github.com/bogde/HX711”

bogde’s library is released under a GNU GENERAL PUBLIC LICENSE

Arduino pin 2 -》 HX711 CLK

3 -》 DOUT

5V -》 VCC

GND -》 GND

Most any pin on the Arduino Uno will be compatible with DOUT/CLK.

The HX711 board can be powered from 2.7V to 5V so the Arduino 5V power should be fine.

*/

#include “HX711.h”

#define DOUT 3

#define CLK 2

HX711 scale;

float calibration_factor = -7050; //-7050 worked for my 440lb max 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(DOUT, CLK);

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(), 1);

Serial.print(“ lbs”); //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;

}

}

在校准秤后,您可以运行以下示例程序,然后将其用于自己的目的:

/*

Example using the SparkFun HX711 breakout board with a scale

By: Nathan Seidle

SparkFun Electronics

Date: November 19th, 2014

License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license)。

This example demonstrates basic scale output. See the calibration sketch to get the calibration_factor for your

specific load cell setup.

This example code uses bogde‘s excellent library: “https://github.com/bogde/HX711”

bogde’s library is released under a GNU GENERAL PUBLIC LICENSE

The HX711 does one thing well: read load cells. The breakout board is compatible with any wheat-stone bridge

based load cell which should allow a user to measure everything from a few grams to tens of tons.

Arduino pin 2 -》 HX711 CLK

3 -》 DAT

5V -》 VCC

GND -》 GND

The HX711 board can be powered from 2.7V to 5V so the Arduino 5V power should be fine.

*/

#include “HX711.h”

#define calibration_factor -7050.0 //This value is obtained using the SparkFun_HX711_Calibration sketch

#define DOUT 3

#define CLK 2

HX711 scale;

void setup() {

Serial.begin(9600);

Serial.println(“HX711 scale demo”);

scale.begin(DOUT, CLK);

scale.set_scale(calibration_factor); //This value is obtained by using the SparkFun_HX711_Calibration sketch

scale.tare(); //Assuming there is no weight on the scale at start up, reset the scale to 0

Serial.println(“Readings:”);

}

void loop() {

Serial.print(“Reading: ”);

Serial.print(scale.get_units(), 1); //scale.get_units() returns a float

Serial.print(“ lbs”); //You can change this to kg but you‘ll need to refactor the calibration_factor

Serial.println();

}

责任编辑:wv

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉
  • HX711
    +关注

    关注

    7

    文章

    65

    浏览量

    44742
  • Arduino
    +关注

    关注

    187

    文章

    6454

    浏览量

    186010
收藏 人收藏

    评论

    相关推荐

    什么是张力变频器?张力变频器的优点有哪些?

    张力变频器(Tension Control Inverter)是一种用于张力控制的调节速度的设备。它通常与钢铁、电力、印刷、包装、食品、纺织等行业的设备一起使用,可对张力进行实时调节和控制,从而
    的头像 发表于 07-31 08:51 626次阅读

    张力控制器和plc控制区别在哪

    张力控制器和PLC控制器是工业自动化领域中常见的两种控制设备,它们在功能、结构、应用等方面都存在一定的差异。本文将从多个方面对张力控制器和PLC控制器进行详细的比较和分析。 张力控制器和PLC控制器
    的头像 发表于 06-12 11:18 610次阅读

    快准狠!体脂VS体重,你来选

    快准狠!体脂VS体重,你来选
    的头像 发表于 05-21 08:04 2.2w次阅读
    快准狠!体脂<b class='flag-5'>秤</b>VS体重<b class='flag-5'>秤</b>,你来选

    6芯航空插头接线时需施加不必要的张力

    德索工程师说道张力是指物体受到的拉伸力,而在6芯航空插头接线过程中,不适当的张力可能会对连接产生不良影响。具体来说,过大的张力可能导致插头与插座之间的配合精度降低,甚至造成接触件的变形或损坏。此外,
    的头像 发表于 04-11 15:50 256次阅读
    6芯航空插头接线时需施加不必要的<b class='flag-5'>张力</b>吗

    口袋电子方案设计有哪些步骤?

    口袋方案主要涉及小型、高精度的电子开发,这些通常体积小巧,便于携带和使用。今天我们来分析下关于口袋电子方案的开发流程涉及到哪些步骤,有具有什么样的特点。 设计一个口袋电子
    的头像 发表于 03-26 16:12 736次阅读

    电子技术分析——以口袋方案为例

    一、引言 口袋作为一种便携式电子称重设备,因其小巧、便携、精度高等特点,广泛应用于各种需要精确称重的场景。本文将对口袋的方案技术进行分析,包括其基本原理、硬件构成、软件设计等方面,旨在为相关
    的头像 发表于 03-19 14:24 317次阅读

    基于51单片机的电子设计

    电子发烧友网站提供《基于51单片机的电子设计.rar》资料免费下载
    发表于 01-12 10:16 9次下载

    电子方案芯片——ADC芯片CS1237

    随着科技的不断发展,电子已经成为我们日常生活中不可或缺的测量工具。为了满足用户对于高精度、高稳定性的需求,芯海ADC芯片CS1237应运而生,为电子方案带来了革命性的变革。
    的头像 发表于 12-20 15:50 2390次阅读

    ADI芯片在工业自动化张力放大器中的应用

    本次与大家分享的是世健和ADI联合举办的《世健·ADI工业趴:放飞思路,解封你的超能力》主题活动的二等奖文章:《ADI芯片在工业自动化张力放大器中的应用》。作者:zhaojun_xf01概述张力
    的头像 发表于 12-14 08:23 533次阅读
    ADI芯片在工业自动化<b class='flag-5'>张力</b>放大器中的应用

    电子方案——口袋方案芯片技术

    电子方案——口袋方案芯片技术
    的头像 发表于 12-08 15:47 499次阅读

    请问ad7731用于多通道电子可行吗?

    基于多通道(9个)及速度的原因(每个通道需要60sps),我选择了贵公司的AD7731作为电子的AD,用了共三片,设计时按照英文文档上推荐的电路搞的原理图,PCB设计时也参照了相关的要点,比如
    发表于 11-27 07:30

    电子人体方案之ADC芯片

      电子人体的悄然流行是人们对自我健康关注的提高,监测身体数据从而获得自身的健康状态是当下许多人的非常关注的事情。而电子人体也从普通的称重功能一步步发展成为带有历史记录并能够测量体脂和身体各项数据的智能人体测量工具。
    的头像 发表于 11-23 16:34 769次阅读

    吊钩方案怎么设计?

    吊钩在日常生活中往往是快递员使用较多,因其体积小便于携带,快递员上门收件时带上它既无压力也很方便,因此受到快递行业的喜爱。 吊钩的正常运行是通过压力传感器和ADC芯片、MCU控制等多种功能合作
    的头像 发表于 11-15 15:15 559次阅读

    pcb电路板表面张力是什么?

    pcb电路板表面张力是什么?
    的头像 发表于 11-15 10:50 789次阅读

    电子方案:电子设计中需要用到哪些元器件?

    大数据时代改变了我们以前很多凭感觉做出判断的习惯,清晰明了的数据对工作和生活都有更高效和便捷的好处。电子在如今注重数据监控的时代已经成为不可替代的电子测量工具。从人们开始对体重测量记录关注身体健康到宠物每天食物定量摄入、再到做蛋糕甜点需要固定的用量比例才能成功,这其中都有电子
    的头像 发表于 11-14 16:12 1023次阅读