Component for Hx711

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Component for Hx711

Post by jgu1 »

Hi Ben!

I converted to an Arduino Mega. with a n I2c LCD display. Perfect, perfect. It is working so nice. Thank you. :D

I will try, (hope it is possible) to make some kind of auto calibration. Let´s say in the init, before loop, set a switch, if this is pressed during sart up.
Something like this:

1. First set the scaler to 1.0 by using a variable.
2. place a calibrations load on the loadcell.
3. calculate with your formel, and then we have the correct calibration.



But anyway, your component work perfect. I will play with it, and also see if I can get it workin with Martin´s MAX7219 component....

Thank´s.

Best regard jorgen.

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Component for Hx711

Post by jgu1 »

Hi again Ben!

I have now played with your new HX711 component- I´m very amazed at how well your HX711 component work. Nice and perfect.
And it is clear to see how the filters have impact.

I att. my testprogram, if anybody should be interested. I change a little in the testprogram from Wikie. I would like to see in the display
0.000 Kg or eks. 1.534 Kg. I did it in two ways, the one by counting and the other by using Modulus. Only to see what is fastests so you can change by choosing the macro´s Modulus or CountDisplay. :lol: I use a Huntleigh 1040 5 kg loadcell. Don´t laugh, I am sure there are other or maybe better way to do it. :wink:

Next, I will try ,if possible, to make calibrating the loadcell with a 100gr load or other value by pressing a botton.

Jorgen
Attachments
HX711_Example Mega04.fcfx
(20.53 KiB) Downloaded 240 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Component for Hx711

Post by Benj »

Hi Jorgen,

Glad you're liking the new component and it is working well for you.

There is one thing I am aware of and that is you can currently only select one of channel A or B and a fixed multiplier on the input. It might be nice to be able to switch between channels and change sensitivity without having to add a second component (as this gets a bit messy when talking to the same HX711 IC) so let me know if this would be of interest.

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Component for Hx711

Post by jgu1 »

Hi Ben!

It would be really good if you could add up to 4 load cells, and be able to add the values ​​from all load cells and then read the ssummary out.

Is it to much :wink:

Jorgen

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Component for Hx711

Post by Benj »

I think ideally you would need two HX711 ICs, each connected to two load cells on channels A and B. If the B channel fixed gain of 32x is acceptable. Channel A offers 128x or 64x.

Otherwise to use a single HX711 IC you in the territory of switching the load cells in and out e.g. using FETs or relays.

I'll think about how best to add A and B channel support to the component so at least you can have two load cells hooked up at once to a single HX711 IC on channels A and B.

Having multiple components on the panel shouldn't be any issue at all so 4x HX711 components and 4x ICs would currently work just fine with the current component as long as each IC has it's own unique clock and data pins. This way you can use the good channel A for all load cells.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Component for Hx711

Post by Benj »

Next, I will try ,if possible, to make calibrating the loadcell with a 100gr load or other value by pressing a botton.
I would maybe do something like this.

On power up check if calibrate button is pressed, maybe zero/tare button but press and hold for 6 seconds etc.
Wait for button release
Display "Clear Scales"
Wait for button press
Wait for button release
Zero reading to filtered reading
Display "Place 100g On Scales"
Wait for button press
Wait for button release
Take filtered reading and store into a Signed Long variable weight
Store result into a floating point variable Calc using this equation Calc = 100.0 / FLOAT weight
Split the float variable into 4 bytes and store into EEPROM memory (this is covered in another topic see below)
Display Thanks/Done message, maybe show calibration value for reference or diagnostics?

Otherwise If calibrate button is not pressed then use the last calibration value from EEPROM. Read the 4 bytes and then recombine into a float variable.

You can improve futher by having timeouts for the various wait stages which will basically cancel the calibration operation and resume normal operation.



To use EEPROM with a Float variable see here.
http://www.matrixtsl.com/mmforums/viewt ... 046#p71094

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Component for Hx711

Post by jgu1 »

Hi Ben!

Thank you for your explanation Ben. It all makes sense.
Did not know, but when I look at the print on HX711 you can see an extra input "B" so each hx711 has 2 channels wiith each gain (Not avalible yet) :wink:

And, If I want, I can add more than one HX711 on my device (in my case Mega2650).

Concerning the "aut" calibration, I will work on it, Good solution.


Thank´s again for thi brilliant component and help.

Jorgen

Post Reply