Perfect Measurements: Precision Filling
The Precision Filling Module is a staple in the food and chemical packaging industry. It uses gravity and active weight feedback to dispense materials with sub-gram accuracy, making it perfect for filling spice bottles, coffee bags, or liquid vials.

The Feedback Loop
The system operates on an active feedback loop between a scale and a valve:
- Tare: You place an empty bottle on the scale. The Arduino zeroes the weight (Tare).
- Bulk Fill (Fast): The Arduino opens a large solenoid valve (or a strong servo gate) to 100%. The material pours in rapidly.
- Dribble Fill (Slow): When the scale hits 90% of the target weight (e.g., 90g out of 100g), the Arduino partially closes the valve to slow the flow to a trickle.
- Cutoff: The instant it hits 100g, the valve snaps shut, preventing any overfill.
Required Hardware
- Arduino Uno/Nano.
- HX711 Load Cell Amplifier: Essential for converting the tiny analog voltage changes in the metal scale into heavy, readable digital weights.
- 5kg or 10kg Load Cell (Strain Gauge).
- Servo Motor or Solenoid Valve: The dispensing gate.
Calibration Nightmare
Load cells don't output "Grams"; they output raw numbers. You must run a calibration sketch at the start. You place a known weight (like a 500g dumbbell) on the load cell, record the raw number, and then use that as the calibration factor (scale.set_scale(calibration_factor);) for all future measurements!