-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple HX711 sharing CLK? #40
Comments
Need to think about it and it is 10:30 pm here so I will come back to this tomorrow. (updated incorrect statement) |
I thought sharing the clock line was the right way to do it. The MCU can ignore data on the other data lines when it's not actively reading that one. So it shouldn't matter if other HX711 are responding, right? Sharing data lines would mean we're going to connect all DOUT pins of each HX711 together? It's an output only pin so I don't think that's a good idea? Would love to hear from you tomorrow. Have a good night! |
Oops you're right |
Read the data-sheet after a good sleep :)
WARNING: Sharing the data lines is NOT possible as it could cause short circuit. So definitely not a good idea. Sharing the CLOCK lines will work and as said before it will have some side effects. The side effects I found so far: (page 4 and 5 datasheet)
So in short, sharing the CLOCK line causes all HX711 modules share the same state. Alternative is to use a multiplexer e.g. HC4052 |
Correct, if you create two HX711 objects with the library, only the object that calls read() will fetch data.
See the above side effects. |
FYI, I prepared some notes to add the above findings to the readme.md file. |
Another idea popped up, just to share. If you add AND gates (74LS08) to the HX711's you can create multiple SELECT lines,
|
Added example HX_loadcell_array.ino in develop branch. Will be integrated in master with an upcoming release (probably 0.3.8), timeline unknown. |
Thanks! ;-) I've been experimenting with your library earlier today. With a single HX711 for testing now it seems like get_units(10) takes approximately 800ms. Isn't the HX711 supposed to be able to go faster? |
The sensor blocks between reads, and it makes typically 10SPS (see below) hx711.cpp about line 90
// From datasheet page 4
// When output data is not ready for retrieval,
// digital output pin DOUT is HIGH.
float HX711::read()
{
// this BLOCKING wait takes most time...
while (digitalRead(_dataPin) == HIGH) yield(); Can you run the HX_performance.ino sketch and post your output?
The HX711 can be configured to 10 SPS or 80 SPS, however as all breakouts I have used If there is an explicit need I have planned future support on the could list |
If the blocking is a problem for your project you could
|
@SanderM2 |
As there is no additional questions/remarks I close the issue. |
Is it possible to have multiple HX711 connected and have them all shared the same CLK pin?
I'm running out of pins on my arduino and sharing the CLK should be possible I think? Just not sure if this library supports it.
The text was updated successfully, but these errors were encountered: