meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

sensor:hx711 [2026/02/15 23:59] – created - external edit 127.0.0.1sensor:hx711 [2026/04/11 16:28] (current) vamsan
Line 2: Line 2:
 ====== LamaPLC: HX711 24-bit analog-to-digital converter (ADC) ====== ====== LamaPLC: HX711 24-bit analog-to-digital converter (ADC) ======
 {{ :sensor:hx_711_1.png?180|HX711 24-bit analog-to-digital converter (ADC) }} {{ :sensor:hx_711_1.png?180|HX711 24-bit analog-to-digital converter (ADC) }}
-The HX711 is a widely used, low-cost 24-bit analog-to-digital converter (ADC) integrated circuit with an internal amplifier, specifically designed to interface directly with bridge sensors such as load cells and strain gauges. +The HX711 is a widely used, low-cost 24-bit analogue-to-digital converter (ADC) integrated circuit with an internal amplifier, specifically designed to interface directly with bridge sensors such as load cells and strain gauges. 
  
 It is a popular component for DIY and commercial weighing-scale projects using microcontrollers such as Arduino and Raspberry Pi. It is a popular component for DIY and commercial weighing-scale projects using microcontrollers such as Arduino and Raspberry Pi.
Line 10: Line 10:
   * **High Resolution:** It provides 24-bit resolution, enabling precise measurement of small voltage changes.   * **High Resolution:** It provides 24-bit resolution, enabling precise measurement of small voltage changes.
   * **Integrated Amplifier (PGA):** Features an on-chip, low-noise Programmable Gain Amplifier (PGA) with selectable gains of 32, 64, or 128 to amplify very small signals from load cells.   * **Integrated Amplifier (PGA):** Features an on-chip, low-noise Programmable Gain Amplifier (PGA) with selectable gains of 32, 64, or 128 to amplify very small signals from load cells.
-  * **Dual Input Channels:** Two selectable differential input channels (Channel A and Channel B). Channel A is programmable for gains of 128 or 64, while Channel B has a fixed gain of 32.+  * **Dual Input Channels:** Two selectable differential input channels (Channel A and Channel B). Channel A is programmable to 128 or 64, while Channel B has a fixed gain of 32.
   * **Simple Interface:** Uses a simple two-wire serial interface (clock and data lines) that is easy to use with most microcontrollers and does not require complex programming of internal registers.   * **Simple Interface:** Uses a simple two-wire serial interface (clock and data lines) that is easy to use with most microcontrollers and does not require complex programming of internal registers.
-  * **Integrated Components:** Includes an on-chip power supply regulator for the load cell and ADC'analog supply, an internal oscillator, and a power-on-reset circuit, minimizing the need for external components.+  * **Integrated Components:** Includes an on-chip power supply regulator for the load cell and ADC'analogue supply, an internal oscillator, and a power-on-reset circuit, minimising the need for external components.
   * **Selectable Data Rate:** The output data rate can be set to either 10 samples per second (SPS) or 80 SPS.   * **Selectable Data Rate:** The output data rate can be set to either 10 samples per second (SPS) or 80 SPS.
   * **Power Efficiency:** Operates over a wide supply voltage range (2.6V to 5.5V) and has low power consumption, including a power-down mode of less than 1µA.   * **Power Efficiency:** Operates over a wide supply voltage range (2.6V to 5.5V) and has low power consumption, including a power-down mode of less than 1µA.
Line 49: Line 49:
 {{page>:tarhal}} {{page>:tarhal}}
  
 +==== HX711 module board pinout ====
 +The HX711 module is a 24-bit ADC meant for weight scales, serving as an interface between a load cell (bridge sensor) and a microcontroller. It usually features two pin sets: one for connecting the load cell (input) and another for the microcontroller (output).
 +
 +^Pin Label^Name^Description^Typical Wire Colour|
 +^E+|Excitation Positive|Positive supply to the load cell.|Red|
 +^E-|Excitation Negative|Ground/Negative supply to the load cell.|Black|
 +^A-|Channel A Negative|Negative differential signal input from the load cell.|White|
 +^A+|Channel A Positive|Positive differential signal input from the load cell.|Green|
 +^B-|Channel B Negative|Secondary input channel (lower priority/gain).|—|
 +^B+|Channel B Positive|Secondary input channel (lower priority/gain).|—|
 +^Vcc|Supply Voltage|Power supply for the module (**2.7V to 5.5V**).|—|
 +^GND|Ground|Common circuit ground.|—|
 +^DT / DAT|Data Out|Serial data output to the microcontroller.|—|
 +^SCK / CLK|Serial Clock|Clock signal input from the microcontroller.|—|
 +
 +**Key Connection Notes**
 +
 +  * **Microcontroller Pins:** The DT and SCK pins can be connected to any digital GPIO pins on your Arduino or ESP32; they do not require specific hardware SPI pins.
 +  * **Channel A vs. B:** Channel A is the primary input and supports a gain of 128 or 64. Channel B is for a second load cell and has a fixed gain of 32.
 +  * **Voltage Logic:** If you are using a 3.3V microcontroller (like an ESP32), ensure the module is powered appropriately. While many modules work at 3.3V, some "green" boards require a 5V supply to properly excite the load cell.
 +  * **Drift Prevention:** For the best accuracy, keep the load cell wires short and use a stable power source, as the HX711 is extremely sensitive to voltage fluctuations.
 ==== Arduino & HX711 ==== ==== Arduino & HX711 ====
 To get started, you'll need the HX711 Arduino Library by bogde, which is the community standard. You can install it directly via the Arduino Library Manager. To get started, you'll need the HX711 Arduino Library by bogde, which is the community standard. You can install it directly via the Arduino Library Manager.
Line 72: Line 93:
 **Basic Reading & Calibration Code** **Basic Reading & Calibration Code**
  
-This script initializes the scale, "tares" it (sets it to zero), and reads the weight.+This script initialises the scale, "tares" it (sets it to zero), and reads the weight.
  
 <code c> <code c>