Page 1 of 1

HX711 weight sensor and conversion to gram

Posted: 13 Aug 2017, 11:01
by duelago
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 16176 times
Screenshot 2017-08-13 10.21.54.png
Screenshot 2017-08-13 10.21.54.png (217.43 KiB) Viewed 16176 times

TIA,
/David

Re: HX711 weight sensor and conversion to gram

Posted: 13 Aug 2017, 11:43
by Shardan
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

Re: HX711 weight sensor and conversion to gram

Posted: 20 Aug 2017, 17:46
by duelago
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 :)

Re: HX711 weight sensor and conversion to gram

Posted: 24 Feb 2018, 13:32
by cyberbob
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.

Re: HX711 weight sensor and conversion to gram

Posted: 24 Feb 2018, 14:00
by grovkillen
Click on the "?" next to the formula header and you're taken to the wiki for formulas.

Re: HX711 weight sensor and conversion to gram

Posted: 17 Mar 2018, 06:01
by kozoke
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)?

Re: HX711 weight sensor and conversion to gram

Posted: 17 Mar 2018, 12:06
by TD-er
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.

Re: HX711 weight sensor and conversion to gram

Posted: 17 Mar 2018, 16:00
by Shardan
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,

Re: HX711 weight sensor and conversion to gram

Posted: 17 Mar 2018, 18:02
by kozoke
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)
;-)

Re: HX711 weight sensor and conversion to gram

Posted: 17 Mar 2018, 18:58
by TD-er
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.

Re: HX711 weight sensor and conversion to gram

Posted: 18 Mar 2018, 00:07
by kozoke
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.

Re: HX711 weight sensor and conversion to gram

Posted: 30 Jun 2019, 14:36
by kirelam
So simply said. No i2c devices AND the hx711?

That is a bummer, but will find another solution!

Re: HX711 weight sensor and conversion to gram

Posted: 30 Jun 2019, 18:59
by grovkillen
Please open a issue on GitHub.