Page 1 of 1

HX711 Raspberry pi pico

Posted: Wed Aug 11, 2021 12:56 pm
by neveregret
Hello guys,I am new for using micropython and i want to use loadcell. I found this library https://github.com/robert-hh/hx711 .Thıs library literally says everything .But as i said earlier, i m new with these projects so i want to konw how can i scale this. Because there is a lot of video about arduino with hx711. But i really dont know if i use Robert's rp2040 ' code can i measure reall value of things? If ican't measure reall value how can i scale it.Thank you for everything ,again sorry for noob question.

Re: HX711 Raspberry pi pico

Posted: Wed Aug 11, 2021 1:06 pm
by Roberthh
Hello @neverregret, The lib just returns a number, which is the output of the internal ADC. It is proportional to a force on a sensor, but the scaling has to be done by yourself, once you have the mechanical set-up ready with the load cell. The HX711 does not know the properties of the load cell and the setup it is used in. It could be a weight, it could be the force at any mechanical construction. That's all up to you. For instance, if it is a weight, you have to put a well know load onto it (like 10kg) an than you have a factor between weight and HX711 reading.

Re: HX711 Raspberry pi pico

Posted: Wed Aug 11, 2021 1:17 pm
by neveregret
Roberthh wrote:
Wed Aug 11, 2021 1:06 pm
Hello @neverregret, The lib just returns a number, which is the output of the internal ADC. It is proportional to a force on a sensor, but the scaling has to be done by yourself, once you have the mechanical set-up ready with the load cell. The HX711 does not know the properties of the load cell and the setup it is used in. It could be a weight, it could be the force at any mechanical construction. That's all up to you. For instance, if it is a weight, you have to put a well know load onto it (like 10kg) an than you have a factor between weight and HX711 reading.
Okay @Roberthh, thanks a lot i ll try that tomorrow.I ll try to scale it.I hope i can do that.But if couldn't can i ask for help to you ?
Thanks again, this is my first project with rp2040 before this i used arduino to use servo.

Re: HX711 Raspberry pi pico

Posted: Tue Oct 19, 2021 5:19 am
by GioH
Hi neveregret. Were you able to correctly execute the code and get the correct measurement?. :cry: :?: :?: :?: :?: :?: :?:
In advance thanks for your help.

Re: HX711 Raspberry pi pico

Posted: Tue Oct 19, 2021 5:34 am
by neveregret
GioH wrote:
Tue Oct 19, 2021 5:19 am
Hi neveregret. Were you able to correctly execute the code and get the correct measurement?. :cry: :?: :?: :?: :?: :?: :?:
In advance thanks for your help.
Hi, I am using hx711 now and I am getting correct values. https://github.com/SergeyPiskunov/micropython-hx711 you can use this. It is easy. Install hx711.py and scales.py.
My scales is working like this but you need to set yours with known weight too.

Code: Select all

val = (scales.stable_value()*(0.0005)*8)/100
print(val)

the original code bottom side:

Code: Select all

scales = Scales(d_out=5, pd_sck=4)
    scales.tare()
    val = scales.stable_value()
    print(val)
If you have any problem, you can ask.

Re: HX711 Raspberry pi pico

Posted: Tue Feb 15, 2022 1:53 pm
by fatih_aydemiir
Hi,
I am beginner about raspberry pi pico and I want to try HX711 but I get this message. Could you help me?

message:
Traceback (most recent call last):
File "<stdin>", line 38, in <module>
File "<stdin>", line 25, in stable_value
File "<stdin>", line 31, in _stabilizer
File "<stdin>", line 31, in <listcomp>
ZeroDivisionError: divide by zero

Best regards.

Re: HX711 Raspberry pi pico

Posted: Tue Feb 15, 2022 2:03 pm
by Roberthh
Which hx711 lib do you use?

Re: HX711 Raspberry pi pico

Posted: Tue Feb 15, 2022 2:09 pm
by fatih_aydemiir
Thanks for reply.
I use of SergeyPiskunov hx711 lib file.

Re: HX711 Raspberry pi pico

Posted: Tue Feb 15, 2022 3:54 pm
by Roberthh
Hard to tell. It looks more like no data is read from the HX711. Check the wiring. It should be GND, Vcc, Din, CLK.

Re: HX711 Raspberry pi pico

Posted: Wed Feb 16, 2022 7:13 am
by fatih_aydemiir
I will check my connection. Thanks for reply.