Skip to main content

Based on SergeyPiskunov's implementation. More functionalities.

Project description

hx711-mpython

Micropython driver for the HX711 24-Bit Analog-to-Digital Converter

Latest version supports:

  • retrieving data from the channel 'A' with gain 128 and 64, the channel 'B' with gain 32 in a raw form and a form converted from the two's complement.
  • sending "power off" sequence to switch device to the power-saving mode.
  • sending "power on" sequence with the gain saved before the "power off".
  • checking if the device is ready for the data retrieval.

Example for the ESP8266:

Refer to the example folder. It can permorm tare and set a ratio to change the raw input. D_OUT pin is connected to the GPIO 5
PD_SCK pin is connected to the GPIO 4
Using internal HX711 oscillator, so ESP8266's frequency is set to 160000000

from scales import Scales

scale = Scales(d_out=4, pd_sck=5)
scale.reset()
scale.tare()
while True:
    if scale.is_ready():
        val = scale.stable_value()
        print(val)
        sleep_us(500)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hx711_micropython_impementation-0.0.2.tar.gz (2.1 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page