olkal / HX711_ADC

Arduino library for the HX711 24-bit ADC for weight scales
MIT License
235 stars 124 forks source link

Nordic 52832 Examples and Tut #108

Closed LiveRock closed 2 years ago

LiveRock commented 2 years ago

Hi

I need help understanding how to use the library with the Nordic 52832 with VSC and PlatformIO. I am using a water bottle of 500 grams as known mass and a Wheatstone Bridge of 4 LoadCells.

I am getting a calibration value of -12

float knownMass = 0.5 (kg)

When I read data, I get reading of 2 Kg when I step on the scale. It should be like 78 Kg.

It is powered by 3.3V. When there are no load, the output from the Wheatstone bridge is about -0.7 mV When I step on it, the output is 2.4 mV.

Questions: (1) What do I do with calibrationValue after I obtain it? calibrationValue = LoadCell.getNewCalibration(knownMass);

(2) float i = LoadCell.getData(); Is value i in kg?

olkal commented 2 years ago

Hi! 1) calibrationValue is included like this: setCalFactor(calibrationValue); (see example file). 2) The library does not use units, the output value is in whatever unit you used for the known mass when doing calibration. Known mass calibration input in unit kg = output in unit kg.

The calibration value should normally be a positive number, I'm not sure why you get -12. Have you tried to use one of the example files unmodified? Also, the "known mass" used for calibration should be more in the neighbourhood of the scales capacity, for a scale with capacity of 100kg the "known mass" should be at least 20kg in my opinion. Try using yourself as known mass, you can fine tune this later by comparing with a calibrated scale.

LiveRock commented 2 years ago

Just wondering, is the issue I am facing related to the fact I am using the Nordic 52832 chip with Arduino framework, Visual Studio Code and PlatformIO?

olkal commented 2 years ago

No, I don't think so. The only thing is that saving the calibration value to EEPROM is not supported for the Nordic chip, so you must put the value in the sketch.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 2 years ago

This issue was closed because it has been inactive for 14 days since being marked as stale.