Hi
FYI A lot has changed from start of tread, read all if you struggle with load cell and LoRa, forum members has given me a lot of help, thanks!!!
UPDATE
Load cells 4x50 kg I have found this one, with datasheet, I dont have price but I will buy 40 pcs, GALOCE-load cell weighing solution provider
This type is used by a bee monitoring company.
From Datasheet:
24bit ADC NAU7802
Sparkfun even has a brake out board: SparkFun Qwiic Scale - NAU7802 - SEN-15242 - SparkFun Electronics
Also a library available
Chip: https://www.nuvoton.com/resource-files/NAU7802%20Data%20Sheet%20V1.7.pdf
Trouble to use LiPo batt in winter time.
I change from LiPo as main source to superCap, 5.5V 10F, works down to -40 Celsius. Can run my system for 190 times (2 sec run time between sleep)
I use LiPo if superCap strugle to charge, I do not charge LiPo if below 5C
Using 74HC393PW to select power source Super Cap og LiPo.This also give option to switch off LiPo charging (if cold outside).
I can choose what power source to use.
Also added option to switch off 3.3/5v to peripherals, can choose to only give 3.3 to ESP32
Also add a photo resistor to make longer sleep when dark (winter/night).---> Change: I use solar panel to measure dark/light, not photo resistor.
////////////////////////////////////////////////////////////////////////////////////////////////////////
V3 PCB (see post ca 150)
Final sender PCB, and receiver (OLD v2):
Home assistant view:
HX711 is placed on a100% copy of open source PCB layout. Both VCC and VDD is connected.
For LORA module with 868 mHz AI thinker don't have a bord with IPEX connector so that is added, then I can use an external antenna or solder a copper coil antenna to PCB, 2 options.
[
UPDATE:
3)
I needed to enable CRC coding to avoid to compute random received LoRa packages that messed up my graphs in Home Assistant. I used Rob TIllaart's CRC library and example codes and demo code (thanks @robtillaart )
Now only LoRa packages with correct CRC code are computed. Seems to work as it should.
As a consequence I no longer use lora.h library.
My scale (and other sensors on system) is running 24/7 with a changing load.
This is what my hive system is sending as payload over LoRa:
vekt = myPayload.vekt;
pakkeNr = myPayload.pakkeNr;
BStempKube = myPayload.BStempKube;
BStempUte = myPayload.BStempUte;
DHTtempKube = myPayload.DHTtempKube;
DHTfuktKube = myPayload.DHTfuktKube;
alarmValue = myPayload.alarmValue;
kubeNr = myPayload.kubeNr;
volt = myPayload.volt;
senderVersjonNr = myPayload.senderVersjonNr;
To read load on scale after sleep/reboot the calFact and Scale offset/Zero value must be stored in memory, then when restart read mem and calculate load.
Added 2 buttons to shuffle true latest received packages per hive (Wife has 9 bee hives) and present on OLED. To manage this I store by hiveNo each reading, if new data from same hive the previous data is over written, I store then only one package pr hive.
This is per today on chips memory, that will eventually damage the mem, so next is to add a SD card, which allready is placed on my LiLigo board.
Also read this tread: CRC test, dont work
@J-M-L and @srnet gave valuable info. I did not manage to get this work, maybe for the future.
With all help in this tread my system is now working and stable.
I have gone from ESP8266 to ESP32 WROOM, I find it much more stable, and easier to save battery with sleep functions.
- I use the 150 kg cell, but Alibaba 4x 50 kg loadcells is also pretty stable, and almost for free...
- NB! Use a heavy weight for calibration, i used 25 Kg. This will give better readings when load cell is 150 Kg
- HX711 from Sparkfun, powered it with 3.3V and 5V, also use PCB layout from Spakfun to ensure a stable AD operation.
- 2 x temp sensors BS18B20 waterproof
- 1 x DHT22 for temp and humidity (may stop working due to clogging with propolis)
- 1x Ai Thinker RA01H, 868Mhz, has no IPEX connector so I add on to the PCB
- 1x 1cell Li-Ion 350 mA
- 1 x solar panel 200 mA - Max volt 6.2 when in full sun
- 1 x alarm switch NO
- 3 x reed relays for calibrate, tare, reset
I have also made a code for autocalibration and zero factor, and store values to mem.
The scale I have built, 3D animation, look here
The receiver part is much easier, no external components, I use a Liiligo ESP32 with OLED
For presentation/history I run Home assistant on my NAS with Grafana and influxDB
You will find more info further down in this tread
]
Board I use is a ESP8266MOD (wemos type), compile it for NodeMCU v1.0 (ESP12).
I'm using this 150 kg load cell.
I have a "No Name" hx711, i have connected it to 3.3v
I have also connected E- to ground (same as ESP8266 ground), also shield in cable from hx711 is connected to ESP ground.
(Soldering with Norwegian Sausage fingers:)
I use library from https://github.com/bogde/HX711. From Sparkfuns load cell example https://learn.sparkfun.com/tutorials/load-cell-amplifier-hx711-breakout-hookup-guide/all
For a 1 kg test I see drift from 998 to 1109 grams witch is near 11% (I may need a bigger load)
I have previously tested library from Olav Kallhovd: https://github.com/olkal/HX711_ADC that also drifted in my setup.
My test rig is standing in a room with stable temperature around 22 C.
Any ideas how to improve this?
Can the hx711 be the reason for the drift, I maybe need to buy one from Sparkfun?
Code I use to set calibration factor + serial output to read weight is (from sparkfun):
/*
Example using the SparkFun HX711 breakout board with a scale
By: Nathan Seidle
SparkFun Electronics
Date: November 19th, 2014
License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
This is the calibration sketch. Use it to determine the calibration_factor that the main example uses. It also
outputs the zero_factor useful for projects that have a permanent mass on the scale in between power cycles.
Setup your scale and start the sketch WITHOUT a weight on the scale
Once readings are displayed place the weight on the scale
Press +/- or a/z to adjust the calibration_factor until the output readings match the known weight
Use this calibration_factor on the example sketch
This example assumes pounds (lbs). If you prefer kilograms, change the Serial.print(" lbs"); line to kg. The
calibration factor will be significantly different but it will be linearly related to lbs (1 lbs = 0.453592 kg).
Your calibration factor may be very positive or very negative. It all depends on the setup of your scale system
and the direction the sensors deflect from zero state
This example code uses bogde's excellent library: https://github.com/bogde/HX711
bogde's library is released under a GNU GENERAL PUBLIC LICENSE
Arduino pin 2 -> HX711 CLK
3 -> DOUT
5V -> VCC
GND -> GND
Most any pin on the Arduino Uno will be compatible with DOUT/CLK.
The HX711 board can be powered from 2.7V to 5V so the Arduino 5V power should be fine.
*/
#include "HX711.h" //This library can be obtained here http://librarymanager/All#Avia_HX711
#define LOADCELL_DOUT_PIN D3
#define LOADCELL_SCK_PIN D4
HX711 scale;
float calibration_factor = 18.5; //preset value
void setup() {
Serial.begin(57600);
Serial.println("HX711 calibration sketch");
Serial.println("Remove all weight from scale");
Serial.println("After readings begin, place known weight on scale");
Serial.println("Press + or a to increase calibration factor");
Serial.println("Press - or z to decrease calibration factor");
scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
scale.set_scale();
scale.tare(); //Reset the scale to 0
long zero_factor = scale.read_average(); //Get a baseline reading
Serial.print("Zero factor: "); //This can be used to remove the need to tare the scale. Useful in permanent scale projects.
Serial.println(zero_factor);
}
void loop() {
scale.set_scale(calibration_factor); //Adjust to this calibration factor
Serial.print("Reading: ");
Serial.print(scale.get_units(), 1);
Serial.print(" g"); //Change this to kg and re-adjust the calibration factor if you follow SI units like a sane person
Serial.print(" calibration_factor: ");
Serial.print(calibration_factor);
Serial.println();
//delay(1000);
if (Serial.available())
{
char temp = Serial.read();
if (temp == '+' || temp == 'a')
calibration_factor += 0.1;
else if (temp == '-' || temp == 'z')
calibration_factor -= 0.1;
}
}













