Newbie needs help with ESP8266, HX711 and a load cell


I’m quite pleased with my Cayenne now. It shows weight, temperature, humidity, uptime and RSSI. However, it would be nice with a battery indicator as well. Is it possible to create one in Cayenne and if so, is there any example code somewhere or someone who can help? I am using EPS8266 Wemos D1 mini Pro.


google search to read battery voltage and see first without adding cayenne you can read battery voltage.
here are some post from community Battery Widget and ESP8266 Sleeping Temperature Station


Thanks for support. I’ll check this out.


Hi, you inspire me for a project that control hives in various place.
I am stuck with the weight sensor because i can’t have solid reading. How you manage it? I’m using load cell (10 kg for testing) + hx711 + wemos d1 r2.


can you post the code you are using and first of all solder the pins correctly to HX711.


#include “HX711.h”

// HX711.DOUT - pin #d4
// HX711.PD_SCK - pin #d3

HX711 scale(D4, D3); // parameter “gain” is ommited; the default value 128 is used by the library

void setup() {
Serial.println(“HX711 Demo”);

scale.set_scale(); // this value is obtained by calibrating the scale with known weights; see the README for details
scale.tare(); // reset the scale to 0
Serial.print("put know weight);

Serial.print(":calibration factor is\t");
float fattore= scale.get_units(10)/1000;


void loop() {
Serial.print(“one reading:\t”);
Serial.print(scale.get_units(), 1);
Serial.print("\t| average:\t");
Serial.println(scale.get_units(10), 1);

scale.power_down(); // put the ADC in sleep mode


The pins are solder correctly and strong i think, i will post a photo tonight



Unless I’m missing something, your readings are not varying by more than 1%. How accurate is the device? (precision!=accuracy)


I don’t have a datasheet, but the cell come from a kitchen balance that have accuracy reading (+ - 100 grams is too much)!


From your screen shot it’s only ±10 grams, unless I’m not understanding it. But like I said in the last post, just because it has 1 digit precision does not mean it is 1 digit accurate and vise versa. Here is a good read about it