Arduino-based tool to measure package size and weight.
An Arduino-based “box-sizing-tool”, that allows packages to be placed on a surface and reads back their weight, width, length and height.
If you want to just use the tool, connect it to power and make sure the scale is connected, otherwise it won’t initialize. Don’t place anything on the scale, or it will be tared wrong. Then wait for the logos to show, and place a package on the loading surface. The live values will be shown on the onboard screen.
If you want to make changes, download the entire repository and install all the Arduino libraries listed below. Open the folder as a PlatformIO Project.
Just run and change the main.cpp
file like a normal Arduino file and flash it to the board as usual.
An ultrasonic sensor is used to measure the distance to the package. That distance is subtracted from the distance of the sensor to the central axis, returning the size of the corresponding side of the package. This is done three times in sequence, once for every side, resulting in all the package’s sides being measured.
Four 50 kg load cells, placed beneath the loading surface and in direct contact with it, measure the weight of the package. All the size and weight measurements are then displayed on the Arduino’s onboard screen. This sequence is repeated continuously and indefinitely.
Emits an ultrasonic wave and measures the time it takes to reflect back. That time is then converted to distance in the code (learn more).
The spring loaded cell bends under load. A strain gauge perceives the this and returns a value for it. This value is converted into usable units using a factor. In the code, the outputted value is also adjusted through multiplication, to correct a measurement issue (learn more).
The project is based on the Heltec WiFi Kit 8. It is based on the ESP8266 microcontroller and uses up to 6V input. It has an onboard screen and WiFi a antenna (learn more).
The pinout diagram is here.
A diagram for the wiring is available here.
The code sequence is written in C++, but based on Arduino. It therefore uses Arduino libraries and needs an Arduino IDE installation. This version is written on VSCode and uses PlatformIO to manage it.
Libraries: HX711, SPI, Wire, PCF8574, Adafruit_GFX, Adafruit_SSD1306 and AdafruitBusIO.
The project hasn’t been finished due to a few problems that occur during operation:
Some work has to be done:
If there’s something missing or something isn’t clear, contact me.