Skip to content

tatobari/Q2-HX711-Arduino-Library

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Queuetue HX711 Arduino Library

Forked from: https://github.com/queuetue/Q2-HX711-Arduino-Library.

Copyright (c) 2015 Scott Russell ([email protected]), released under the MIT license.
See the LICENSE file for licensing details.

Note: Scott's version doesn't take into account the Two's Complement concept. It kind of ignores it with a workaround. In that library, there's a pull request from Sthing (#2) which implements a very elegant approach.

bogde's HX711 repo is the approach I've finally chosen.

A simple Arduino driver for the HX711 ADC.

The HX711 is a low-cost strain gauge amplifier produced by Avia Semiconductor. Breakout boards are available for it by many producers, including the Sparkfun 13230.

The HX711 communicates with a non-i2c compliant two wire protocol and provides an all-in-one solution to load cell amplification with relatively low noise. The value returned is a 24-bit in Two's Complement format, which means this is a signed number.

This library provides the code required to use an Arduino, the HX711 module and a strain gauge load cell to build a scale, force gauge or many other pressure or force sensitive projects.

The library has a single class, Q2HX711 with two functions.

Class

The Q2HX711 class takes two parameters on construction, the pin to use for data (output) and the pin to use to signal readiness (clock).

Functions

Function Description
read Returns a long integer that is the current value of the HX711
readyToSend Returns a boolean indicating if the HX711 is prepared to send data.

Example

Here is a simple example of using the HX711 on pins A2 and A3 to read a strain gauge and print it's current value:

#include <Q2HX711.h>
Q2HX711 hx711(A2, A3);
void setup() {
  Serial.begin(9600);
}

void loop() {
  Serial.println(hx711.read());
  delay(500);
}

About

Simple Arduino driver for the HX711 ADC

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 100.0%