ADC choice for load cell

Hello, all.

I have a little experience in PCB design and controller programming. For my first project in this area, I was thinking of working up a load cell breakout/amplifier board (or Design Block more than likely) to use with a controller.

I would like to be able to use one to four load cells as I am considering 2 x load cells per side of the hive. If this is a bad idea, while technically off-topic for this thread, please point me to a reference and I’ll change my mind.

To this end, I suppose I should start with the ADC around which to design my project.

I have used the HX711 in the past and aside from putting them under tables and chairs to level them, they are not of much use to me. They have never been reliable in an ESP32 environment for me and I spent enough hours there trying to figure out why I don’t care anymore. The most reasonable explanation I ever got was something to do with timing, but that seemed more a problem with the library than the hardware. Be that as it may, I am not good enough to develop my own hardware library.

Which one to choose then? I am currently looking at the NAU7802 or ADS1231. The main difference there appears to be whether it’s on SPI or I2C. That being the case, the NAU7802 may be easier to get multiple sensors going.

Note that I am staying away from discussing the physical configuration of a scale right now. That seems like something I can figure out after I have a way to actually measure in the real world.

Any advice for me?

1 Like

HX711

Not the HX711 IC or the library is the problem, but the 3.3 V power source in combination with the popular green breakout board, see: Stromversorgung HX711.

Nevertheless we have used this breakout in many (also 3.3 V) settings with ESP32 and ESP8622. In case you have serious problems check also your load cells and do not use the load sensors you can find in cheap bathroom scales, see Scales with bathroom load sensors.

In case you want to use more than one load cell for one hive it could be an idea – and makes hardware and software much easier – to use 2 or 4 load cells in parallel. The “pure doctrine” for a parallel setting is to use only special selected “digital twins” aka “matched pairs” for this setup, but we do not do rocket science and got sufficient precision without that, see Matched Pairs bei Bosche-Wägezellen nötig?.

NAU7802

The NAU7802 (Diskussion zum Nuvoton NAU7802 24bit 2ch ADC) is long on the market but was only recently discovered by the Maker community. I like that it has an I2C interface, which is a nice and standard protocol. There are libraries and breakouts (see Breakout für NAU7802) by Adafruit, Sparkfun and others available. So, I would give it a try.

I also like that most breakout boards have screw terminals. What I am not happy about is that all “forgot” to add a terminal for the shield. And, to mention another downside: I2C sounds like it is easy to use some breakouts in parallel but this is not easily possible because the I2C address is fixed, so you have to use an I2C Mux.

ADS1232/4

For real multiple channels have a look at the ADS1232/4. However, it has different downsides: More expensive, afaik no readily available breakout board (see Breakout für ADS123x), and a bit tricky but doable programming, see Code für ADS1232 oder ADS1234.

3 Likes

Oh my goodness! I can’t tell you how long I have fought that issue and I’ve given up on other projects. Since I’m going to be using it in a battery-powered application, I think sticking with a 3V3-capable chip makes more sense to remove the need for a boost converter and a level shifter for the signals

I noticed that. Most of the load cells I see lack a shield anyway - do you add one?

I will check out that thread, thank you.

I went down the road of playing with a design for that (never actually fired it up) but I got side-tracked. I need to look at that again.

Hi Lee,

This resonates with many over here. We have a post about this topic in the making since ages, which summarizes all the quirks ;].

If you are on Arduino, please make sure to use a recent version of the canonical HX711 library by Bogdan Necula, which received a significant contribution on this matter, based on code by Geert Roumen and an emphasis coming from @weef the other day – thank you again. I don’t think it will work well with any other library not implementing such a functionality.

The outcome was Spring cleaning with multiarch support by amotl · Pull Request #123 · bogde/HX711 · GitHub, see also Improving the canonical Arduino HX711 library for ESP8266, ESP32 and beyond - #26 by Andreas ff.

I don’t have any objections ;]. While I am not a hardware guy at all ™, I also like the NAU7802, following @weef, @tonke [1] and Nathan Seidle [2], for the reasons outlined in different discussions (I2C, shippable breakout, etc.).

Interesting! Maybe it’s still on the table, specifically when designing a custom PCB, like what the ESPresso Scale clearly demonstrates.

With kind regards,
Andreas.


  1. ESPHome mit NAU7802 ↩︎

  2. GitHub - sparkfun/SparkFun_Qwiic_Scale_NAU7802_Arduino_Library: An Arduino library to interface with load cells using the Qwiic interface and the NAU7802. ↩︎

Oh man, I remember that thread - apparently I did not stick around long enough.

A maker community like this really bridges the gaps sometimes between hardware and software. You can only follow so many GitHub issues before you go mad. When I was first looking at that issue, it was for a Home Brewing (beer not Mac) application and the circles in which I was working were not makers but users. Here I am among others makers who happen to also be beekeepers which is nice.

I had a brief exchange with Nathan Seidle and he confirmed the Sparkfun lib is intended to support the second channel on the NAU7802 but he’s not tested it. That’s a good start.

I would very much like to have the option on the same design to use up to four channels, where the ADS1234 comes in. It looks like the HamidSaffari/ADS123X lib does support that so I might have to try that out as well.

2 Likes

OK, thanks to the colleagues I could shorten this a little (but some local links might be redundant).

As you already pointed out, the HX711 regularly is subject of certain ‘strange’ problems. Being a Chinese somewhat cloned ADS1231, the IC itself is not that bad as its reputation, most problems arise from the cheap PCBAs most people have this IC on (we have coverage on that e.g. here) - a PCB design quirk led to a missing GND connection which isn’t obvious for most applications as the IC’s internal protection diodes allow that needed current path for GND … m(
Of course, this is not as low-impedant as GND ever should be, voids the rule to never let flow any supply rail through an IC, and hence further degrades accuracy of that IC on unmodified ugly PCBAs.

Another common problem of the HX711 is the accuracy of the internal RC osc, an IC specimen can be up to ±20% off of nominal freq value. This is not only crucial for proper 50/60Hz AC power noise rejection, but also for proper timing behaviour of the ADC state machine (accurate sample times, less jitter) as well as for the timing of the digital interface. Esp. the latter fact (IF timing) misleaded to some driver software changes and change reverts… ;) One can use an XTAL; local forum coverage on that e.g. here .

When using the HX711 (again), get yourself a decent PCBA design version (btw, even the Sparkfun version is not perfect), there are shielded versions, - and add an XTAL when needed (or to be sure).

But you seem to be over with the HX711, and so make it! :)

To get more serious, you mentioned better alternatives (comparision is highly subjective and not complete ;)).

ADS1231

  • likely the paragon for the HX711
  • 1 ch
  • fixed PGA gain 128
  • sw-controllable low-side switch for excitation supply
  • @clemens used it in his former Stalker-based OpenHive designs (links TBD)

NAU7802

  • 2 ch
  • similar to ADS1232, also internal temperature sensor, more calibration registers (volatile memory)
  • eight PGA gains betw. 1 and 128
  • internal LDO for analog part w/ programmable output voltage
  • no excitation supply switch (but int LDO can be off)
  • @MKO made a PCBA and brought it into service, here and here.
    See also GitHub - MKO1640/NAU7802

ADS1232/4

  • 2/4 ch
  • PGA gain 1, 2, 64, 128
  • ADS1232: internal temp sensor
  • no excitation supply switch

Even an ADS1220 is very interesting for ‘our’ use case (e.g. Olimex has nice lab PCBAs: BB-ADS1220 - Open Source Hardware Board): full PGA gain range, low-side excitation supply switch; real SPI). There also are reasonable libraries for that IC.

Whatever 24bit ADC you select, watch out for the possibility to measure ratiometrically (simplified: besides AVCC, the IC needs an AREF+ and AREF- inputs), otherwise you would need to consider the temperature drift of a reference source (and those sources are expensive and not fitting for beehives). An XTAL (or ext clock) improves everything on an IC capable of taking external clock or having a crystal osc. In working and sleep/suspend modes, the current draw will be somewhat higher than with the internal RC osc; could be neglected.

Low PGA settings, together in an IC w/ switchable analog supply, give you the chance to connect a silicon temperature sensor like a KTY81 to another channel on the MUX. This sensor attached to your strain gauge weight scale body, perfectly ‘sees’ the gauge’s temperature for temp. compensation usage (@Thias did this (at least for calib w/ DS18B20(?))).

The simple shift register protocol interface of ADS1231 and HX711 is slow (which is good here) and hence can bridge more cable distance than I2C and of course SPI; all three IF protocols allow having the ICs close to the weight scale body to not propagate tiny analog voltages over cables, but their digital version.
OTOH, ADS1231’s and HX711’s protocol needs two GPIOs and not MPU hw peripherals - but so they would never block other e.g. I2C devices on a same bus.

Mentioned ADCs with an exitation supply switch greatly fit to a low-power design and the requirement to not ‘heat’ the strain gauge (and only supply while measure; allow settle when switch on). Not having this feature means to integrate e.g. a switchable LDO for the analog part - or use an NAU7802 ! ;)


The mentioned I2C mux (TCA9548A) is not procurable at major distributors for another year, you can only get ICs already soldered to lab breakout boards, e.g. from Adafruit, Sparkfun, and of course all their CN grey market rip-offs.


Speaking of CN grey night shift ICs, those purple CMCU-1232 PCBAs (ADS1232; local: here) even has space for a 4,9152 MHz XTAL if needed.
Should you decide to do so, buy more than one of those to compare IC sample spread; these are unclear sources.

Or start over with a NAU7802; it is Nuvoton (Taiwan), they really compete with TI on the ADS1232.

3 Likes

@weef you have given me a lot to think about. It seems that my original idea of ignoring the physical form factor of a hive scale and concentrating on a single ADC/board design to cover all possibilities may not be possible.

@clemens pointed out the potential to use these consumer-grade load cells in parallel, so I could get by with two channels (two cells per side) if that was the direction I went. If that’s a good path, a single NAU7802 should handle things.

The part which confuses me about the NAU7802 is why the applications I am seeing are not using the second channel. For instance, the Triaxial Loadcell Breakout uses three of these on a mux but only uses the first channel in each. I see notices about a capacitor bridging that second channel to cut down on noise in the first. Does that infer that using 2 channels is somehow more “noisy?”

1 Like

On many breakouts the 2nd channel of the NAU7802 is not as pin available, e.g. Suggestions to the load cell connectors at the PCB preview · Issue #1 · adafruit/Adafruit_NAU7802 · GitHub

sparkfun writes this Qwiic Scale Hookup Guide - SparkFun Learn about the 2nd channel

Channel 2: The NAU7802 has a 2nd, optional ADC channel that has a much lower input capacitance (5pF vs 14pF) but is otherwise identical to the 1st channel. By default, this channel has a 330pF capacitor across its inputs. This helps reduce noise on channel one. If you’d like to use the 2nd channel, we recommend removing the capacitor by cutting the CAP jumper.

2 Likes

I don’t think I asked properly: I understand the current breakouts do not use them, and I also understand how I could modify one of the breakouts to use CH2. What I am asking is if this choice to only use one channel on the common breakouts was because of noise on CH1 if CH2 is used, or is that noise only introduced if CH2 is not used and no capacitor is present?

That is true.

1 Like

Got it, thank you!