Use of multiple HX711 modules #16054
-
Hello, I am using the HX711 gpio library of Robert-hh. I use multiple HX711 modules and only the last one I define triggers continuously. The rest triggers one time, afther that I get values but not the exact right ones. I was wondering how I can use multiple HX711 modules but without the pins overwriting each other. All help is welcome! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
Since the HX711 does not have something like a device addressing, pins cannot generally be shared. The CLK pin can be shared, since it is an input to the HX711. But the data pin must be separate per HX711. So you have to assign the HX711 DATA to several Pins of your board, or you have to use an external multiplexer. But since the multiplexer needs control pins as well, its only effective if you want to control four HX711 devices and more. |
Beta Was this translation helpful? Give feedback.
-
Each HX711 module should have its own dedicated GPIO pins for DATA and SCK. Sharing pins across modules will cause conflicts. hx1 = HX711(dout_pin=17, pd_sck_pin=27) # HX711 instance 1 hx1.set_scale(1000) hx2.set_scale(1000) hx3.set_scale(1000) value1 = hx1.read() print(f"HX711 1: {value1}") You can design a dual HX711 scales board |
Beta Was this translation helpful? Give feedback.
The hx711 repository is updated such the the hx711_pio.py code works with more than a single HX711. The state machine has to be selected in the constructor.