HX711 Raspberry pi pico
-
- Posts: 28
- Joined: Sun Aug 08, 2021 5:48 pm
HX711 Raspberry pi pico
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
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.
-
- Posts: 28
- Joined: Sun Aug 08, 2021 5:48 pm
Re: HX711 Raspberry pi pico
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 ?Roberthh wrote: ↑Wed Aug 11, 2021 1:06 pmHello @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.
Thanks again, this is my first project with rp2040 before this i used arduino to use servo.
Re: HX711 Raspberry pi pico
Hi neveregret. Were you able to correctly execute the code and get the correct measurement?.
In advance thanks for your help.
In advance thanks for your help.
-
- Posts: 28
- Joined: Sun Aug 08, 2021 5:48 pm
Re: HX711 Raspberry pi pico
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)
-
- Posts: 3
- Joined: Tue Feb 15, 2022 1:45 pm
Re: HX711 Raspberry pi pico
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.
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
Which hx711 lib do you use?
-
- Posts: 3
- Joined: Tue Feb 15, 2022 1:45 pm
Re: HX711 Raspberry pi pico
Thanks for reply.
I use of SergeyPiskunov hx711 lib file.
I use of SergeyPiskunov hx711 lib file.
Re: HX711 Raspberry pi pico
Hard to tell. It looks more like no data is read from the HX711. Check the wiring. It should be GND, Vcc, Din, CLK.
-
- Posts: 3
- Joined: Tue Feb 15, 2022 1:45 pm
Re: HX711 Raspberry pi pico
I will check my connection. Thanks for reply.