Trouble to find Load cell + HX711 + DSP8266

Hi

I struggle to get ESP8266 recognize my load cell amplifier.

I have 4 pcs 50 kg cells from sparkfun and HX711 from sparkfun.
I have checked and cheked, my connections are OK (99,99% shure).

Serial monitor gives "HX711 not found!"

D2 connected to DAT on hx711
D3 connected to CLK on hx711

I use Generic ESP8266Module version 2.5.0 (latest version gave upload error)

Library HX711 code from GitHub - olkal/HX711_ADC: Arduino library for the HX711 24-bit ADC for weight scales.

I run example from library:

#include "HX711.h"

// HX711 circuit wiring

const int LOADCELL_DOUT_PIN = 3;
const int LOADCELL_SCK_PIN = 2;

HX711 scale;

void setup() {
  Serial.begin(57600);
  scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
}

void loop() {

  if (scale.is_ready()) {
    long reading = scale.read();
    Serial.print("HX711 reading: ");
    Serial.println(reading);
  } else {
    Serial.println("HX711 not found!");
  }

  delay(1000);
  
}

Any ideas to help me?

which ESP8266 board do you have
your code is specifing GPIO pins not D2 and D3

looking at a NodeMCU ESP-12E board
D2 connected to DAT on hx711 pin D2 is GPIO4
D3 connected to CLK on hx711 D3 is GPIO 0

rather than specifying GPIO pins try

const int LOADCELL_DOUT_PIN = D2;
const int LOADCELL_SCK_PIN = D3;

Thanks

I dont remember bord type. How can I find it?

I tried, got error:

X711_basic_example:10:31: error: 'D2' was not declared in this scope
 const int LOADCELL_DOUT_PIN = D2;

It must be somethin else. Im not experienced, so I struggle with this.

Any other ideas to get?

do a web search for esp8266 boards and see if you can recognise your board
e.g. does it look like a NodeMCU ESP-12E, see the pinout photo which shows the mapping between D pin numbers and the associated GPIO pin
otherwise upload a photo or a link to where you obained it?
what ESP8266 board do you select on the Arduino IDE?
for now assuming
D2 connected to DAT on hx711 pin D2 is GPIO4
D3 connected to CLK on hx711 D3 is GPIO0
try

const int LOADCELL_DOUT_PIN = 4;   // D2
const int LOADCELL_SCK_PIN = 0;      // D4

Hi

so my board is marked D2, D3 etc.

Board type: WIFI Development Board D1 Mini ESP8266 WeMos Wysoka jakość – kup w niskich cenach w sklepie internetowym Joom
Wemos Mini

I changed to

const int LOADCELL_DOUT_PIN = 4;  
const int LOADCELL_SCK_PIN = 0;

and something positive happened:

image

After reset I only get Not found

Can it be thet I power HX711 with 5V, and wemos only use 3 V?

it looks like a Wemos D1 mini - check the pinout against your board
if you select this board in the Arduino IDE it should define D2 and D3 for you
Wemos_D1_mimi

there appear to be serveral versions of the HX711 - which particular version do you have, e.g. a link to where you obtained it would help
there are also multiple HX711 libraries I assume to match the different HX771 devices

the ESP8266 is a 3.3V device - don't use 5V signals with it

OP mentioned a HX711 from Sparkfun, which is a 3.3volt compatible board.
It has split supplies for analogue and digital.

@Modesty
I assume the analogue supply is connected to 5volt and the digital supply to 3.3volt.
Leo..

the example programs in the github HX711_ADC library referenced in post #1 include

#include <HX711_ADC.h>

your the code of post #1 includes

#include "HX711.h"

what library are you using ? where did you get it from? are you sure it is suitable for the HX711 board you are using

Hi

Thanks for all help.

The pin 4 and 0 was the main solution. (on board its marked D2 and D3)

I did not figure out bord brand, so used generic ESP8266 board

I use library 711_ADC.h with the sparkfun mondule from Olav Kallhovd

GitHub - olkal/HX711_ADC: Arduino library for the HX711 24-bit ADC for weight scales

For board manager i installed ESP8266 versjon 2.5.0, version 3.0.2 did not work, upload did not work.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.