JohnK1987 / Mbed_lib-HX711_LoadCell

Library for interfacing ADC HX711 with a Load cell under MbedOS
GNU Affero General Public License v3.0
1 stars 0 forks source link

Getting random output values #1

Open Anshullanjewar opened 4 months ago

Anshullanjewar commented 4 months ago

This library works well when the circuit is isolated but when I am integrating this with my complete system it shows random values. I am using Nucleo F746ZG microcontroller. Also when I replace this Nucleo F746ZG microcontroller with arduino and change library the system works fine. Plz help me with this.

JohnK1987 commented 4 months ago

Hello,

this behavior usually mean the data transfer between MCU and HX711 was not done correctly. I added delay because original library did not have this and when the MCU is too fast the data are not readed correctly - Hx711 datasheet page 5. Then I found same fix was already done also in arduino library.

Try to adjust this delay https://github.com/JohnK1987/Mbed_lib-HX711_LoadCell/blob/2051ccc84e04635ea39821483854a86ad7bc023b/ML_HX711_LoadCell.cpp#L4

JohnK1987 commented 4 months ago

@Anshullanjewar any news?

Anshullanjewar commented 3 months ago

Hi @JohnK1987, Pardon me! I was inactive for the past few weeks. Regarding updates, I tried changing the delay still i was facing same issue.

JohnK1987 commented 3 months ago

Np, ok.

but when I am integrating this with my complete system...

Can you be more specific? I probably do not need see whole your code but i need to understand what could happen, so I need more context.

Anshullanjewar commented 3 months ago

I am building a system where steppers, servos, and mega-torque motors are connected. When the loadcell circuit is isolated it works fine giving output correct values but while installing this setup with the system then started getting some random values

JohnK1987 commented 3 months ago

Ok, but this not much specific. I mean are you using Threads, Interrupts? What pins are you use for the HX711 and what for rest peripherals? It seems like a pin collision or collision due another blocking thread work or interrupt processing.