ESP32

IoT Weighing Scale using Load cell HX711, ESP32, & New Blynk V2.0

IoT Weighing Scale:

IoT Weighing Scale using Load cell HX711,ESP32, & New Blynk V2.0- In today’s article, you will learn how to make an IoT based digital weighing scale using ESP32 WiFi + Bluetooth module, HX711 amplifier board, a load cell, and the new Blynk V2.0.

Arduino and ESP32 are completely different controller boards. Arduino is a 5V compatible controller board while the ESP32 WiFi + Bluetooth module is a 3.3V compatible controller board. And this is the reason, the calibration value of the HX711 and Load cell that works with the Arduino doesn’t work with the ESP32 Controller board. For ESP32 we will need to repeat the same calibration procedure again and we will also need to reduce the speed of the ESP32 module. With this IoT weighing Scale you can monitor the values from any part of the world.




allpcb circuit

IoT Weighing Scale

Previously, I used the same HX711 amplifier board and the same 5Kg Load cell with the Arduino and explained the most basic things including, the mechanical setup, Load cell working mechanism, HX711 amplifier board technical specifications and its interfacing with Arduino, how to calibrate the HX711, and its programming. I highly recommend, read my article on the Arduino Weighing Scale.

IoT Weighing Scale

I am going to continue with the same setup, but it’s not compulsory, you can also get your Load cell fixed on a wooden sheet and it doesn’t matter if you have a 5Kg or 10Kg or any other load cell because the method I am going to explain can be implemented on similar load cells and HX711 amplifier boards.

Anyway, while fixing the Load cell, pay close attention to the Arrow head, it should be pointing in the downward direction.

IoT Weighing Scale

You can use any of these HX711 amplifier boards as both modules have got the same pinouts. The only difference is in their size. So, without any further delay let’s get started!!!



Amazon Links:

ESP32 WiFi + Bluetooth Module(Recommended)

HX711 Amplifier board

Load cell or strain gauge

*Disclosure: These are affiliate links. As an Amazon Associate I earn from qualifying purchases.

HX711 Load Cell interfacing with Arduino:

IoT Weighing Scale

Connect the Red and Black wires of the Load cell to the HX711 amplifier board E+ and E-.

Connect the White and Green wires of the Load cell to the HX711 Amplifier board A- and A+ respectively.

Connect the VCC and GND pins of the HX711 board to the ESP32 3.3V and GND.

Connect the SCK and DT pins to the ESP32 pins 19 and 23.



ESP32 Board installation in the Arduino IDE:

If this is your first time using the ESP32 WiFi + Bluetooth, then first of all, you will need to install the ESP32 board in the Arduino IDE. You can also confirm this by going to the Tools Menu > then Board.

IoT Weighing Scale

You can clearly see, the ESP32 board is not available in the list.

In order to program the ESP32 board using the Arduino IDE, first we need to install it. For this open my article on the ESP32 Arduino IDE Board Manager Installation. Scroll down and copy this link.

IoT Weighing Scale

Go back to the Arduino IDE. Now, go to the File Menu > then to Preferences, and paste the URL link in the Additional Boards manager URLs.

IoT Weighing Scale



Next, go to the Tools Menu, then to Board and click on the Boards Manager. Search for the ESP32.

IoT Weighing Scale

While the latest version is selected click on the Install button and that’s it. It may take several minutes depending on the internet speed on your side. Anyway, once the installation is completed then you can go to the boards list to check if the ESP32 board has been installed.

IoT Weighing Scale

If you can see ESP32 then it means you have done everything correctly.




Blynk Library Installation:

Next, we will install the Blynk Library. For this go to the sketch menu > then to Include Library > and click on the Manage Libraries.

IoT Weighing Scale

Search for the Blynk and install it.

IoT Weighing Scale

As you can see on my side its already installed.



HX711 Library:

While the Arduino IDE is open, go to the Sketch Menu > then to Include Library > and click on the Add .ZIP Library.

IoT Weighing Scale

Browse to the location and select this zip folder.

Download HX711 Library

IoT Weighing Scale

And click the Open button.

The ESP32 board and all the required libraries have been installed; so, now we can start with the Blynk Web Dashboard and Blynk IoT application.

Blynk Web Dashboard Setup:

Open the Blynk web and click on the New Template

IoT Weighing Scale

Write the Project name, select the hardware, and connection type. If you want you can also add a short description. After entering all the required details then click on the Done Button.

IoT Weighing Scale



The home page will open for creating the Web dashboard. You can see the project name “IoT weighing Scale”.

IoT Weighing Scale

Now click on the Datastreams > then click on the New Datastreams, and select the virtual pin

IoT Weighing Scale

Then enter the Virtual pin Datastream details and click on the Create button. The max value is 5 because, the Load Cell I am using can measure maximum weights up to 5Kg.

IoT Weighing Scale

After that click on the + New Datastream and select Virtual Pin. If you don’t want to add another Virtual Pin then you can skip this step. And if you want to add multiple Virtual Pins then you can create new virtual Pins by clicking on the + New Datastream. In my case I need another virtual pin.

IoT Weighing Scale



Add the required details for the Virtual Pin.

IoT Weighing Scale

Now the two virtual pins DataStream are created. Next, click Web Dashboard.

IoT Weighing Scale

Then double click on the Gauge to add it to the Canvas or simply drag and drop.

IoT Weighing Scale

Then click on the Gauge setting by clicking on the Gear icon.

IoT Weighing Scale

Enter the Title and select the desired virtual pin and click on the save button.

IoT Weighing Scale

The same way add label to the Canvas.

IoT Weighing Scale

Follow the same steps. Enter the title, choose the Datastream, and finally click on the Save Button.

IoT Weighing Scale




The two gauges are created for displaying the Weight values.

IoT Weighing Scale

Skip the Automation, Metadata, Events tabs as these are not required in our project and click on the save button.

IoT Weighing Scale

Click on the search.

IoT Weighing Scale

Click on the new device.

IoT Weighing Scale

Click on the from template.

IoT Weighing Scale

Then choose the template and click on the Create button.

IoT Weighing Scale

Then copy the New device Created! Credentials as you can see on the left side.

IoT Weighing Scale

Paste these credentials in the code.

IoT Weighing Scale



IoT Weighing Scale ESP32 Programming:

Select the ESP32 Dev Module and the communication port, and finally, click on the Upload button M.ake sure you change the ssid and password. Anyway, once the program is uploaded, go back to your Blynk Web Dashboard, apply some force on the Load cell and you will see the weight value.

IoT Weighing Scale

So, far everything is working. Now, let’s set up the Blynk IoT application.



IoT Weighing Scale Blynk application:

Open the Blynk IoT Application.

IoT Weighing Scale

Then click on the IoT Weighing Scale.

IoT Weighing Scale

Then click on the settings button.

IoT Weighing Scale

Developer mode will open.

IoT Weighing Scale



Then click on the add button to insert a Gauge.

IoT Weighing Scale

The gauge will be added to the dashboard.

IoT Weighing Scale

Click on the gauge the setting will be appeared

IoT Weighing Scale

Then select the required Datastream for the gauge

IoT Weighing Scale

After that click on the design button.

IoT Weighing Scale




Then give a Title, align the text, and set the text size.

IoT Weighing Scale

Then adjust the gauge size.

IoT Weighing Scale

After adjusting the gauge size click on the add button and add the labeled value.

IoT Weighing Scale

Click on labeled value widget

IoT Weighing Scale



Then select the required DataStream.

IoT Weighing Scale

Follow the same steps, enter the tile, align the text, and increase the fonts size, etc.

IoT Weighing Scale

The IoT Weighing scale application is also ready.

IoT Weighing Scale



IoT Weighing Scale Demonstration:

I am going to power up my ESP32 development board using my created 4S lithium Ion Battery. But you can also use a 12V adaptor, or even you can use your laptop to power up the ESP32 module.

The ESP32, my laptop, and cell phone all are connected to the Internet. You can use the same or different Wifi networks.

IoT Weighing Scale

I am going to start with this 2Kg weight and let’s see if my IoT weighing scale can accurately measure this weight.

IoT Weighing Scale

The weight value is a bit off.

IoT Weighing Scale

Next, I am going to test my IoT weighing scale with this 3Kg weight; just to confirm whether the weight I am testing is wrong or if my IoT Weighing Scale calibration value is wrong.

IoT Weighing Scale



The difference is almost the same .07 grams. This means we need to calibrate our weighing scale.

IoT Weighing Scale

Open the programming and play with this calibration_factor value until you are happy with the final value. For me this value worked. So, you can start with this value. If it’s work for you then ok otherwise you can try different values. Anyway, I have already uploaded this program and now let’s check the calibrated version of the IoT Weighing Scale in action.

IoT Weighing Scale

Now, I am pretty satisfied with the final value. .01 grams difference may be due to the rusting, paint, etc. This is not a standard weight. Anyway, I also tested it with Blynk Dashboard and it was working just perfectly.

IoT Weighing Scale

For the step-by-step explanation and practical demonstration of the IoT weighing scale; watch my video tutorial. And don’t forget to like, share, and subscribe.

Read my article on how to make a DIY commercial-level Weighing Scale using Arduino. I compared my created Diy weighing scale with the commercial scale and was amazed by the final results. Diy Scale Vs. Comercial Scale.



Watch Video Tutorial:

 

Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button