API Reference

HX711

CircuitPython driver for the HX711 24-bit ADC for Load Cells / Strain Gauges

  • Author(s): Liz Clark

Implementation Notes

Hardware:

Software and Dependencies:

class adafruit_hx711.hx711.HX711(data_pin: DigitalInOut, clock_pin: DigitalInOut)

HX711 ADC driver

Initialize the HX711 module.

Parameters:
  • data_pin – The data pin.

  • clock_pin – The clock pin.

property is_busy: bool

Check if the HX711 is busy.

Returns:

True if busy, False otherwise.

power_down(down: bool) None

Power down or wake up the HX711.

Parameters:

down – True to power down, False to wake up.

read(chan_gain: int = CHAN_A_GAIN_128) int

Read ADC value with specified gain.

Parameters:

chan_gain – Gain and channel configuration.

Returns:

ADC value.

read_channel_blocking(chan_gain: int) int

Read ADC value with specified gain in a blocking manner.

Parameters:

chan_gain – Gain and channel configuration.

Returns:

ADC value.

property tare_value_a: int

Get the tare value for channel A.

Returns:

Tare value for channel A.

property tare_value_b: int

Get the tare value for channel B.

Returns:

Tare value for channel B.

AnalogIn

AnalogIn for ADC readings.

  • Author(s): Liz Clark

class adafruit_hx711.analog_in.AnalogIn(adc: HX711, chan_gain: int = HX711.CHAN_A_GAIN_128)

AnalogIn Mock Implementation for ADC Reads.

Parameters:
  • adc (HX711) – The ADC object.

  • chan_gain (int) – Gain and channel configuration.

property value: int

Returns the value of an ADC pin as an integer.