0

Error reading

Hi Guys! i have a problem with the reading with my NODEMCU where i tried this code on an arduino UNO it is working perfectly fine but until i tried to switch it to NODEMCU 1.0 which have a wifi function that i need, the reading turn out to have this type of error, i've tried looking for solution online and tried every single of them but apparently none of it help. The image is the error i have faced and the connection i have made from the nodemcu to hx711 is VCC --> Vin or 3.3v, GND --> GND, DT --> D2, SCK --> D3. Here's the code that i found online to use:

#include <HX711.h>
// Scale Settings
const int SCALE_DOUT_PIN = D2;
const int SCALE_SCK_PIN = D3;
HX711 scale(SCALE_DOUT_PIN, SCALE_SCK_PIN);
void setup() {
 Serial.begin(115200);
 scale.set_scale(-47740);// <- set here calibration factor!!!
 scale.tare();
}
void loop() {
 float weight = scale.get_units(1);
 Serial.println(String(weight, 3));
}

Thanks in advance!!

asked Oct 29, 2018 at 9:44
5
  • Putting your whole code in comments is not helpful. I edited your post this time, remember to select code and then ctrl+k Commented Oct 29, 2018 at 9:59
  • Sorry about that, would keep in mind about it! Appreciate your help thanks! Commented Oct 29, 2018 at 10:04
  • try D1 instead of D3. D3 is io 0, a boot configuration pin Commented Oct 29, 2018 at 10:24
  • Hi juraj! Thanks for the reply. i tried D1 and the Serial monitor now shows a reading of 0.000 all the way regardless of the weight i put on it. Commented Oct 30, 2018 at 4:23
  • Hi juraj, i have change the VCC connection from Vin to 3.3v and it work! thanks!! could you post your answer on the answer section so i could upvote? thanks for the help!! Commented Oct 30, 2018 at 4:36

1 Answer 1

1

Try D1 instead of D3. D3 is io 0, a boot configuration pin with pull-up on board.

answered Oct 31, 2018 at 13:03

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.