Experimenting with the HX711

Place your projects here
BeanieBots
Posts: 325
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 173 times
Been thanked: 104 times

Re: Experimenting with the HX711

Post by BeanieBots »

Hi Oli,
I'm a little confused by your two posts.
You say you are making an energy measuring device and ask about the HX711.
The HX711 is for measuring weight.

Your program listing is for BascomAVR but you do not ask a specific question.
If you would like help to convert it to Annex BASIC we can help but you will need to explain what it needs to do.

A few things to help you on your way.
In ANNEX BASIC, you do not need to DIM all your variable.
Only two types are supported. String and Float.
Simply assign a value.
eg. N=10 N$="Ten"

ANNEX BASIC does not support 'ports' for IO. You need to address each IO pin individually.
Have a browse though the help files for examples but please do not hesitate to ask questions if you are not sure.
User avatar
Oli
Posts: 44
Joined: Tue Feb 09, 2021 10:07 am
Location: Germany, Meissen
Has thanked: 13 times
Been thanked: 43 times
Contact:

Re: Experimenting with the HX711

Post by Oli »

The IC is 2 very precise ad converter INA and INB, they are no matter what they measure, weight or where the analog input comes from.
You don't need to use the power supply function.
There are 2 normal different operations amplifier inputs. The IC is perfect for shunt measurements.
In Bascom I only tested how exactly they are and which bit only comes with noise. 17-18 bit goes great, Direction 24Bit is "rnd".
Your command: RET = AH711 (Data_Pin, CLK_PIN [, resolution])
0 -> Input a gain 128 (default)
1 -> input a gain 64
2 -> Input B Gain 32
It's perfect, only for the ESP8266
I would like to measure energy in AH from LIFEPO4 with measuring shunt current over 20a,
but also 1 lithium cell with 500mA measuring range. Volt at 0.01V exactly at 4V, but up to 50V should also be possible.

The measurements are to be placed in diagrams later, and as CSV, I am considering sending them via UDP to Abacom Profilab on the PC, or on the ESP web interface, but that still seems too difficult for my annex knowledge.
BeanieBots
Posts: 325
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 173 times
Been thanked: 104 times

Re: Experimenting with the HX711

Post by BeanieBots »

OK, now I understand what you are trying to do.
It should not be too difficult to acheive what you want with ANNEX BASIC.
I do not have a HX711 to play with myself, so I can't help with details.
Start with something simple.
Just read the two inputs and output to wlog.
Then have a read through some of the example files which will guide you through how to present the data to a web page or TFT display.
User avatar
Oli
Posts: 44
Joined: Tue Feb 09, 2021 10:07 am
Location: Germany, Meissen
Has thanked: 13 times
Been thanked: 43 times
Contact:

Re: Experimenting with the HX711

Post by Oli »

I have hope you find a way to bring it to the ESP8266
You were successful on the ESP32
I can test it

I only bought 10 pieces of ESP32, unfortunately work with Annex only 1m wifi range, no idea why.
But I like to use ready -made devices gousund sonoff etc, 99% the ESP8266 with 1MB,
BeanieBots
Posts: 325
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 173 times
Been thanked: 104 times

Re: Experimenting with the HX711

Post by BeanieBots »

Maybe cicciocb will add support to the 8266 if there is enough interest.
Meanwile, hopefully somebody smarter than me might be able to help you out with some code that can read the HX711 using direct I2C commands.
It should be quite possible to do it that way. Perhaps a good read of the data sheet will give some pointers.
User avatar
PeterN
Posts: 366
Joined: Mon Feb 08, 2021 7:56 pm
Location: Krefeld, Germany
Has thanked: 171 times
Been thanked: 203 times
Contact:

Re: Experimenting with the HX711

Post by PeterN »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Fri Mar 31, 2023 9:59 pm ...
I only bought 10 pieces of ESP32, unfortunately work with Annex only 1m wifi range, no idea why.
...
Might be worth a test to set the wifi power explicitly up to 20 (?)

[Local Link Removed for Guests]
Post Reply