DIY Arduino Smart Digital Scale | ESP8266 + HX711

by mcmchris in Circuits > Arduino

11268 Views, 107 Favorites, 0 Comments

DIY Arduino Smart Digital Scale | ESP8266 + HX711

DigitalScale.jpg

Hello to everyone, today I am here to show you a very insteresting project that I was working on for a while, it consists on a digital scale using the ESP-12S microcontroller plus a load cell and it HX711 wheatstone bridge to i2c converter, it is capable to measure weight precisely in the spectrum of grams, the sensor I am using is limited to 5Kg but you can use one for smaller or bigger weights.

As you can noticed, I am using the ESP8266 so it has WiFi capabilities that let me in the future send the measure data to the cloud.

The code can be modified to allow the scale to count objects, calculate liquid volume or what you imagine to do with force measuring.

Here I leave you a tutorial with all the information so you can make your own version.If you are a visual learner I know that a video worth more than 1000 words, so here is a Tutorial video. (I am a Spanish speaker, so please consider turning on English subtitles):

Skills Required:

Screenshot (45).png
Screenshot (53).png

This project may seem difficult or very complex, but it is definitely not completely, since you will have all the guidance for the construction, it was difficult for me to design it to make life a little easier for you. Any conceptual doubt, you are free to ask it without problems.


  • You should have an understanding of:
  • 3D Printing (Optional for the case).
  • Arduino programming (I give you the code).
  • Soldering through hole components.

Components and Parts List

Screenshot (42).png
Screenshot (48).png
Screenshot (60).png

The Electronics discrete components as resistors and transistors will be attached in a BOM file attached here.

🛒Materials to build it without PCB:

🛒Materials to build it wit custom PCB:

Circuit Diagram and Schematic

Schematic_Balanza_2021-04-28.png

Here is the Circuit Diagram of our project:

It has all the internal conections of the circuit that will us allow to create the PCB design later.

I also attached the PDF of the Schematics so you can see it better.

PCB Design and Ordering

Screenshot (42).png
Screenshot 2021-04-28 115253.png
Screenshot 2021-04-28 115334.png
Screenshot (43).png

For the implementation of a good project we need a reliable assembly for the circuit that makes it up, and there is no better way to do it than with a good PCB.

Here you can download for FREE the Gerber, BOM and Pick & Place Files, the ones you need to order your PCB on your PCB manufacturing company.

I suggest JLCPCB:

$2 for 1-4 Layer PCBs⚡, Get SMT Coupons🎫

3D Design & Parts

Screenshot (49).png
Screenshot (50).png
Screenshot (52).png
Screenshot (54).png
Screenshot (63).png

Here you have the STL files for the 3D parts of the project.

  • Case.
  • Plate

Downloads

Assambling the Whole Project

Screenshot (55).png
Screenshot (56).png
Screenshot (58).png
Screenshot (57).png
Screenshot (62).png
Screenshot (44).png
Screenshot (61).png
Screenshot (59).png
Screenshot (60).png
Screenshot (63).png
  1. Insert the PCB on the 3D printed case.
  2. Fix the load cell.
  3. Wire up everything with jumper wires.
  4. Glue the button panel.
  5. Place and wire the OLED display.
  6. Fix the plate of the scale and close the case with it.

Code and Programming the ESP8266 Microcontroller

Screenshot (65).png
Screenshot (66).png
Screenshot (67).png
Screenshot (68).png
Screenshot (69).png
Screenshot (64).png
Screenshot (75).png
Screenshot (74).png

Download the CODE here for FREE (just insert 0 in the charge box).

Install the Hx711 Library and Ug2lib attached.

After you have opened the code in your Arduino IDE verify:

  1. That line 26 has: float CALIBRACION = 475910.00;
  2. That line 97 is commented: //CALIBRACION = eeGetInt(addr);
  3. This let us firstly to set a calibration parameter that would next be tuned to get the right measurements.
  4. Select the NodeMCU 1.0 board. and the right port after connecting the main board of the project to your PC USB port.
  5. Upload the code.
  6. The scale need to be calibrated, see next step.

Calibrating the Scale

Screenshot (70).png
Screenshot (71).png
Screenshot (72).png
Screenshot (73).png

After uploading the code the first time, the scale is uncalibrated and if you put for example 1 pound of rice (this was my reference) the lecture will be wrong but near, this why I set the "CALIBRACION" variable to 475910.00, this number work for me, could be different for you.

With the reference Load on the scale (1 pound of rice), click the 2nd button for 2 seconds to calibrate (avoid touching the scale plate). It should now shows on the display the corrected weight, if not, repeat the step.

Start Weighing All Kinds of Objects and Enjoy Your Project

Screenshot (76).png
Screenshot (77).png
Screenshot (78).png
Screenshot (79).png
Screenshot (80).png
Screenshot (82).png

The 4th button is the "zero set" or "tare" one.

The 3rd button change the unit from kilograms to pounds.

The 2nd button is for calibrating.

The 1st button is free, so you can add the function you want to it.

Real Scenario Test - Let's Cook Some Rice (half a Pound)

Screenshot (83).png
Screenshot (84).png
Screenshot (85).png
Screenshot (86).png
Screenshot (40).png
Screenshot (87).png

Here in Dominican Republic the white rice is part of the Dominican Flag plate, so let's cook some rice, for that we need to boil some salted water and oil, the when apply the rice, but we need exactly half a pound so:

  1. We take the DIY Digital Scale to the kitchen.
  2. Place a cup on top.
  3. Click on the Zero set button.
  4. Fill the cup with rice until the display says 0.500 lbs.
  5. Then we are ready to put the rice in the cooking pot.

Hope you like the project.