File Exchange

image thumbnail

Basic Custom Arduino Library for HX711

version 3.0.0.1 (1.73 MB) by NICHOLAS GIACOBONI
Get data from the HX711 load cell amplifier and import in MATLAB workspace.

26 Downloads

Updated 15 Dec 2019

View License

The HX711 add-on library develops the two wire comunication protocol between Matlab workspace and HX711 itself through ARDUINO and also a specific class provides some built in function to calibrate your loadcell. In the folder you'll also find a Matlab App which can be used to calibrate the loadcell and plot data in real time by a basic Graphical User Interface. This library has been tested with ARDUINO UNO and MEGA2560 under windows environment. Thanks to the User's Manual you can easily learn how to use this library. If you are looking for something more sophisticated download this one: https://it.mathworks.com/matlabcentral/fileexchange/73692-advanced-custom-arduino-library-for-hx711. If you are using Arduino DUE use the following one: https://it.mathworks.com/matlabcentral/fileexchange/73693-custom-arduino-due-library-for-hx711.

Cite As

NICHOLAS GIACOBONI (2020). Basic Custom Arduino Library for HX711 (https://www.mathworks.com/matlabcentral/fileexchange/66641-basic-custom-arduino-library-for-hx711), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (20)

Hello Nicholas,

Thank you very much for your library!
I am not experienced in MatLab coding, I usually use Simulink and have no clue how the coding section of Matlab works.
My question to you is if I can transfer the realtime data to Simulink and then using combinatorial logic to decide what happens in each scenario.
I have a school project and if this works I would be very grateful.
Thank you!
Teodor

Hi nicholas, i have a problem with your library; i follow your instructions to use the library in the user´s manual. After the library is added to path i put in the comman window listArduinoLibraries, and the library doesn´t appears, and i cant set up in my arduino. my matlab´s version is 2018b what can i do?

The Library it's now updated and it's been renamed "Basic Custom Arduino Library for HX711". If you want a more sophisticated library look here: https://it.mathworks.com/matlabcentral/fileexchange/73692-advanced-custom-arduino-library-for-hx711. Instead if you want a library that works with Arduino DUE download this one: https://it.mathworks.com/matlabcentral/fileexchange/73693-custom-arduino-due-library-for-hx711.

fatih kaya

Hello Nicholas,
Please could you let me know if it is possible to use 3 channel stacked strain rosette(https://www.digikey.com/catalog/en/partgroup/c2k-strain-gages-stacked-rosette/69395) with 1 pcs HX711.
Any help would be appreciated!
Thank you very much and God bless.
Faith KAYA

Hello Nicholas,
I keep running into a problem. When I enter
>> listArduinoLibraries
{'ExampleAddon/HX711' } shows up like I expect it should.
When I try to use
>> arduinosetup
I select the library ExampleAddon/HX711 and proceed to click 'Program'
Then I receive an error stating:
The Arduino source 'HX711/HX711.h' for libraries 'ExampleAddon/HX711' cannot be found. Install the third party source first and try again.

I have tried following the User's Manual and have found no luck. Any help would be appreciated!

Thanks! I'm testing my sensors for a new project and found very useful this library.

hello Nicholas, can you help me modify your mlapp instead of using xy axis to show the continuous data acquisition i want to use semicircular gauge or rectangular gauge, its kinda hard for me since this is my first time using matlab for arduino sensors. thank you very much and God bless

anyone has a technique to create a block for simulink from this library ?

Stephan Pi

Hi Nicholas! I'd like to say thank for the great work! Only thing which could be improved is that you need to calibrate the strain gauge every time again.

Hi Alec, I'm glad you are using my library for a school project. Please send me an e-mail through my Matlab account and we'll solve the issue.

Hi, been working on a project for school using a HX711 load cell and the code is not being able to be found in my library. I have repeated all suggestions that have been given in this comment section and have had my instructors look at it. All students attempting to use this code and sensor are all having the same issues and any help would be greatly appreciated as soon as possible.

Stephan Pi

Hello Ozan Eren Yuceol,
yes my goal was to make the library compatible with Due
since I published the library the first time and so with other transducer, and it's still so.
Unfortunately I'm very busy at the moment but I'm going to get on it the next year,
I think in february, unless someone come up with a solution before me.

Hello Nicholas,

Do you have a plan to make the library compatible with Due?

Allan Lui

Hi Nicholas, I'm using your library to record data from strain gauges attached to the HX711 . I have put the read_HX711 function in a while loop so it continuously records the mass and I was wondering how to insert the data retrieved from the while loop into Simulink? I was just wondering if you could help me out with this? Thank you in advance.

**************************************************************************************
The Arduino source 'HX711/HX711.h' for libraries 'ExampleAddon/HX711'
cannot be found. Install the 3P library source first and try again.
**************************************************************************************
It's quite common to get this error using the library if the registration phase
it's not done properly. Here I'm going to summarise some tips that can help
anyone who get this error.

1) Extract the content of HX711 v2.0.zip and pasted it in your work folder;
2) Follow the instructions in the User's Manual in order to register the custom library;
3) If you've done all of that and you get the error try with the following codes one by one in the command window:
- clear classes
- rehash toolboxcache
- listArduinoLibraries()
4) Check in the output of the last code that the HX711 library is in the list, then upload the arduino server code again.
5) If the problem is not fixed click on the "seth path" button on the top of the Matlab User Interface, look for the HX711 path
and remove it. Now do the entire procedure again.
6) If you get the error again feel free to send me an e-mail through my Matlab account.

Nicholas Giacoboni

Hello Alberto Juan Alburquerque, I'm glad you appreciate my library, you can access the app's source code by opening it with the App Designer. if you are not comfortable with the code I think I can do it for you. You can send me an e-mail through my Matlab Account so I will be able to help you with any further problem.

Nicholas Giacoboni

Hi Nicholas! I am reading everything and it looks great. Thank you again. I am trying now to use your app (HX711.mlapp). I have a 5 kg load cell and I already calibrated it. My scale factor is 446809.5067 (if your calculation methods are the same as the ones from "bodge"). I need just to set directly the scale factor... I cannot tare and calculate again the set factor every time which I use the load cell because it is mounted in an assembly. Would it be possible to do that? Your app doesn't allow to enter the scale factor and I cannot access the source code... Thank you in advance! :)

Thank you very much for uploading this. It was just what I needed. I already made the HX711 work with the Arduino IDE and the library from "bodge". I just want now to do it with MATLAB in order to plot the measurements on real time. I hope I can achieve it using your MATLAB library! :)

Hi
I have a problem with using this library.
When I want to setup my arduino the message "The Arduino source 'HX711/HX711.h' for libraries 'ExampleAddon/HX711' cannot be found. Install the 3P library source first and try again." appears.
I use the Arduino UNO
Please help me to solve this problem

Updates

3.0.0.1

Updated.

3.0.0.0

matlabshared.addon.LibraryBase class

2.0.0.0

Updated.

2.0.0.0

1- You don't have to configure pin manually anymore because DATA and CLOCK pins are configured when you create the HX711 object; 2- It's available a new class which allows users to calibrate the loadcell easily and a Graphical User Interface.

1.0.0.0

An improved version will be available soon.

MATLAB Release Compatibility
Created with R2019b
Compatible with R2017b to R2019b
Platform Compatibility
Windows macOS Linux

HX711 v3.0

HX711 v3.0/+arduinoioaddons/+basicHX711