HX711 weight sensor and conversion to gram

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
duelago
New user
Posts: 9
Joined: 13 Aug 2017, 10:41

HX711 weight sensor and conversion to gram

#1 Post by duelago » 13 Aug 2017, 11:01

Hello gurus,

I'm running ESP Easy MEGA with the recently added HX711 sensor.
A have a 5kg loadcell connected to the HX711 and a Wemos mini pro.

My noob question is how I convert the weight values I get in ESP Easy to grams.
What I have done so far is to put in the offset value to get my scale down to (almost) zero when it's unloaded.
Step two is that I have put a weight of 1000 grams on the scale. The measurement I get now is -247846.95

Can I perhaps put in a formula at the bottom before I send my value to Domoticz?
Any hints how the two point calibration setting works?
Screenshot 2017-08-13 09.48.41.png
Screenshot 2017-08-13 09.48.41.png (134.43 KiB) Viewed 16072 times
Screenshot 2017-08-13 10.21.54.png
Screenshot 2017-08-13 10.21.54.png (217.43 KiB) Viewed 16072 times

TIA,
/David

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: HX711 weight sensor and conversion to gram

#2 Post by Shardan » 13 Aug 2017, 11:43

Hello David,

i can't tell anything about load cells as i never tested one.

I can guess from the plugin that calibration is done with two points,
i'd choose zero (no weigt) and a defined weight, 1 Kg for example.
The left filed is the weight applied (0 and 1000) and the right fild should be
what you read from the sensor with no weight and 1000g weight on it.
For example
Weight Reading
Pt1 0 xxxxxx (Value shown from Sensor)
Pt2 1000 Value shown from sensor

Be aware i guessed that :)

An introduction about calibrating sensors can be found at the wiki:

https://www.letscontrolit.com/wiki/inde ... d_Accuracy

Still work in progress but might help anyways.

Regards
Shardan
Regards
Shardan

duelago
New user
Posts: 9
Joined: 13 Aug 2017, 10:41

Re: HX711 weight sensor and conversion to gram

#3 Post by duelago » 20 Aug 2017, 17:46

Thanks for your reply. I got it working without a serious calibration, but it's good enough now.
I like the link to the calibration page. Good stuff :)

cyberbob
New user
Posts: 4
Joined: 22 Sep 2017, 11:59
Location: belgium

Re: HX711 weight sensor and conversion to gram

#4 Post by cyberbob » 24 Feb 2018, 13:32

Hello,

Use the box "Formula" ?
example of formula :

%value%/numbertest

takes the measured value divided by any number (numbertest).
we can use + - * ( ) also in the formula

Good luck.
2 x RFlink V47 - 433.92MHz & 433.42MHz / Domoticz Stable V3.8153 on Synology DSM 5.2

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: HX711 weight sensor and conversion to gram

#5 Post by grovkillen » 24 Feb 2018, 14:00

Click on the "?" next to the formula header and you're taken to the wiki for formulas.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

kozoke
New user
Posts: 3
Joined: 18 Dec 2017, 03:56

Re: HX711 weight sensor and conversion to gram

#6 Post by kozoke » 17 Mar 2018, 06:01

Hello,

Great load cell plug-in! I've set up an espeasy mega with (a PIR, DHT22 and) two - Hx711s (one for a dog food bowl, pins 5,12 and another one for a water bowl on pins 4,13). I'm still a bit of a noob here so i'm wondering if i've misunderstood how to use SDL/SCL pins. I welcome any assistance!

My questions:
- I know 4, 5 are default but I assumed I could assign each hx711 to any usable pins. I think I have it set right but thoughts? Do I need to change the default state of the pins to use them for an HX711?

- Is there any technical reason that two HX711s would not work with one esp8266?

I was trying to calibrate the 10kg strain gauges when I leanred that both gauges are changing together. (wire cross or problem with pin)?

TD-er
Core team member
Posts: 8644
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: HX711 weight sensor and conversion to gram

#7 Post by TD-er » 17 Mar 2018, 12:06

Currently there is no support for >1 I2C bus and given the implementation of Wire class in the core library, it isn't something we could change very easy.
But if set to different I2C addresses, there is no technical reason why you could not use 2 of them on the same ESP module.
There are quite a few plugins however that are not working well when used more than once.
This is often fixable.
Perhaps add an issue about it on Github?


Edit:
Hmm these don't look like I2C sensors to me.
That may change the story a little bit, but maybe still a software issue.

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: HX711 weight sensor and conversion to gram

#8 Post by Shardan » 17 Mar 2018, 16:00

Nope, no I²C.

I took a look into the datasheet.
Following the diagrams It seems to be a unidirectional serial data transmission with an external clock signal,
Regards
Shardan

kozoke
New user
Posts: 3
Joined: 18 Dec 2017, 03:56

Re: HX711 weight sensor and conversion to gram

#9 Post by kozoke » 17 Mar 2018, 18:02

Thank you for the response. That does help.

They are serial. So it sounds like I either need to use two esps or try to use the b channel on the hx711 to achieve 2 load cells with 1 hx711 connected to 1 esp8266. If anyone has any other ideas, let me know.

Ps. On i2c, thanks. I didn’t know it was only limited to one device (assuming I understood you correctly)
;-)

TD-er
Core team member
Posts: 8644
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: HX711 weight sensor and conversion to gram

#10 Post by TD-er » 17 Mar 2018, 18:58

kozoke wrote: 17 Mar 2018, 18:02 [...]
Ps. On i2c, thanks. I didn’t know it was only limited to one device (assuming I understood you correctly)
;-)
Nope, I2C is meant to be 1 bus for numerous devices.
All devices on the same bus have to have an unique address, but the pins on the ESP used for the I2C bus can be shared among all I2C devices.
If for some reason you really need a second I2C bus, then that's a problem on the ESP core library we use.

kozoke
New user
Posts: 3
Joined: 18 Dec 2017, 03:56

Re: HX711 weight sensor and conversion to gram

#11 Post by kozoke » 18 Mar 2018, 00:07

Thank you. Just to clarify, I knew it was 1 bus, I thought you meant 1 device on the single i2c bus. I think i'm clear now that there is a single i2c bus (good) that can handle multiple (uniquely addressed) devices.

Regarding hx711 and the "B" channel, I tried it and it did not work. Provided similar values on the A (128 resolution) and B (64 bit resolution) so i'm going back to dual esp 8266s with 1 hx711 on each one. Oh well

Thanks again for your help.

kirelam
Normal user
Posts: 29
Joined: 04 Apr 2016, 12:10
Location: Westervoort

Re: HX711 weight sensor and conversion to gram

#12 Post by kirelam » 30 Jun 2019, 14:36

So simply said. No i2c devices AND the hx711?

That is a bummer, but will find another solution!

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: HX711 weight sensor and conversion to gram

#13 Post by grovkillen » 30 Jun 2019, 18:59

Please open a issue on GitHub.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 28 guests