-
Upload calibration version first.
-
Pick an object with know weight.
-
Run Serial Monitor to write down the readings.
-
Load the FIANL version.
-
Update the following line:
-
//REPLACE WITH YOUR CALIBRATION FACTOR
-
#define CALIBRATION_FACTOR xxxx.xxxx
-
Test.
-
Enjoy!
This project demonstrates how to use an ESP8266 microcontroller, an HX711 load cell amplifier, and an SSD1306 OLED display to create a simple weight scale. The project also includes a push-button for taring (zeroing) the scale. The project was developed with the assistance of an OpenAI expert, making it perfect for beginners and hobbyists who want to learn more about ESP8266 and its capabilities.
- Measure weight using an HX711 load cell amplifier
- Display the weight on an SSD1306 OLED display
- Tare (zero) the scale using a push-button
- Easy to set up and use, perfect for beginners
- Clear instructions and guidance for assembly and usage
- ESP8266 microcontroller (e.g., NodeMCU or Wemos D1 Mini)
- HX711 load cell amplifier
- Load cell
- SSD1306 OLED display (128x64 pixels, I2C interface)
- Push-button
- Breadboard
- Jumper wires
- HX711 library by Bogdan Necula
- Adafruit GFX library
- Adafruit SSD1306 library
- Pushbutton library by Pololu
- HX711:
- Connect
LOADCELL_DOUT_PIN
toD6
on the ESP8266 - Connect
LOADCELL_SCK_PIN
toD7
on the ESP8266 - Connect the HX711 to the load cell according to the manufacturer's specifications
- Connect
- OLED display (I2C):
- Connect
SDA
toD2
on the ESP8266 - Connect
SCL
toD1
on the ESP8266 - Connect
VCC
to3.3V
or5V
on the ESP8266 (depending on your display's voltage requirements) - Connect
GND
toGND
on the ESP8266
- Connect
- Push-button:
- Connect one side of the push-button to
D5
on the ESP8266 - Connect the other side of the push-button to
GND
on the ESP8266
- Connect one side of the push-button to
- Download and install the Arduino IDE on your computer: Arduino IDE Download
- Install the required libraries mentioned above using the Arduino Library Manager.
- Set up your hardware according to the pin connections provided.
- Connect your ESP8266 board to your computer using a USB cable.
- Open the Arduino IDE and create a new sketch.
- Copy and paste the provided code into the Arduino IDE.
- Replace the
CALIBRATION_FACTOR
in the code with your own calibration factor. This value is obtained by calibrating the scale with known weights. - Select the appropriate board and port for your ESP8266 in the Arduino IDE under the "Tools" menu.
- Upload the code to your ESP8266 board.
Once the code is uploaded, the OLED display should show the current weight. Press the push-button to tare (zero) the scale.
-
If the OLED display does not show any output, double-check the I2C connections and ensure that the display's voltage requirements are met (either 3.3V or 5V, depending on your specific display).
-
If the weight readings are inaccurate, ensure that the load cell is connected correctly to the HX711 and that the CALIBRATION_FACTOR is properly set.
-
If you encounter issues with the push-button, check its connections and ensure that it is wired correctly to the ESP8266.
-
If you still face issues, try to isolate the problem by testing each component individually. For example, you can test the OLED display using example sketches provided by the Adafruit SSD1306 library, and you can test the HX711 and load cell using example sketches from the HX711 library.
Feel free to ask for further assistance if you encounter any issues or have questions about the project. Good luck, and have fun exploring the capabilities of the ESP8266!