Depending on cylinder size, ( beaker?) Cheap scales have 1gm resolution, I have a $30 one that does 400 gm +/- 0.1 with auto-zero for the empty container, then you can re-zero after adding each ingredient. One peppercorn is 0.1g
Interfacing to an existing scale is much easier than DIY from scratch.
The capacitance method ought to work as a linear height scale, but far less accurate than weight using strain gauges, but perhaps easier on the mechanical design.