Load Cell Project

You dont need to do any programming if the microcontroller is esp and the info is going to home assistant:

You write a little yaml file and define the pins for the hx711 and name the sensor. Then you can flash the esp through a web interface and it will handle connecting to the mqtt or home assistant instance directly.

This is what I use for all my home esp32/esp8266 devices around my house. They are pretty reliable. I normally would not want to use wireless in production. But if you want wifi, this is the quickest way to get to the finish line.

ESPHome is available as an ā€œAdd onā€ if you have a HaOS install. The yaml needs a few boilerplate things like the ha address and wifi ssid/password. You can put that into a common.yaml. You can also do variable substitution so you could just have a specific yaml file that looked like:

substitutions:
    sensor_name: bin_001

<<: !include scale_common.yaml

The scale_common.yaml would be the whole file, with individual fields replaced with bin_001:

esphome:
    name: ${sensor_name}
    platform: esp32
    board: esp32dev

...

sensor:
    platform: hx711
    name: ${sensor_name}_weight
    ...

Then bin_001 will be a device (at bin_001.local and in HA). bin_001_weight will be the entity in home assistant. Rinse. Repeat. 5x. 50x.

1 Like

Well, I’ve got exactly zero expertise in these various communication issues that have been discussed, but, i wanted to call attention to a ā€œsystemā€ that I’ve been using to report data from a number of sensors around our property, including a load cell.

This concept is based on the ESPNOW protocol and seems to have good distance capability and doesn’t depend directly on wifi communication.

Believe it or not, it’s name is ā€œFarm Data Relay Systemā€ and it was developed for the purpose of collecting and aggregating data from a large number of sensors that are dispersed around a farm. (In fact, there is also the possibility to use LoRa to transmit data, but that’s probably not relevant here.)

Essentially, there are numerous devices that can communicate with a ā€œhubā€ using ESPNOW. From here, there are choices, but in my case that hub is wired directly by UART to another ESP32 device which then transmits directly to my MQTT broker and on to whatever system you are using to aggregate and display your data.

In my case, I happen to have several temperature sensors around the property, both inside and outside, moisture sensors, particulate sensors, VOC sensors, etc. I think there are more than 20 devices talking to the hub.

The item of interest for this discussion is a load cell based scale. The problem that I wanted to address was to learn how fast the moisture actually evaluated from the synthetic planting mix I use in my vegetable garden. In addition, there is a question of the accuracy of the moisture sensor.

In the actual experiment, a known quantity of water was mixed into a known amount of soil and both the weight and the nominal moisture content were monitored as the water evaporated. The frequency of measurement was overkill, about once every 5 minutes, but both data streams were sent to the hub using the FDRS protocol, on to the MQTT broker and ultimately fed into an Influx database and graphed with Grafana.

On my setup, I’m using the usual load cell with the HX611 that is connected to the Seeed Studios Xiao ESP32C3. (There is also another ESP32C3 at each sensor location, although there can be multiple sensors connected to a single ESP32C3, typically communicating over I2C. All of the data streams are then sent to the hub using the FDRS simultaneously.

Unlike others, perhaps, I choose this canned solution because it didn’t require me to do much programming. All the sensors are well documented and have Arduino code available. All of the specific ESPNOW and LoRa stuff is embedded in the FDRS, so if I could program the device in the Arduino IDE (or PlatformIO) then it could be integrated into the network with essentially no additional work.

And for the case like moisture sensors, where there were several units, they just have a number that you assign for each location. I believe it can handle up to 64 units or something.

I know this is long-ish, and may not be relevant, but it would be a pretty easy way to get you first 5 units set up and tested to see if they would meet your needs.

Screenshot is from the sensors box in our kitchen.

As an intro to this system, here’s a video:

5 Likes

O.k., o.k., so this is a non starter, I am still going to pursue, for my own interest, but they said they will NEVER DO THIS AGAIN on the phone with the Mettler Stuff.

Soooooo, I think I am not going to push this.
Thank you everyone, even just for my Education!!!

I am still going to be looking at MicroPython and my esp’s!!!

4 Likes

FWIW, I didn’t like using the esps for micropython because the direct USB filesystem isn’t supported. It works well enough over wifi once it is set up. But it was a pain for me to get started. One of the more mainstream microcontrollers will let you just connect to micropython like a usb drive and copy your .py files over to it.

Repl is great and micropython feels like magic. So don’t let me discourage you.

2 Likes

so I just ran through this: https://www.mclibre.org/descargar/docs/revistas/hackspace-books/hackspace-get-started-with-micropython-on-pico-01-202101.pdf

It was very informative!

Oh and maybe on a teenage level, for my old mind :slight_smile:

1 Like

I’m curious if an ESP32 can do super low power. I.e. if it sleeps most of the time, then wakes up, takes a measurement, and sends over BLE, maybe it can be powered by a coin cell battery 18650 cell. I know that there are chips out there that can do this, I’m just not sure if the ESP32 is one of them.

After a bit more research it looks like the ESP32 can do 20 μA in sleep mode and a voltage regulator might be 5 μA, so if we say 25 μA drawing from an 18650 that has 2000 mAh then we have 80,000 hours or about 9 years.

3 Likes

I was just looking at ESP Deep sleep this morning too.

Been struggling to finish my shop dust collection project (mental block) and am now going to simplify it a bit and just spread a few around that talk to each other with ESP-Now instead running everything back to a central controller

4 Likes

O.k., I am not sure, but I think I may have found a way to do what I want!!!

I need to get the load cell added but first things first, i am going to try and follow this project!

It is doing what i wanted, call the i.d. get the value. In the end the value will be the weight from a load cell :slight_smile:

I said I released this, but I have NEVER been good at releasing things :slight_smile:

1 Like

ohh, and I forgot to mention, it looks like the developer here at work already has a way to read from the slave devices, using php, so i do not think I need the master!

1 Like