Inventory Source Code for Arduino: Parts Counter by Weight

For stockroom keepers with screws, connectors or spare parts in bins: count a bin by weight right here, then let an Arduino Uno do it all day and light the reorder alarm.

Full version — $44 once: the 5 Arduino Uno sketches that make the bin count itself, with wiring tables. Get the sketch pack

What the paid pack does on the shelf

SketchJobWhat a tutorial leaves out
ScaleCalibrationTare and per-part value from 20 of your own partsRejects a sample that is too light; a silent HX711 is a fault, not zero
BinScaleCounterCounts one bin all day, reorder LED + buzzerStability gate (hand in the bin), ambiguity check, hysteresis, ACK button
BreakBeamInOutIn/out count through a chute with two IR beamsCounts only a full pass, jam pause, pass timeout, never below 0
TwoBinKanbanReorder lights for 4 two-bin locationsLatch + 2 s confirm timers so a quick lift is ignored
StockLedgerEEPROM+1/−1 buttons or IN/OUT/SET from a PC, survives power cutsNever negative, corrupt-EEPROM check, batched writes

No libraries to install: the HX711 is read with the core API, and EEPROM.h ships with the Arduino AVR core. Install: unzip as is (each .ino sits in a folder of the same name) ▸ open it in Arduino IDE ▸ pick Board “Arduino Uno” and your port ▸ Upload. Menu names differ slightly by IDE version and UI language.

Yardstick: Uline lists its Industrial Counting Scale H-1114 (6 lb x .0005 lb) at $558 each (uline.com, checked 2026-10-18).

Get the full version $44

The 5 Arduino Uno sketches that make the bins count themselves all day: HX711 read with no library, calibration from your own parts, a stability gate so a hand in the bin is never counted, a reorder alarm with hysteresis and a silence button, a two-beam in/out counter with jam detection, a 4-locatio

One payment, one licence key for this tool. The key is shown right after payment.

Uline Industrial Counting Scale H-1114 (6 lb x .0005 lb): $558 each on uline.com, checked 2026-10-18.

Buy the full version — $44

Need more than this one? ReadyStack Pass opens all 544 files and 493 full versions — $29/month or $199/year. See the Pass →

Embed this calculator on your site (free)

Paste this code into your page. It runs in your visitor’s browser and stays up to date. Nothing your visitors type is stored.

 All embeddable tools

For businesses: your name and logo instead of ours, and each visitor’s result + e-mail in your inbox (only when they tick consent) — Pro from $19/month. See Pro →

Email me this result
A copy of what you see above, in your inbox — the tool stays free, nothing here is locked.

· ReadyStack

Worked example

Real numbers from this tool, line by line.

Inventory source code for Arduino: a bin that counts its own parts

For stockroom keepers with parts in bins: a 412.0 g bin that weighs 1,062.0 g today holds 280 parts, and at a reorder point of 300 that means reorder now. Here is the count, step by step, from 20 sample parts that weigh 46.4 g:

StepValue
Weight per part (46.4 g / 20)2.320 g
Parts weight (1,062.0 g - 412.0 g)650.0 g
Exact quotient (650.0 / 2.320)280.17
Parts in the bin280
Distance from a whole part0.17 part, a clean count
Reorder point 300REORDER now

Weigh one part on its own on a 1 g kitchen scale instead and it reads 2 g. 650 / 2 = 325 parts. That is 45 parts too many, and it sits above the reorder point of 300, so the reorder never fires. A 20-part sample on the same bin gives 280.

Why a count, not a weight

Every free load-cell tutorial ends at "print grams". A stockroom needs a whole number of parts and a yes or no for reordering. Three things decide whether that number can be trusted:

  1. The sample. The per-part value comes from many parts, not one. ScaleCalibration rejects a sample whose raw reading is below MIN_SAMPLE_RAW and tells you to add more parts.
  2. Stillness. BinScaleCounter only accepts a reading after the weight has stayed within STABLE_BAND_RAW for STABLE_MS (1,500 ms by default). On our host simulation, a weight jumping every 300 ms, like a hand in the bin, produced no count at all.
  3. Whole parts. If the weight sits more than 0.35 part away from a whole count, the sketch prints AMBIGUOUS and keeps the last good count. 280.5 parts' worth of weight printed "AMBIGUOUS: 49% off a whole part".

The alarm uses hysteresis: it switches on at REORDER_AT (300) and clears only at REARM_AT (330). In the simulation, a partial refill to 310 left the LED on, and a refill to 400 cleared it. The ACK button silences the buzzer, but the LED stays on until the bin is refilled.

No library, no calibration weight

The HX711 is read with digitalRead and digitalWrite, so there is nothing to install from the Library Manager. If the HX711 is dead or miswired, the sketch reports a fault instead of reading zero. Calibration uses your own parts, not a reference weight: send t with the empty bin, put 20 parts in, send s, and paste the two printed const lines.

The other four jobs in the pack

All 5 sketches compile for the Arduino Uno with arduino-cli: from 2,910 bytes (TwoBinKanban) to 4,010 bytes (StockLedgerEEPROM) of 32,256.

Try your own bin first

The page counts any bin from three weights off any scale, and shows whether your reorder point is reached. The sketches that do it all day at the shelf are the paid part. For scale: Uline lists its Industrial Counting Scale H-1114 at $558 each for one bench.

15 seconds — what it actually does

Questions people ask

What does this inventory source code for Arduino actually do?

Five Arduino Uno sketches count stock without a PC: BinScaleCounter counts parts in a bin by weight and raises a reorder alarm, BreakBeamInOut counts items in and out through a chute, TwoBinKanban lights a reorder LED for 4 bin locations, StockLedgerEEPROM keeps a count that survives power cuts, and ScaleCalibration sets the scale up from your own parts.

Who is this Arduino inventory pack for?

Makerspace, repair-shop and small-assembly stockroom keepers who keep screws, connectors or spare parts in bins and already own an Arduino Uno plus an HX711 load-cell board, IR break beams or microswitches. You want a reorder light at the shelf, not another spreadsheet that nobody updates.

Why not use a free Arduino load-cell tutorial?

Free load-cell tutorials need the HX711 library and a calibration weight, and they print grams. None of them counts whole parts, refuses to count while a hand is in the bin, flags a weight that sits between two counts, or holds a reorder alarm with hysteresis so it does not flicker at the threshold. These sketches do all four with the core API only.

What can I do free on the page?

Type your empty-bin weight, the weight of a sample of your parts and today's bin weight from any kitchen or postal scale. Example: 412.0 g bin, 20 parts weighing 46.4 g, 1,062.0 g today gives 280 parts, a clean count, and REORDER at a 300 reorder point. A 1-part sample on a 1 g scale would read 325. The sketches that do this all day are the paid part.

How does the price compare with a ready-made counting scale?

Uline lists its Industrial Counting Scale H-1114 (6 lb x .0005 lb) at $558 each on uline.com, checked 2026-10-18, for one bench. This pack is $44 once and runs on an Arduino Uno and HX711 board you already own. It adds a reorder alarm, a two-beam in/out counter, a 4-location kanban light and a power-cut-safe ledger.

Ask about this tool

One question, answered by the person who built it. Your email only if you want the answer sent.