Component for Hx711

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

Moderator: Benj

User avatar
CamargoF
Posts: 21
Joined: Thu Aug 02, 2018 8:16 pm
Location: Sao Paulo, SP - Brazil
Has thanked: 6 times
Been thanked: 5 times
Contact:

Component for Hx711

Postby CamargoF » Fri Aug 03, 2018 2:42 pm

I was not able to identify a component for the Hx711 (24-Bit Analog-to-Digital Converter for Weigh Scales) in FC8. Is there any?

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1161
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 357 times
Been thanked: 573 times
Contact:

Re: Component for Hx711

Postby QMESAR » Fri Aug 03, 2018 2:53 pm

Hi,
If the component does not appear under the component menu's then there is no component for the device.
You can always roll out your own component see this wiki page for help
https://www.matrixtsl.com/wiki/index.ph ... Components you can also use a C icon call and do the necessary
C code to use the device

User avatar
petesmart
Valued Contributor
Valued Contributor
Posts: 395
Joined: Thu May 06, 2010 11:42 am
Location: Sydney, Australia
Has thanked: 190 times
Been thanked: 140 times
Contact:

Re: Component for Hx711

Postby petesmart » Fri Aug 03, 2018 4:01 pm

Hello,

I have done the hx711....try searching the forum, I think may have posted the code....it was used for my beehive project

If not I will dig it out and drop it on the forum tomorrow...it’s 1am in Oz....so it’s teddy time :

Edit...and here is the link https://www.matrixtsl.com/mmforums/viewtopic.php?f=54&t=18004&p=76393&hilit=Hx711#p76393

Btw... I never got around to turning it into a component..but the code does work..perhaps you can have a crack at turning this into a component and share it on the forum :)

Enjoy

Best

PETE
These users thanked the author petesmart for the post (total 2):
Benj (Fri Aug 03, 2018 4:27 pm) • medelec35 (Fri Aug 03, 2018 8:08 pm)
Rating: 10.53%
 
sorry about that Chief!

User avatar
CamargoF
Posts: 21
Joined: Thu Aug 02, 2018 8:16 pm
Location: Sao Paulo, SP - Brazil
Has thanked: 6 times
Been thanked: 5 times
Contact:

Re: Component for Hx711

Postby CamargoF » Fri Aug 03, 2018 4:15 pm

Hi Mr. Smart, :D

I read your post about the hx711 macro in 2016 (FC6), that why I ask my question.
I thought it should be added to the library after two years and two FC releases.

Thank you for your reply.

Best regards,

Fernando

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

Re: Component for Hx711

Postby Benj » Fri Aug 03, 2018 4:44 pm

Hi Pete,

Would you be happy for us to build a component based on your macro? I've had a quick look and it looks like it should be fairly straightforward.

Edit: It's now done, but I'll wait for your go ahead Pete :D

kersing
Valued Contributor
Valued Contributor
Posts: 1873
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 530 times
Been thanked: 1040 times
Contact:

Re: Component for Hx711

Postby kersing » Fri Aug 03, 2018 4:52 pm

CamargoF wrote:I read your post about the hx711 macro in 2016 (FC6), that why I ask my question.
I thought it should be added to the library after two years and two FC releases.


Matrix TSL can not simply grab the code a user supplies and include it in a commercial product. They at least need to have permission from that user (which Benj just asked for).

@Matrix: When FC6 was released there was talk about a component repository/store. With the FC8 update feature in place, can this idea be revisited? (I'm hoping it can be a simple extension of the update system)
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

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

Re: Component for Hx711

Postby Benj » Fri Aug 03, 2018 4:58 pm

Hi Jac,

@Matrix: When FC6 was released there was talk about a component repository/store. With the FC8 update feature in place, can this idea be revisited? (I'm hoping it can be a simple extension of the update system)


We have some management on board with this idea, others are not so keen. We have lots on atm so I don't see it happening this year but hopefully it will come not too far down the road. The update system certainly does open the door to this type of thing. It's all the other back end stuff to allow users to post components and potentially monetize them that would need attention. We have even talked about no component packs and each component being an individual purchase but at the moment your guess is as good as mine :wink: .
These users thanked the author Benj for the post:
QMESAR (Fri Aug 03, 2018 5:39 pm)
Rating: 5.26%
 

User avatar
petesmart
Valued Contributor
Valued Contributor
Posts: 395
Joined: Thu May 06, 2010 11:42 am
Location: Sydney, Australia
Has thanked: 190 times
Been thanked: 140 times
Contact:

Re: Component for Hx711

Postby petesmart » Fri Aug 03, 2018 5:12 pm

Go for it Ben....happy for you to use the code on a commercial basis, with no strings attached...

Best

Pete

P.s. @fernando...I don’t work for Matrix, therefore it’s not automatic that Matrix would create a component out of it.. just so you know the forum members create and share code and components freely in the spirit of mutual support..we encourage new members to engage with us in creating projects and sharing...the wisdom of the crowd and sharing is a wonderful thing.

Btw thanks to Ben at Matrix for taking the initiative and creating the component of the back of my code..and Jack I support you idea of a code repository... maybe us forum folk could run it if Matrix create a space...I’m happy to pitch in as I can see the value...it will also address some of the concerns that I have seen recently

what do you all think?
These users thanked the author petesmart for the post (total 3):
QMESAR (Fri Aug 03, 2018 5:39 pm) • medelec35 (Fri Aug 03, 2018 8:11 pm) • Benj (Mon Aug 06, 2018 12:26 pm)
Rating: 15.79%
 
sorry about that Chief!

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1161
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 357 times
Been thanked: 573 times
Contact:

Re: Component for Hx711

Postby QMESAR » Fri Aug 03, 2018 5:46 pm

Hi All,
I am quite happy to help post some components as we go along if there is place we we can place them and they are central and always in one place
as at the moment the stuff is a bit all over the forum
I support your idea Jac

@Fernando,
As pete said we are small community with a relative small development team(MATRIX) that does wonderful things for us and we on the forum try to help and support as much as we can to the benefit of all FC users ,with that said we also have to have some patcience with things we want and need
it not a quick ask in the forum and the next day you have your request although many times Ben and Leigh are just amazing and produce as today with the Hx sensor.
Ben you are a star as always :D Thanks pete for your initial work on the code for the sensor.
These users thanked the author QMESAR for the post (total 2):
petesmart (Fri Aug 03, 2018 10:35 pm) • Benj (Mon Aug 06, 2018 12:26 pm)
Rating: 10.53%
 

jgu1
Posts: 1105
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1010 times
Been thanked: 255 times
Contact:

Re: Component for Hx711

Postby jgu1 » Fri Aug 03, 2018 7:13 pm

Hi all!

really a useful component. Unfortunately I am not able to make one. Look forward if it will be added to componentlist. :D

Br Jorgen
These users thanked the author jgu1 for the post:
Benj (Mon Aug 06, 2018 12:26 pm)
Rating: 5.26%
 

User avatar
CamargoF
Posts: 21
Joined: Thu Aug 02, 2018 8:16 pm
Location: Sao Paulo, SP - Brazil
Has thanked: 6 times
Been thanked: 5 times
Contact:

Re: Component for Hx711

Postby CamargoF » Fri Aug 03, 2018 8:45 pm

I strongly recommend Matrix to create a open-source component community to make available components from community.
It is the cheapest way to increase the number of developer and to improve the IDE tools.

I suggested you work as Apple do:
(1) Evaluated the component before release it to the community.
(2) In this evaluation Matrix will be "training" programmers to make components.
(3) The released component will have all necessary information to be used, demanding minimal support from Matrix.
(4) Matrix will guarantee the software quality to do not compromise FC.

I will try to help.
These users thanked the author CamargoF for the post:
Benj (Mon Aug 06, 2018 12:26 pm)
Rating: 5.26%
 

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

Re: Component for Hx711

Postby Benj » Mon Aug 06, 2018 12:27 pm

Thanks to all on this, some great comments and suggestions there :D

I've now pushed the Hx711 component to the Flowcode v8 update system.

Any problems then please let me know.
These users thanked the author Benj for the post (total 4):
petesmart (Mon Aug 06, 2018 1:19 pm) • CamargoF (Mon Aug 06, 2018 1:27 pm) • stefan.erni (Mon Aug 06, 2018 1:48 pm) • jgu1 (Tue Aug 07, 2018 5:40 am)
Rating: 21.05%
 

jgu1
Posts: 1105
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1010 times
Been thanked: 255 times
Contact:

Re: Component for Hx711

Postby jgu1 » Tue Aug 07, 2018 8:26 pm

Hi!

Thank´s to Ben for the component. I already order a handful of hx711 from Ebay ( have some loadcell )

Is it to much to ask for a smal example with a display I can investergate while I am wating for the device. I am unsure how to set it up


Thank´s in advance

Br jorgen
Attachments
Hx.PNG
Hx.PNG (14.66 KiB) Viewed 3818 times

User avatar
petesmart
Valued Contributor
Valued Contributor
Posts: 395
Joined: Thu May 06, 2010 11:42 am
Location: Sydney, Australia
Has thanked: 190 times
Been thanked: 140 times
Contact:

Re: Component for Hx711

Postby petesmart » Wed Aug 08, 2018 10:22 am

Hey Jorgen,

Look here...this is the code and macros the component was based on.
This should get you started

Best

Pete
These users thanked the author petesmart for the post (total 4):
stefan.erni (Wed Aug 08, 2018 10:54 am) • Benj (Wed Aug 08, 2018 11:17 am) • medelec35 (Wed Aug 08, 2018 11:25 am) • jgu1 (Wed Aug 08, 2018 5:37 pm)
Rating: 21.05%
 
sorry about that Chief!

jgu1
Posts: 1105
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1010 times
Been thanked: 255 times
Contact:

Re: Component for Hx711

Postby jgu1 » Wed Aug 08, 2018 5:38 pm

Hi Pete!

Thank you very much Pete. I can see this examble it is bitbanging, and did not tell mush of these settings in Ben´s component, :wink: please.

Br jorgen
Attachments
Hx.PNG
Hx.PNG (14.66 KiB) Viewed 3772 times

User avatar
CamargoF
Posts: 21
Joined: Thu Aug 02, 2018 8:16 pm
Location: Sao Paulo, SP - Brazil
Has thanked: 6 times
Been thanked: 5 times
Contact:

Re: Component for Hx711

Postby CamargoF » Wed Aug 22, 2018 4:32 pm

I did my own implementation and it is working.
I have two prototypes: with 1 Hx711 and with 4 Hx711.

I would like to know if you could create a video explaining how to create the component, complementing the wiki?

It will be nice if you could explain how can I simulate the Hx711 operation.

jgu1
Posts: 1105
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1010 times
Been thanked: 255 times
Contact:

Re: Component for Hx711

Postby jgu1 » Wed Aug 22, 2018 9:00 pm

Hi carmagof!

Would you share your testprogram. I domt know how to set it up. Please

Br jorgen

User avatar
CamargoF
Posts: 21
Joined: Thu Aug 02, 2018 8:16 pm
Location: Sao Paulo, SP - Brazil
Has thanked: 6 times
Been thanked: 5 times
Contact:

Re: Component for Hx711

Postby CamargoF » Thu Aug 23, 2018 3:23 pm

That is the point.
I was not able to simulate the Hx711 on Flowcode.

The only way I had to test was upload the firmware to Arduino.
On the test I sent all Hx711 reading through the serial USB and use the Arduino serial monitor tool to read the measurements.

That is the reason I asked for the tutorial explaining how to create the component and the simulation interface.

If you want I can share my code with the functions:
  • Initialize(): initialize all interface variables and execute Reset() and first reading to set the input port and gain.
  • Reset(): force the initialization of the Hx711 and check if it is connected.
  • Read(): read the Hx711 returning a positive value (0x00000000~0x00FFFFFF) or 0x01000000 if disconnected.
  • Get(): compute the average of 4 readings and convert it to the unit you want (in my case grams).

Please, confirm if you need it since I will need some time to translate the messages and variable names to English, since the code had been written in Portuguese. :D
These users thanked the author CamargoF for the post:
jgu1 (Thu Aug 23, 2018 6:09 pm)
Rating: 5.26%
 

jgu1
Posts: 1105
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1010 times
Been thanked: 255 times
Contact:

Re: Component for Hx711

Postby jgu1 » Thu Aug 23, 2018 6:11 pm

Hi again.

Ok, thought you have managed to get it run. I misunderstod. :wink:

Br .jorgen
These users thanked the author jgu1 for the post:
CamargoF (Thu Aug 23, 2018 9:03 pm)
Rating: 5.26%
 

jgu1
Posts: 1105
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1010 times
Been thanked: 255 times
Contact:

Re: Component for Hx711

Postby jgu1 » Mon Sep 03, 2018 8:24 pm

Hi All!

I just received my HX711 today. Of course testing, but it will not work, I only see 5898 in the display.


I have to admit that I guess in terms of most setting. I can not find anything about this topic anywhere. Will anyone please try to see if I've done it wrong. Please. :D

Thank´s in advance.

Jorgen
Attachments
LoadcellHX711.fcfx
(8.9 KiB) Downloaded 56 times

jgu1
Posts: 1105
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1010 times
Been thanked: 255 times
Contact:

Re: Component for Hx711

Postby jgu1 » Wed Sep 05, 2018 6:46 pm

Hi Ben!

You have created the component. I I ask you kindly will you then please tell me the basic for the settings in the HX711 component. The I can start and make my experience. Please.

Scale = ?
Calibrate = ?
Average count= ?
Average_loop_delay = ?
Auto Zero = ?

Or maybe a small exable.

Br Jorgen

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

Re: Component for Hx711

Postby Benj » Thu Sep 06, 2018 9:29 am

Hello Jorgen,

I have been playing in the office with one of these modules and think we can make the component easier to use. I'm not 100% on the parameters myself mainly because it's not my code ;)

For now here is a guessed explanation of the parameters.

Scale = Scaling factor, start with 1.0 to give you unity scale and then when you come to calibrate your sensor you can plug in a value here to fit.
Calibrate = Not sure on this one, maybe try 1.0 and 0.0?
Average Count = Number of samples to take in a single operation to try and filter out high frequency noise and spikes
Average Loop Delay = Number of milliseconds to wait in between samples
Auto Zero = 0 for normal operation, 1 to redefine the 0 point as the current reading, imaging a Zero button on digital scales

Regarding scale we are using one of these modules to get a weight from a force plate. The scale factor we have to apply is to divide by 217 to get the weight in grams (after zeroing). This would equate to a scale factor of 1 / 217 = 0.004608
These users thanked the author Benj for the post (total 2):
stefan.erni (Thu Sep 06, 2018 9:52 am) • jgu1 (Thu Sep 06, 2018 2:39 pm)
Rating: 10.53%
 

jgu1
Posts: 1105
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1010 times
Been thanked: 255 times
Contact:

Re: Component for Hx711

Postby jgu1 » Thu Sep 06, 2018 2:33 pm

Hi Ben!

Thank`s for reply. Sorry I though it was your component. :D

Yes, anyway I would be happy If you Will create a new component for Hx711. I already tryed all kind of value in the settings, But nothing it not work. So yes, a working and easy to use Hx711 component which also can be calibrated and tarer is very velcome. :roll: I use a hunghleigh 5kg loadcell.

Br Jorgen

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

Re: Component for Hx711

Postby Benj » Fri Sep 07, 2018 11:09 am

Hello,

I've re-done the HX711 component now so hopefully it is easier to use and understand. The new component should be available now via the update system. Please note that the API for the component has changed fairly significantly so any existing programs will become broken.

I've also added simulation functionality using a slider and added an example here.
https://www.matrixtsl.com/wiki/index.php?title=Component:_Load_Cell_(HX711)_(Sensors)

Let me know how you get on.
These users thanked the author Benj for the post:
jgu1 (Fri Sep 07, 2018 11:52 am)
Rating: 5.26%
 

jgu1
Posts: 1105
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1010 times
Been thanked: 255 times
Contact:

Re: Component for Hx711

Postby jgu1 » Fri Sep 07, 2018 11:52 am

Hey man, Thank you Ben. :D I am not home now, in the evening and then I make a test and you will be the first who hear the result. :lol:

Thank´s.

Br jorgen.
These users thanked the author jgu1 for the post:
Benj (Fri Sep 07, 2018 11:53 am)
Rating: 5.26%