Categories
TUTORIALS

Monitor shelf capacity with Arduino and load cell sensors

This tutorial outlines how to use an Arduino Uno microcontroller (or equivalent device) and load cell sensors to measure the weight of objects on a shelf. Being able to measure weight in this way is more efficient than weighing each item individually on a scale and calculating the total. Additionally, setting up these sensors and creating a “smart shelf” allows users to make inferences about the shelf’s capacity from a distance. This could be particularly helpful for folks in charge of keeping refrigerators, pantries, or other supply shelves stocked. NOTE: This tutorial is written for load cell sensors with maximum force measures of 5kg or 11lbs. The power source will need to be adjusted for other forces.

Parts List

  • Arduino Uno (or equivalent)
  • Arduino-to-USB cable
  • The power supply of 5V
  • Breadboard (optional)
  • Load Cell (max force of 5kg or 11 lbs; pictured below)
  • HX711 module
  • 4 Male-Female jumper wires
  • 4 Male-Male jumper wires
  • Method of attachment for a particular use (i.e. screw and screwdriver, electrical tape, freezer tape, etc.)
Load Cell Weight Sensor (5kg max force), https://www.amazon.com/Digital-Weighing-Arduino-Portable-Electronic/dp/B09K7GMRVQ/ref=cm_cr_arp_d_pl_foot_top?ie=UTF8&th=1

Hardware Setup

A circuit diagram is included at the end of step 2 to assist with setup.

To connect the load cell sensor to Arduino, an HX711 module converter chip is used to provide a bridge voltage at a low cost while maintaining high precision. In this tutorial, a breadboard is used to stabilize the connection of the jumper wires to the module, but this step is not completely necessary.

Step 1: Connect the load cell wires to the HX711 module using 4 Male-Female jumper wires. NOTE: you may need to strip the load cell wires for them to fully connect.

HX711 Module, https://hackster.imgix.net/uploads/attachments/893742/figure3-hx711_(1)_5UvW2uFrNm.jpg?auto=compress%2Cformat&w=1280&h=960&fit=max

The wires should be configured as such:

  • Red E+
  • White E-
  • Black A-
  • Green A+

Step 2: Connect the HX711 module to the Arduino microcontroller using 4 Male-Male jumper wires.

The wires should be configured as such:

HX711 ModuleArduino Uno
GndGnd
DTDigital 3
SCKDigital 2
Vcc5V

Circuit Diagram

NOTE: E-(White) and A- (Black) configurations may vary among load cells. Consult your product details to ensure proper setup.

Step 3: Position the load cell.

Typically, there is an arrow on the load cell indicating the force direction. Attach the load cell to the bottom of the shelf with the arrow pointing down.

Arduino Project Hub: https://create.arduino.cc/projecthub/electropeak/digital-force-gauge-weight-scale-w-loadcell-arduino-7a7fd5

Attaching the load cell can be tricky depending on the shelf. Space is required between the load cell and the shelf in order for it to function properly. This is best achieved by attaching the load cell with a screw if possible. However, an easy way to avoid creating holes in your shelf is to use tape and/or a styrofoam piece to maintain the gap while still being able to attach the load cell to the shelf.

Arduino Configuration

Once everything is in place, it is time to set up the Arduino to properly take weight measurements. Think of this step as “zeroing out” a scale.

Step 1: Calibrating the HX711 module and initializing the weight at 0.

NOTE: you will need the HX711 library which can be downloaded as a zip file here under the “Schematics” section.

Step 2: Measuring the weight of objects on a shelf. Place a few lightweight items on the shelf and then upload the following sketch to Arduino. The measured weights will print to the serial monitor.

Have fun!

Once you have weight measurements, the possibilities are endless! Measurements from the serial monitor can be exported to a log for safekeeping, combined with measurements from another sensor on the same or different shelves, or can even be displayed on a digital display.

References

Arduino Project Hub

SparkFun Electronics

Last Updated by Kristin Chang on April 03, 2022.

One reply on “Monitor shelf capacity with Arduino and load cell sensors”

Leave a Reply

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